Example #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.Entry == item))
                {
                    this._parent.Entry = null;
                    return(true);
                }
                ISwitchPosition switchPositionItem = item.As <ISwitchPosition>();

                if (((switchPositionItem != null) &&
                     this._parent.Follows.Remove(switchPositionItem)))
                {
                    return(true);
                }
                if ((this._parent.Exit == item))
                {
                    this._parent.Exit = null;
                    return(true);
                }
                ISensor sensorItem = item.As <ISensor>();

                if (((sensorItem != null) &&
                     this._parent.DefinedBy.Remove(sensorItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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.Entry == null))
                {
                    ISemaphore entryCasted = item.As <ISemaphore>();
                    if ((entryCasted != null))
                    {
                        this._parent.Entry = entryCasted;
                        return;
                    }
                }
                ISwitchPosition followsCasted = item.As <ISwitchPosition>();

                if ((followsCasted != null))
                {
                    this._parent.Follows.Add(followsCasted);
                }
                if ((this._parent.Exit == null))
                {
                    ISemaphore exitCasted = item.As <ISemaphore>();
                    if ((exitCasted != null))
                    {
                        this._parent.Exit = exitCasted;
                        return;
                    }
                }
                ISensor definedByCasted = item.As <ISensor>();

                if ((definedByCasted != null))
                {
                    this._parent.DefinedBy.Add(definedByCasted);
                }
            }
Example #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)
            {
                ISwitchPosition positionsCasted = item.As <ISwitchPosition>();

                if ((positionsCasted != null))
                {
                    this._parent.Positions.Add(positionsCasted);
                }
            }
Example #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)
            {
                ISwitchPosition switchPositionItem = item.As <ISwitchPosition>();

                if (((switchPositionItem != null) &&
                     this._parent.Positions.Remove(switchPositionItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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)
            {
                ISwitchPosition followsCasted = item.As <ISwitchPosition>();

                if ((followsCasted != null))
                {
                    this._parent.Follows.Add(followsCasted);
                }
                ISensor definedByCasted = item.As <ISensor>();

                if ((definedByCasted != null))
                {
                    this._parent.DefinedBy.Add(definedByCasted);
                }
            }