コード例 #1
0
 public ScenarioForm(ScenarioComponent targetComponent, Form parentWindow)
 {
     InitializeComponent();
     MdiParent  = parentWindow;
     Tag        = targetComponent;
     hComponent = targetComponent;
     Text       = hComponent.ScenarioName + " (Scenario)";
     _mManager  = new MementoManager((IMForm)MdiParent);
     RefreshValues();
 }
コード例 #2
0
        public object Clone()
        {
            // Returns a deep (value-wise) copy of the object
            ScenarioComponent copy = new ScenarioComponent();

            copy._scenarioName        = _scenarioName;
            copy.SimParams.SimEnd     = SimParams.SimEnd;
            copy.SimParams.SimStart   = SimParams.SimStart;
            copy.SimParams.SimStartJD = SimParams.SimStartJD;
            copy.SchParams            = SchParams;
            return(copy);
        }
コード例 #3
0
 public void Clone(object value)
 {
     // Writes a deep (value-wise) copy onto the object from value
     if (value.GetType() == typeof(ScenarioComponent))
     {
         ScenarioComponent v = (ScenarioComponent)value;
         _scenarioName        = v._scenarioName;
         SimParams.SimEnd     = v.SimParams.SimEnd;
         SimParams.SimStart   = v.SimParams.SimStart;
         SimParams.SimStartJD = v.SimParams.SimStartJD;
         SchParams            = v.SchParams;
     }
 }
コード例 #4
0
 private void MaxSchedulesControl_TextChanged(object sender, EventArgs e)
 {
     try
     {
         ScenarioComponent before = (ScenarioComponent)hComponent.Clone();
         hComponent.SchParams.MaxSchedules = Convert.ToInt32(MaxSchedulesControl.Text);
         _mManager.RegisterEvent(before, hComponent, hComponent, "Reference Time Change");
     }
     catch (FormatException)
     {
         // Text box value not a double; ignore change
         MessageBox.Show("Text box value not in correct format");
     }
 }