예제 #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)
            {
                IContingencyConstraintLimit contingencyConstraintLimitItem = item.As <IContingencyConstraintLimit>();

                if (((contingencyConstraintLimitItem != null) &&
                     this._parent.ContingencyConstraintLimits.Remove(contingencyConstraintLimitItem)))
                {
                    return(true);
                }
                if ((this._parent.DefaultConstraintLimit == item))
                {
                    this._parent.DefaultConstraintLimit = null;
                    return(true);
                }
                if ((this._parent.BaseCaseConstraintLimit == item))
                {
                    this._parent.BaseCaseConstraintLimit = null;
                    return(true);
                }
                IConstraintTerm constraintTermItem = item.As <IConstraintTerm>();

                if (((constraintTermItem != null) &&
                     this._parent.ConstraintTerms.Remove(constraintTermItem)))
                {
                    return(true);
                }
                if ((this._parent.RTO == item))
                {
                    this._parent.RTO = null;
                    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)
 {
     if ((this._parent.SecurityConstraintLimit == null))
     {
         IContingencyConstraintLimit securityConstraintLimitCasted = item.As <IContingencyConstraintLimit>();
         if ((securityConstraintLimitCasted != null))
         {
             this._parent.SecurityConstraintLimit = securityConstraintLimitCasted;
             return;
         }
     }
 }
예제 #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)
            {
                IContingencyConstraintLimit contingencyConstraintLimitCasted = item.As <IContingencyConstraintLimit>();

                if ((contingencyConstraintLimitCasted != null))
                {
                    this._parent.ContingencyConstraintLimit.Add(contingencyConstraintLimitCasted);
                }
                IContingencyElement contingencyElementCasted = item.As <IContingencyElement>();

                if ((contingencyElementCasted != null))
                {
                    this._parent.ContingencyElement.Add(contingencyElementCasted);
                }
            }
예제 #4
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)
            {
                IContingencyConstraintLimit contingencyConstraintLimitItem = item.As <IContingencyConstraintLimit>();

                if (((contingencyConstraintLimitItem != null) &&
                     this._parent.ContingencyConstraintLimit.Remove(contingencyConstraintLimitItem)))
                {
                    return(true);
                }
                IContingencyElement contingencyElementItem = item.As <IContingencyElement>();

                if (((contingencyElementItem != null) &&
                     this._parent.ContingencyElement.Remove(contingencyElementItem)))
                {
                    return(true);
                }
                return(false);
            }
예제 #5
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IContingencyConstraintLimit contingencyConstraintLimitsCasted = item.As <IContingencyConstraintLimit>();

                if ((contingencyConstraintLimitsCasted != null))
                {
                    this._parent.ContingencyConstraintLimits.Add(contingencyConstraintLimitsCasted);
                }
                if ((this._parent.DefaultConstraintLimit == null))
                {
                    IDefaultConstraintLimit defaultConstraintLimitCasted = item.As <IDefaultConstraintLimit>();
                    if ((defaultConstraintLimitCasted != null))
                    {
                        this._parent.DefaultConstraintLimit = defaultConstraintLimitCasted;
                        return;
                    }
                }
                if ((this._parent.BaseCaseConstraintLimit == null))
                {
                    IBaseCaseConstraintLimit baseCaseConstraintLimitCasted = item.As <IBaseCaseConstraintLimit>();
                    if ((baseCaseConstraintLimitCasted != null))
                    {
                        this._parent.BaseCaseConstraintLimit = baseCaseConstraintLimitCasted;
                        return;
                    }
                }
                IConstraintTerm constraintTermsCasted = item.As <IConstraintTerm>();

                if ((constraintTermsCasted != null))
                {
                    this._parent.ConstraintTerms.Add(constraintTermsCasted);
                }
                if ((this._parent.RTO == null))
                {
                    IRTO rTOCasted = item.As <IRTO>();
                    if ((rTOCasted != null))
                    {
                        this._parent.RTO = rTOCasted;
                        return;
                    }
                }
            }