Exemple #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)
            {
                ICUGroup cUGroupItem = item.As <ICUGroup>();

                if (((cUGroupItem != null) &&
                     this._parent.ChildCUGroups.Remove(cUGroupItem)))
                {
                    return(true);
                }
                if (((cUGroupItem != null) &&
                     this._parent.ParentCUGroups.Remove(cUGroupItem)))
                {
                    return(true);
                }
                IDesignLocationCU designLocationCUItem = item.As <IDesignLocationCU>();

                if (((designLocationCUItem != null) &&
                     this._parent.DesignLocationCUs.Remove(designLocationCUItem)))
                {
                    return(true);
                }
                ICompatibleUnit compatibleUnitItem = item.As <ICompatibleUnit>();

                if (((compatibleUnitItem != null) &&
                     this._parent.CompatibleUnits.Remove(compatibleUnitItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                return(false);
            }
Exemple #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)
            {
                IDesignLocation designLocationItem = item.As <IDesignLocation>();

                if (((designLocationItem != null) &&
                     this._parent.DesignLocations.Remove(designLocationItem)))
                {
                    return(true);
                }
                IDesignLocationCU designLocationCUItem = item.As <IDesignLocationCU>();

                if (((designLocationCUItem != null) &&
                     this._parent.DesignLocationCUs.Remove(designLocationCUItem)))
                {
                    return(true);
                }
                IDesign designItem = item.As <IDesign>();

                if (((designItem != null) &&
                     this._parent.Designs.Remove(designItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                return(false);
            }
Exemple #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)
            {
                IDesignLocation designLocationsCasted = item.As <IDesignLocation>();

                if ((designLocationsCasted != null))
                {
                    this._parent.DesignLocations.Add(designLocationsCasted);
                }
                IDesignLocationCU designLocationCUsCasted = item.As <IDesignLocationCU>();

                if ((designLocationCUsCasted != null))
                {
                    this._parent.DesignLocationCUs.Add(designLocationCUsCasted);
                }
                IDesign designsCasted = item.As <IDesign>();

                if ((designsCasted != null))
                {
                    this._parent.Designs.Add(designsCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
            }
Exemple #4
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ICUGroup childCUGroupsCasted = item.As <ICUGroup>();

                if ((childCUGroupsCasted != null))
                {
                    this._parent.ChildCUGroups.Add(childCUGroupsCasted);
                }
                ICUGroup parentCUGroupsCasted = item.As <ICUGroup>();

                if ((parentCUGroupsCasted != null))
                {
                    this._parent.ParentCUGroups.Add(parentCUGroupsCasted);
                }
                IDesignLocationCU designLocationCUsCasted = item.As <IDesignLocationCU>();

                if ((designLocationCUsCasted != null))
                {
                    this._parent.DesignLocationCUs.Add(designLocationCUsCasted);
                }
                ICompatibleUnit compatibleUnitsCasted = item.As <ICompatibleUnit>();

                if ((compatibleUnitsCasted != null))
                {
                    this._parent.CompatibleUnits.Add(compatibleUnitsCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
            }