Exemplo n.º 1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ITransitionToStep incomingConnectionsCasted = item.As <ITransitionToStep>();

                if ((incomingConnectionsCasted != null))
                {
                    this._parent.IncomingConnections.Add(incomingConnectionsCasted);
                }
                IStepToTransition outgoingConnectionsCasted = item.As <IStepToTransition>();

                if ((outgoingConnectionsCasted != null))
                {
                    this._parent.OutgoingConnections.Add(outgoingConnectionsCasted);
                }
            }
Exemplo n.º 2
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)
            {
                ITransitionToStep transitionToStepItem = item.As <ITransitionToStep>();

                if (((transitionToStepItem != null) &&
                     this._parent.IncomingConnections.Remove(transitionToStepItem)))
                {
                    return(true);
                }
                IStepToTransition stepToTransitionItem = item.As <IStepToTransition>();

                if (((stepToTransitionItem != null) &&
                     this._parent.OutgoingConnections.Remove(stepToTransitionItem)))
                {
                    return(true);
                }
                return(false);
            }