Exemple #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.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
                if ((this._parent.TypeAsset == null))
                {
                    ITypeAsset typeAssetCasted = item.As <ITypeAsset>();
                    if ((typeAssetCasted != null))
                    {
                        this._parent.TypeAsset = typeAssetCasted;
                        return;
                    }
                }
                ICompatibleUnit compatibleUnitsCasted = item.As <ICompatibleUnit>();

                if ((compatibleUnitsCasted != null))
                {
                    this._parent.CompatibleUnits.Add(compatibleUnitsCasted);
                }
            }
Exemple #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)
 {
     if ((this._parent.DesignLocation == null))
     {
         IDesignLocation designLocationCasted = item.As <IDesignLocation>();
         if ((designLocationCasted != null))
         {
             this._parent.DesignLocation = designLocationCasted;
             return;
         }
     }
     if ((this._parent.ErpBOM == null))
     {
         IErpBOM erpBOMCasted = item.As <IErpBOM>();
         if ((erpBOMCasted != null))
         {
             this._parent.ErpBOM = erpBOMCasted;
             return;
         }
     }
     if ((this._parent.TypeAsset == null))
     {
         ITypeAsset typeAssetCasted = item.As <ITypeAsset>();
         if ((typeAssetCasted != null))
         {
             this._parent.TypeAsset = typeAssetCasted;
             return;
         }
     }
 }
Exemple #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.Status == null))
     {
         IStatus statusCasted = item.As <IStatus>();
         if ((statusCasted != null))
         {
             this._parent.Status = statusCasted;
             return;
         }
     }
     if ((this._parent.TypeMaterial == null))
     {
         ITypeMaterial typeMaterialCasted = item.As <ITypeMaterial>();
         if ((typeMaterialCasted != null))
         {
             this._parent.TypeMaterial = typeMaterialCasted;
             return;
         }
     }
     if ((this._parent.TypeAsset == null))
     {
         ITypeAsset typeAssetCasted = item.As <ITypeAsset>();
         if ((typeAssetCasted != null))
         {
             this._parent.TypeAsset = typeAssetCasted;
             return;
         }
     }
 }
Exemple #4
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)
            {
                ITypeAsset typeAssetItem = item.As <ITypeAsset>();

                if (((typeAssetItem != null) &&
                     this._parent.TypeAssets.Remove(typeAssetItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                return(false);
            }
Exemple #5
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                ITypeAsset typeAssetsCasted = item.As <ITypeAsset>();

                if ((typeAssetsCasted != null))
                {
                    this._parent.TypeAssets.Add(typeAssetsCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
            }
Exemple #6
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.Asset == null))
     {
         IAsset assetCasted = item.As <IAsset>();
         if ((assetCasted != null))
         {
             this._parent.Asset = assetCasted;
             return;
         }
     }
     if ((this._parent.TypeAsset == null))
     {
         ITypeAsset typeAssetCasted = item.As <ITypeAsset>();
         if ((typeAssetCasted != null))
         {
             this._parent.TypeAsset = typeAssetCasted;
             return;
         }
     }
     if ((this._parent.AssetModel == null))
     {
         IAssetModel assetModelCasted = item.As <IAssetModel>();
         if ((assetModelCasted != null))
         {
             this._parent.AssetModel = assetModelCasted;
             return;
         }
     }
     if ((this._parent.DimensionsInfo == null))
     {
         IDimensionsInfo dimensionsInfoCasted = item.As <IDimensionsInfo>();
         if ((dimensionsInfoCasted != null))
         {
             this._parent.DimensionsInfo = dimensionsInfoCasted;
             return;
         }
     }
 }