Exemplo n.º 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)
            {
                ILoadMgmtFunction loadMgmtFunctionItem = item.As <ILoadMgmtFunction>();

                if (((loadMgmtFunctionItem != null) &&
                     this._parent.LoadMgmtFunctions.Remove(loadMgmtFunctionItem)))
                {
                    return(true);
                }
                IConnectDisconnectFunction connectDisconnectFunctionItem = item.As <IConnectDisconnectFunction>();

                if (((connectDisconnectFunctionItem != null) &&
                     this._parent.ConnectDisconnectFunctions.Remove(connectDisconnectFunctionItem)))
                {
                    return(true);
                }
                ISwitchingOperation switchingOperationItem = item.As <ISwitchingOperation>();

                if (((switchingOperationItem != null) &&
                     this._parent.SwitchingOperations.Remove(switchingOperationItem)))
                {
                    return(true);
                }
                ISwitchSchedule switchScheduleItem = item.As <ISwitchSchedule>();

                if (((switchScheduleItem != null) &&
                     this._parent.SwitchSchedules.Remove(switchScheduleItem)))
                {
                    return(true);
                }
                if ((this._parent.CompositeSwitch == item))
                {
                    this._parent.CompositeSwitch = null;
                    return(true);
                }
                return(false);
            }
Exemplo n.º 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)
            {
                ILoadMgmtFunction loadMgmtFunctionsCasted = item.As <ILoadMgmtFunction>();

                if ((loadMgmtFunctionsCasted != null))
                {
                    this._parent.LoadMgmtFunctions.Add(loadMgmtFunctionsCasted);
                }
                IConnectDisconnectFunction connectDisconnectFunctionsCasted = item.As <IConnectDisconnectFunction>();

                if ((connectDisconnectFunctionsCasted != null))
                {
                    this._parent.ConnectDisconnectFunctions.Add(connectDisconnectFunctionsCasted);
                }
                ISwitchingOperation switchingOperationsCasted = item.As <ISwitchingOperation>();

                if ((switchingOperationsCasted != null))
                {
                    this._parent.SwitchingOperations.Add(switchingOperationsCasted);
                }
                ISwitchSchedule switchSchedulesCasted = item.As <ISwitchSchedule>();

                if ((switchSchedulesCasted != null))
                {
                    this._parent.SwitchSchedules.Add(switchSchedulesCasted);
                }
                if ((this._parent.CompositeSwitch == null))
                {
                    ICompositeSwitch compositeSwitchCasted = item.As <ICompositeSwitch>();
                    if ((compositeSwitchCasted != null))
                    {
                        this._parent.CompositeSwitch = compositeSwitchCasted;
                        return;
                    }
                }
            }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public SchedulingBasisProxy(ILoadMgmtFunction modelElement) :
     base(modelElement, "schedulingBasis")
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public LoadStatusProxy(ILoadMgmtFunction modelElement) :
     base(modelElement, "loadStatus")
 {
 }