/// <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.Target == null))
                {
                    ILabware targetCasted = item.As <ILabware>();
                    if ((targetCasted != null))
                    {
                        this._parent.Target = targetCasted;
                        return;
                    }
                }
                ITipLiquidTransfer tipsCasted = item.As <ITipLiquidTransfer>();

                if ((tipsCasted != null))
                {
                    if ((this._parent.Tips.Count < 8))
                    {
                        this._parent.Tips.Add(tipsCasted);
                    }
                }
                if ((this._parent.Source == null))
                {
                    ILabware sourceCasted = item.As <ILabware>();
                    if ((sourceCasted != null))
                    {
                        this._parent.Source = sourceCasted;
                        return;
                    }
                }
            }
Пример #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)
            {
                ILabware labwareCasted = item.As <ILabware>();

                if ((labwareCasted != null))
                {
                    this._parent.Labware.Add(labwareCasted);
                }
                IJob jobsCasted = item.As <IJob>();

                if ((jobsCasted != null))
                {
                    this._parent.Jobs.Add(jobsCasted);
                }
            }
Пример #3
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)
            {
                ILabware labwareItem = item.As <ILabware>();

                if (((labwareItem != null) &&
                     this._parent.Labware.Remove(labwareItem)))
                {
                    return(true);
                }
                IJob jobItem = item.As <IJob>();

                if (((jobItem != null) &&
                     this._parent.Jobs.Remove(jobItem)))
                {
                    return(true);
                }
                return(false);
            }