示例#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)
            {
                ICircuitSection circuitSectionItem = item.As <ICircuitSection>();

                if (((circuitSectionItem != null) &&
                     this._parent.CircuitSections.Remove(circuitSectionItem)))
                {
                    return(true);
                }
                IChangeItem changeItemItem = item.As <IChangeItem>();

                if (((changeItemItem != null) &&
                     this._parent.ChangeItems.Remove(changeItemItem)))
                {
                    return(true);
                }
                IChangeSet changeSetItem = item.As <IChangeSet>();

                if (((changeSetItem != null) &&
                     this._parent.ChangeSets.Remove(changeSetItem)))
                {
                    return(true);
                }
                IPowerSystemResource powerSystemResourceItem = item.As <IPowerSystemResource>();

                if (((powerSystemResourceItem != null) &&
                     this._parent.PowerSystemResources.Remove(powerSystemResourceItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                ILandBase landBaseItem = item.As <ILandBase>();

                if (((landBaseItem != null) &&
                     this._parent.LandBases.Remove(landBaseItem)))
                {
                    return(true);
                }
                IDocument documentItem = item.As <IDocument>();

                if (((documentItem != null) &&
                     this._parent.Documents.Remove(documentItem)))
                {
                    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)
            {
                ICircuitSection circuitSectionsCasted = item.As <ICircuitSection>();

                if ((circuitSectionsCasted != null))
                {
                    this._parent.CircuitSections.Add(circuitSectionsCasted);
                }
                IChangeItem changeItemsCasted = item.As <IChangeItem>();

                if ((changeItemsCasted != null))
                {
                    this._parent.ChangeItems.Add(changeItemsCasted);
                }
                IChangeSet changeSetsCasted = item.As <IChangeSet>();

                if ((changeSetsCasted != null))
                {
                    this._parent.ChangeSets.Add(changeSetsCasted);
                }
                IPowerSystemResource powerSystemResourcesCasted = item.As <IPowerSystemResource>();

                if ((powerSystemResourcesCasted != null))
                {
                    this._parent.PowerSystemResources.Add(powerSystemResourcesCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
                ILandBase landBasesCasted = item.As <ILandBase>();

                if ((landBasesCasted != null))
                {
                    this._parent.LandBases.Add(landBasesCasted);
                }
                IDocument documentsCasted = item.As <IDocument>();

                if ((documentsCasted != null))
                {
                    this._parent.Documents.Add(documentsCasted);
                }
            }
示例#3
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)
            {
                IChangeItem changeItemItem = item.As <IChangeItem>();

                if (((changeItemItem != null) &&
                     this._parent.ChangeItems.Remove(changeItemItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                ILandBase landBaseItem = item.As <ILandBase>();

                if (((landBaseItem != null) &&
                     this._parent.LandBases.Remove(landBaseItem)))
                {
                    return(true);
                }
                INetworkDataSet networkDataSetItem = item.As <INetworkDataSet>();

                if (((networkDataSetItem != null) &&
                     this._parent.NetworkDataSets.Remove(networkDataSetItem)))
                {
                    return(true);
                }
                IDocument documentItem = item.As <IDocument>();

                if (((documentItem != null) &&
                     this._parent.Documents.Remove(documentItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#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)
            {
                IChangeItem changeItemsCasted = item.As <IChangeItem>();

                if ((changeItemsCasted != null))
                {
                    this._parent.ChangeItems.Add(changeItemsCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
                ILandBase landBasesCasted = item.As <ILandBase>();

                if ((landBasesCasted != null))
                {
                    this._parent.LandBases.Add(landBasesCasted);
                }
                INetworkDataSet networkDataSetsCasted = item.As <INetworkDataSet>();

                if ((networkDataSetsCasted != null))
                {
                    this._parent.NetworkDataSets.Add(networkDataSetsCasted);
                }
                IDocument documentsCasted = item.As <IDocument>();

                if ((documentsCasted != null))
                {
                    this._parent.Documents.Add(documentsCasted);
                }
            }