示例#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);
                }
            }
示例#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)
            {
                IWorkpieceType workpieceTypeItem = item.As <IWorkpieceType>();

                if (((workpieceTypeItem != null) &&
                     this._parent.WorkpieceIn.Remove(workpieceTypeItem)))
                {
                    return(true);
                }
                if ((this._parent.WorkpieceOut == item))
                {
                    this._parent.WorkpieceOut = null;
                    return(true);
                }
                return(false);
            }
示例#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)
            {
                IWorkpieceType workpieceInCasted = item.As <IWorkpieceType>();

                if ((workpieceInCasted != null))
                {
                    this._parent.WorkpieceIn.Add(workpieceInCasted);
                }
                if ((this._parent.WorkpieceOut == null))
                {
                    IWorkpieceType workpieceOutCasted = item.As <IWorkpieceType>();
                    if ((workpieceOutCasted != null))
                    {
                        this._parent.WorkpieceOut = workpieceOutCasted;
                        return;
                    }
                }
            }
示例#4
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);
            }