Example #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)
            {
                IInterface parentInterfaces__InterfaceCasted = item.As <IInterface>();

                if ((parentInterfaces__InterfaceCasted != null))
                {
                    this._parent.ParentInterfaces__Interface.Add(parentInterfaces__InterfaceCasted);
                }
                IProtocol protocols__InterfaceCasted = item.As <IProtocol>();

                if ((protocols__InterfaceCasted != null))
                {
                    this._parent.Protocols__Interface.Add(protocols__InterfaceCasted);
                }
                IRequiredCharacterisation requiredCharacterisationsCasted = item.As <IRequiredCharacterisation>();

                if ((requiredCharacterisationsCasted != null))
                {
                    this._parent.RequiredCharacterisations.Add(requiredCharacterisationsCasted);
                }
                if ((this._parent.Repository__Interface == null))
                {
                    IRepository repository__InterfaceCasted = item.As <IRepository>();
                    if ((repository__InterfaceCasted != null))
                    {
                        this._parent.Repository__Interface = repository__InterfaceCasted;
                        return;
                    }
                }
            }
Example #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)
            {
                IInterface interfaceItem = item.As <IInterface>();

                if (((interfaceItem != null) &&
                     this._parent.ParentInterfaces__Interface.Remove(interfaceItem)))
                {
                    return(true);
                }
                IProtocol protocolItem = item.As <IProtocol>();

                if (((protocolItem != null) &&
                     this._parent.Protocols__Interface.Remove(protocolItem)))
                {
                    return(true);
                }
                IRequiredCharacterisation requiredCharacterisationItem = item.As <IRequiredCharacterisation>();

                if (((requiredCharacterisationItem != null) &&
                     this._parent.RequiredCharacterisations.Remove(requiredCharacterisationItem)))
                {
                    return(true);
                }
                if ((this._parent.Repository__Interface == item))
                {
                    this._parent.Repository__Interface = null;
                    return(true);
                }
                return(false);
            }
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)
            {
                IProtocol protocols__InterfaceCasted = item.As <IProtocol>();

                if ((protocols__InterfaceCasted != null))
                {
                    this._parent.Protocols__Interface.Add(protocols__InterfaceCasted);
                }
                IRequiredCharacterisation requiredCharacterisationsCasted = item.As <IRequiredCharacterisation>();

                if ((requiredCharacterisationsCasted != null))
                {
                    this._parent.RequiredCharacterisations.Add(requiredCharacterisationsCasted);
                }
            }