예제 #1
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                if ((this._parent.WorkTask == item))
                {
                    this._parent.WorkTask = null;
                    return(true);
                }
                ISwitchingStep switchingStepItem = item.As <ISwitchingStep>();

                if (((switchingStepItem != null) &&
                     this._parent.ScheduleSteps.Remove(switchingStepItem)))
                {
                    return(true);
                }
                if ((this._parent.Interval == item))
                {
                    this._parent.Interval = null;
                    return(true);
                }
                ICrew crewItem = item.As <ICrew>();

                if (((crewItem != null) &&
                     this._parent.Crews.Remove(crewItem)))
                {
                    return(true);
                }
                return(false);
            }
예제 #2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                if ((this._parent.WorkTask == null))
                {
                    IWorkTask workTaskCasted = item.As <IWorkTask>();
                    if ((workTaskCasted != null))
                    {
                        this._parent.WorkTask = workTaskCasted;
                        return;
                    }
                }
                ISwitchingStep scheduleStepsCasted = item.As <ISwitchingStep>();

                if ((scheduleStepsCasted != null))
                {
                    this._parent.ScheduleSteps.Add(scheduleStepsCasted);
                }
                if ((this._parent.Interval == null))
                {
                    IDateTimeInterval intervalCasted = item.As <IDateTimeInterval>();
                    if ((intervalCasted != null))
                    {
                        this._parent.Interval = intervalCasted;
                        return;
                    }
                }
                ICrew crewsCasted = item.As <ICrew>();

                if ((crewsCasted != null))
                {
                    this._parent.Crews.Add(crewsCasted);
                }
            }
예제 #3
0
 /// <summary>
 /// Adds the given element to the collection
 /// </summary>
 /// <param name="item">The item to add</param>
 public override void Add(IModelElement item)
 {
     if ((this._parent.SwitchingStep == null))
     {
         ISwitchingStep switchingStepCasted = item.As <ISwitchingStep>();
         if ((switchingStepCasted != null))
         {
             this._parent.SwitchingStep = switchingStepCasted;
             return;
         }
     }
     if ((this._parent.ErpPerson == null))
     {
         IErpPerson erpPersonCasted = item.As <IErpPerson>();
         if ((erpPersonCasted != null))
         {
             this._parent.ErpPerson = erpPersonCasted;
             return;
         }
     }
 }
예제 #4
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                if ((this._parent.PowerSystemResource == item))
                {
                    this._parent.PowerSystemResource = null;
                    return(true);
                }
                IClearanceTag clearanceTagItem = item.As <IClearanceTag>();

                if (((clearanceTagItem != null) &&
                     this._parent.ClearanceTags.Remove(clearanceTagItem)))
                {
                    return(true);
                }
                ISwitchingStep switchingStepItem = item.As <ISwitchingStep>();

                if (((switchingStepItem != null) &&
                     this._parent.ScheduleSteps.Remove(switchingStepItem)))
                {
                    return(true);
                }
                return(false);
            }
예제 #5
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                if ((this._parent.PowerSystemResource == null))
                {
                    IPowerSystemResource powerSystemResourceCasted = item.As <IPowerSystemResource>();
                    if ((powerSystemResourceCasted != null))
                    {
                        this._parent.PowerSystemResource = powerSystemResourceCasted;
                        return;
                    }
                }
                IClearanceTag clearanceTagsCasted = item.As <IClearanceTag>();

                if ((clearanceTagsCasted != null))
                {
                    this._parent.ClearanceTags.Add(clearanceTagsCasted);
                }
                ISwitchingStep scheduleStepsCasted = item.As <ISwitchingStep>();

                if ((scheduleStepsCasted != null))
                {
                    this._parent.ScheduleSteps.Add(scheduleStepsCasted);
                }
            }