/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer containersCasted = item.As <FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer>(); if ((containersCasted != null)) { this._parent.Containers.Add(containersCasted); } ILink linksCasted = item.As <ILink>(); if ((linksCasted != null)) { this._parent.Links.Add(linksCasted); } }
/// <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) { FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer containerItem = item.As <FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer>(); if (((containerItem != null) && this._parent.Containers.Remove(containerItem))) { return(true); } ILink linkItem = item.As <ILink>(); if (((linkItem != null) && this._parent.Links.Remove(linkItem))) { 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) { if ((this._parent.Assembly == null)) { IAssemblyContext assemblyCasted = item.As <IAssemblyContext>(); if ((assemblyCasted != null)) { this._parent.Assembly = assemblyCasted; return; } } if ((this._parent.Container == null)) { FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer containerCasted = item.As <FZI.SoftwareEngineering.DeepModeling.TwoLevelADL.Deployment.IContainer>(); if ((containerCasted != null)) { this._parent.Container = containerCasted; return; } } }