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

                if ((productsegmentsCasted != null))
                {
                    this._parent.Productsegments.Add(productsegmentsCasted);
                }
                IWorkpieceType workpiecetypesCasted = item.As <IWorkpieceType>();

                if ((workpiecetypesCasted != null))
                {
                    this._parent.Workpiecetypes.Add(workpiecetypesCasted);
                }
            }
Beispiel #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)
            {
                IProductSegment productSegmentItem = item.As <IProductSegment>();

                if (((productSegmentItem != null) &&
                     this._parent.Productsegments.Remove(productSegmentItem)))
                {
                    return(true);
                }
                IWorkpieceType workpieceTypeItem = item.As <IWorkpieceType>();

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