/// <summary> /// Reconstitutes this object from the specified XmlSerializationContext. /// </summary> /// <param name="xmlsc">The specified XmlSerializationContext.</param> public override void DeserializeFrom(XmlSerializationContext xmlsc) { m_model = (Model)xmlsc.ContextEntities["Model"]; m_guid = (Guid)xmlsc.LoadObject("Guid"); base.DeserializeFrom(xmlsc); m_keepingTimingData = (bool)xmlsc.LoadObject("KeepingTimingData"); #region >>> Do what else is in the constructor. <<< ExecutionDelegate = new EdgeExecutionDelegate(OnEdgeExecution); EdgeStartingEvent += new EdgeEvent(OnEdgeStartingEvent); EdgeExecutionStartingEvent += new EdgeEvent(OnEdgeExecutionStartingEvent); EdgeExecutionFinishingEvent += new EdgeEvent(OnEdgeExecutionFinishingEvent); EdgeFinishingEvent += new EdgeEvent(OnEdgeFinishingEvent); StructureChangeHandler += new StructureChangeHandler(MyStructureChangedHandler); ValidityChangeEvent += new Graphs.Validity.ValidityChangeHandler(Task_ValidityChangeEvent); ResetDurationData(); #endregion }
/// <summary> /// Creates a new instance of the <see cref="T:Task"/> class. /// </summary> /// <param name="model">The model in which the task runs.</param> /// <param name="name">The name of the task.</param> /// <param name="guid">The GUID of the task.</param> public Task(IModel model, string name, Guid guid) : base(name) { InitializeIdentity(model, name, Description, guid); ExecutionDelegate = new EdgeExecutionDelegate(OnEdgeExecution); EdgeStartingEvent += new EdgeEvent(OnEdgeStartingEvent); EdgeExecutionStartingEvent += new EdgeEvent(OnEdgeExecutionStartingEvent); EdgeExecutionFinishingEvent += new EdgeEvent(OnEdgeExecutionFinishingEvent); EdgeFinishingEvent += new EdgeEvent(OnEdgeFinishingEvent); StructureChangeHandler += new StructureChangeHandler(MyStructureChangedHandler); ValidityChangeEvent += new Graphs.Validity.ValidityChangeHandler(Task_ValidityChangeEvent); ResetDurationData(); IMOHelper.RegisterWithModel(this); }