Beispiel #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)
            {
                ICableInfo cableInfoItem = item.As <ICableInfo>();

                if (((cableInfoItem != null) &&
                     this._parent.CableInfos.Remove(cableInfoItem)))
                {
                    return(true);
                }
                if ((this._parent.DuctBankInfo == item))
                {
                    this._parent.DuctBankInfo = null;
                    return(true);
                }
                return(false);
            }
Beispiel #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)
            {
                ICableInfo cableInfosCasted = item.As <ICableInfo>();

                if ((cableInfosCasted != null))
                {
                    this._parent.CableInfos.Add(cableInfosCasted);
                }
                if ((this._parent.DuctBankInfo == null))
                {
                    IDuctBankInfo ductBankInfoCasted = item.As <IDuctBankInfo>();
                    if ((ductBankInfoCasted != null))
                    {
                        this._parent.DuctBankInfo = ductBankInfoCasted;
                        return;
                    }
                }
            }