Created
October 21, 2010 18:23
-
-
Save Stray/639015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function isACommand(commandClazz:Class):Boolean | |
{ | |
if(describeType(commandClazz).factory.method.(@name == "execute").length() > 0) | |
{ | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override public function areObjectsEqual(accountVO1:AdminDataVO, accountVO2:AdminDataVO):Boolean | |
{ | |
if((accountVO1 == null) && (accountVO2 == null)) return true; | |
if((accountVO1 == null) || (accountVO2 == null)) return false; | |
if(!super.areObjectsEqual(accountVO1, accountVO2)) return false; | |
if(accountVO1.password != accountVO2.password) return false; | |
if(accountVO1.email != accountVO2.email) return false; | |
if(accountVO1.serverID != accountVO2.serverID) return false; | |
if(accountVO1.dataSetID != accountVO2.dataSetID) return false; | |
if(accountVO1.pluginMixID != accountVO2.pluginMixID) return false; | |
if(accountVO1.adminPluginMixID != accountVO2.adminPluginMixID) return false; | |
if(accountVO1.isSuspended != accountVO2.isSuspended) return false; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override public function execute():void | |
{ | |
getEditedVOSignalResponsePair.addToResponseOnce(compareData); | |
getEditedVOSignalResponsePair.dispatchRequest(); | |
} | |
private function compareData(editedVO:AdminDataVO):void | |
{ | |
var currentStoredVO:AdminDataVO = editingModel.itemBeingEdited; | |
editingModel.itemBeingEdited = dataChangeEvent.adminDataVO; | |
if(comparator.areObjectsEqual(currentStoredVO, editedVO)) | |
{ | |
return; | |
} | |
var keepHandler:Function = function():void { editingModel.updateItem(editedVO) }; | |
var discardHandler:Function = function():void {}; | |
var keepOrDiscardChangesOption:OptionAlert = new OptionAlert(OPTION_MESSAGE, KEEP, DISCARD, keepHandler, discardHandler); | |
contextView.addChild(keepOrDiscardChangesOption); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment