private void AddReagent(IReagent reagent) { var reagentTrough = new Trough { Name = reagent.Name }; _result.Labware.Add(reagentTrough); _locationRepository.SetOrigin(reagent, reagentTrough); }
/// <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.Reagent == null)) { IReagent reagentCasted = item.As <IReagent>(); if ((reagentCasted != null)) { this._parent.Reagent = reagentCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IProtocolStep stepsCasted = item.As <IProtocolStep>(); if ((stepsCasted != null)) { this._parent.Steps.Add(stepsCasted); } IReagent reagentsCasted = item.As <IReagent>(); if ((reagentsCasted != null)) { this._parent.Reagents.Add(reagentsCasted); } }
/// <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) { IProtocolStep protocolStepItem = item.As <IProtocolStep>(); if (((protocolStepItem != null) && this._parent.Steps.Remove(protocolStepItem))) { return(true); } IReagent reagentItem = item.As <IReagent>(); if (((reagentItem != null) && this._parent.Reagents.Remove(reagentItem))) { return(true); } return(false); }