/// <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.TargetResourceEnvironment_Allocation == null)) { IResourceEnvironment targetResourceEnvironment_AllocationCasted = item.As <IResourceEnvironment>(); if ((targetResourceEnvironment_AllocationCasted != null)) { this._parent.TargetResourceEnvironment_Allocation = targetResourceEnvironment_AllocationCasted; return; } } if ((this._parent.System_Allocation == null)) { ISystem0 system_AllocationCasted = item.As <ISystem0>(); if ((system_AllocationCasted != null)) { this._parent.System_Allocation = system_AllocationCasted; return; } } IAllocationContext allocationContexts_AllocationCasted = item.As <IAllocationContext>(); if ((allocationContexts_AllocationCasted != null)) { this._parent.AllocationContexts_Allocation.Add(allocationContexts_AllocationCasted); } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IAllocationContext allocationContextsCasted = item.As <IAllocationContext>(); if ((allocationContextsCasted != null)) { this._parent.AllocationContexts.Add(allocationContextsCasted); } if ((this._parent.AllocatedSystem == null)) { ISystem0 allocatedSystemCasted = item.As <ISystem0>(); if ((allocatedSystemCasted != null)) { this._parent.AllocatedSystem = allocatedSystemCasted; return; } } if ((this._parent.Environment == null)) { IEnvironment environmentCasted = item.As <IEnvironment>(); if ((environmentCasted != null)) { this._parent.Environment = environmentCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IAllocationContext contextsCasted = item.As <IAllocationContext>(); if ((contextsCasted != null)) { this._parent.Contexts.Add(contextsCasted); } }
/// <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) { IAllocationContext allocationContextItem = item.As <IAllocationContext>(); if (((allocationContextItem != null) && this._parent.Contexts.Remove(allocationContextItem))) { return(true); } return(false); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IAllocationContext contextsCasted = item.As <IAllocationContext>(); if ((contextsCasted != null)) { this._parent.Contexts.Add(contextsCasted); } if ((this._parent.AllocatedSystem == null)) { ISystem_MM06 allocatedSystemCasted = item.As <ISystem_MM06>(); if ((allocatedSystemCasted != null)) { this._parent.AllocatedSystem = allocatedSystemCasted; return; } } }
/// <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.TargetResourceEnvironment_Allocation == item)) { this._parent.TargetResourceEnvironment_Allocation = null; return(true); } if ((this._parent.System_Allocation == item)) { this._parent.System_Allocation = null; return(true); } IAllocationContext allocationContextItem = item.As <IAllocationContext>(); if (((allocationContextItem != null) && this._parent.AllocationContexts_Allocation.Remove(allocationContextItem))) { return(true); } return(false); }
/// <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) { IAllocationContext allocationContextItem = item.As <IAllocationContext>(); if (((allocationContextItem != null) && this._parent.AllocationContexts.Remove(allocationContextItem))) { return(true); } if ((this._parent.AllocatedSystem == item)) { this._parent.AllocatedSystem = null; return(true); } if ((this._parent.Environment == item)) { this._parent.Environment = null; return(true); } return(false); }