Exemple #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)
            {
                IRemotePoint remotePointsCasted = item.As <IRemotePoint>();

                if ((remotePointsCasted != null))
                {
                    this._parent.RemotePoints.Add(remotePointsCasted);
                }
                ICommunicationLink communicationLinksCasted = item.As <ICommunicationLink>();

                if ((communicationLinksCasted != null))
                {
                    this._parent.CommunicationLinks.Add(communicationLinksCasted);
                }
            }
Exemple #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)
            {
                IRemotePoint remotePointItem = item.As <IRemotePoint>();

                if (((remotePointItem != null) &&
                     this._parent.RemotePoints.Remove(remotePointItem)))
                {
                    return(true);
                }
                ICommunicationLink communicationLinkItem = item.As <ICommunicationLink>();

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