Beispiel #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);
            }
Beispiel #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);
                }
            }
Beispiel #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)
 {
     if ((this._parent.CircuitSection == null))
     {
         ICircuitSection circuitSectionCasted = item.As <ICircuitSection>();
         if ((circuitSectionCasted != null))
         {
             this._parent.CircuitSection = circuitSectionCasted;
             return;
         }
     }
     if ((this._parent.ConductorSegment == null))
     {
         IDistributionLineSegment conductorSegmentCasted = item.As <IDistributionLineSegment>();
         if ((conductorSegmentCasted != null))
         {
             this._parent.ConductorSegment = conductorSegmentCasted;
             return;
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public ConnectionKindProxy(ICircuitSection modelElement) :
     base(modelElement, "connectionKind")
 {
 }