///-------------------------------------------------------------------------------- /// <summary>This method sets the default values.</summary> ///-------------------------------------------------------------------------------- protected override void OnSetDefaults() { if (StepTransition.ReverseInstance != null) { EditStepTransition.TransformDataFromObject(StepTransition.ReverseInstance, null, false); } else if (StepTransition.IsAutoUpdated == true) { EditStepTransition.TransformDataFromObject(StepTransition, null, false); } else { StepTransition newStepTransition = new StepTransition(); newStepTransition.StepTransitionID = EditStepTransition.StepTransitionID; EditStepTransition.TransformDataFromObject(newStepTransition, null, false); } EditStepTransition.ResetModified(true); }
///-------------------------------------------------------------------------------- /// <summary>This method updates the view model data and sends update command back /// to the solution builder.</summary> ///-------------------------------------------------------------------------------- protected override void OnUpdate() { // set up reverse engineering instance if not present if (StepTransition.ReverseInstance == null && StepTransition.IsAutoUpdated == true) { StepTransition.ReverseInstance = new StepTransition(); StepTransition.ReverseInstance.TransformDataFromObject(StepTransition, null, false); // perform the update of EditStepTransition back to StepTransition StepTransition.TransformDataFromObject(EditStepTransition, null, false); StepTransition.IsAutoUpdated = false; } else if (StepTransition.ReverseInstance != null) { EditStepTransition.ResetModified(StepTransition.ReverseInstance.IsModified); if (EditStepTransition.Equals(StepTransition.ReverseInstance)) { // perform the update of EditStepTransition back to StepTransition StepTransition.TransformDataFromObject(EditStepTransition, null, false); StepTransition.IsAutoUpdated = true; } else { // perform the update of EditStepTransition back to StepTransition StepTransition.TransformDataFromObject(EditStepTransition, null, false); StepTransition.IsAutoUpdated = false; } } else { // perform the update of EditStepTransition back to StepTransition StepTransition.TransformDataFromObject(EditStepTransition, null, false); StepTransition.IsAutoUpdated = false; } StepTransition.ForwardInstance = null; if (StepTransitionNameCustomized || FromStepIDCustomized || DescriptionCustomized || TagsCustomized) { StepTransition.ForwardInstance = new StepTransition(); StepTransition.ForwardInstance.StepTransitionID = EditStepTransition.StepTransitionID; StepTransition.SpecSourceName = StepTransition.DefaultSourceName; if (StepTransitionNameCustomized) { StepTransition.ForwardInstance.StepTransitionName = EditStepTransition.StepTransitionName; } if (FromStepIDCustomized) { StepTransition.ForwardInstance.FromStepID = EditStepTransition.FromStepID; } if (DescriptionCustomized) { StepTransition.ForwardInstance.Description = EditStepTransition.Description; } if (TagsCustomized) { StepTransition.ForwardInstance.Tags = EditStepTransition.Tags; } } EditStepTransition.ResetModified(false); OnUpdated(this, null); // send update back to solution builder SendEditStepTransitionPerformed(); }
///-------------------------------------------------------------------------------- /// <summary>This method resets the data.</summary> ///-------------------------------------------------------------------------------- protected override void OnReset() { EditStepTransition.TransformDataFromObject(StepTransition, null, false); EditStepTransition.ResetModified(false); }