예제 #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)
            {
                IErpBomItemData erpBomItemDataItem = item.As <IErpBomItemData>();

                if (((erpBomItemDataItem != null) &&
                     this._parent.ErpBomItemDatas.Remove(erpBomItemDataItem)))
                {
                    return(true);
                }
                if ((this._parent.Design == item))
                {
                    this._parent.Design = null;
                    return(true);
                }
                return(false);
            }
예제 #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)
            {
                IErpBomItemData erpBomItemDatasCasted = item.As <IErpBomItemData>();

                if ((erpBomItemDatasCasted != null))
                {
                    this._parent.ErpBomItemDatas.Add(erpBomItemDatasCasted);
                }
                if ((this._parent.Design == null))
                {
                    IDesign designCasted = item.As <IDesign>();
                    if ((designCasted != null))
                    {
                        this._parent.Design = designCasted;
                        return;
                    }
                }
            }