Example #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)
 {
     if ((this._parent.RTO == null))
     {
         IRTO rTOCasted = item.As <IRTO>();
         if ((rTOCasted != null))
         {
             this._parent.RTO = rTOCasted;
             return;
         }
     }
 }
Example #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)
            {
                if ((this._parent.ResourceGroup == item))
                {
                    this._parent.ResourceGroup = null;
                    return(true);
                }
                IRTO rTOItem = item.As <IRTO>();

                if (((rTOItem != null) &&
                     this._parent.RTOs.Remove(rTOItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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.ResourceGroup == null))
                {
                    IResourceGroup resourceGroupCasted = item.As <IResourceGroup>();
                    if ((resourceGroupCasted != null))
                    {
                        this._parent.ResourceGroup = resourceGroupCasted;
                        return;
                    }
                }
                IRTO rTOsCasted = item.As <IRTO>();

                if ((rTOsCasted != null))
                {
                    this._parent.RTOs.Add(rTOsCasted);
                }
            }
Example #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)
            {
                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;
                    }
                }
            }