Пример #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)
            {
                IOutageReport outageReportsCasted = item.As <IOutageReport>();

                if ((outageReportsCasted != null))
                {
                    this._parent.OutageReports.Add(outageReportsCasted);
                }
            }
Пример #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)
            {
                IOutageReport outageReportItem = item.As <IOutageReport>();

                if (((outageReportItem != null) &&
                     this._parent.OutageReports.Remove(outageReportItem)))
                {
                    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.OutageReport == null))
                {
                    IOutageReport outageReportCasted = item.As <IOutageReport>();
                    if ((outageReportCasted != null))
                    {
                        this._parent.OutageReport = outageReportCasted;
                        return;
                    }
                }
                IOutageStep outageStepsCasted = item.As <IOutageStep>();

                if ((outageStepsCasted != null))
                {
                    this._parent.OutageSteps.Add(outageStepsCasted);
                }
                IOutageCode outageCodesCasted = item.As <IOutageCode>();

                if ((outageCodesCasted != null))
                {
                    this._parent.OutageCodes.Add(outageCodesCasted);
                }
            }