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

                if ((outageRecordsCasted != null))
                {
                    this._parent.OutageRecords.Add(outageRecordsCasted);
                }
                IOutageStep outageStepsCasted = item.As <IOutageStep>();

                if ((outageStepsCasted != null))
                {
                    this._parent.OutageSteps.Add(outageStepsCasted);
                }
            }
示例#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)
            {
                IOutageRecord outageRecordItem = item.As <IOutageRecord>();

                if (((outageRecordItem != null) &&
                     this._parent.OutageRecords.Remove(outageRecordItem)))
                {
                    return(true);
                }
                IOutageStep outageStepItem = item.As <IOutageStep>();

                if (((outageStepItem != null) &&
                     this._parent.OutageSteps.Remove(outageStepItem)))
                {
                    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)
 {
     if ((this._parent.OutageRecord == null))
     {
         IOutageRecord outageRecordCasted = item.As <IOutageRecord>();
         if ((outageRecordCasted != null))
         {
             this._parent.OutageRecord = outageRecordCasted;
             return;
         }
     }
     if ((this._parent.OutageHistory == null))
     {
         IOutageHistory outageHistoryCasted = item.As <IOutageHistory>();
         if ((outageHistoryCasted != null))
         {
             this._parent.OutageHistory = outageHistoryCasted;
             return;
         }
     }
 }