Exemplo n.º 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)
            {
                ICompatibleUnit compatibleUnitsCasted = item.As <ICompatibleUnit>();

                if ((compatibleUnitsCasted != null))
                {
                    this._parent.CompatibleUnits.Add(compatibleUnitsCasted);
                }
                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;
                    }
                }
                IPropertyUnit propertyUnitsCasted = item.As <IPropertyUnit>();

                if ((propertyUnitsCasted != null))
                {
                    this._parent.PropertyUnits.Add(propertyUnitsCasted);
                }
            }
Exemplo n.º 2
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)
            {
                ICompatibleUnit compatibleUnitItem = item.As <ICompatibleUnit>();

                if (((compatibleUnitItem != null) &&
                     this._parent.CompatibleUnits.Remove(compatibleUnitItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                if ((this._parent.TypeMaterial == item))
                {
                    this._parent.TypeMaterial = null;
                    return(true);
                }
                IPropertyUnit propertyUnitItem = item.As <IPropertyUnit>();

                if (((propertyUnitItem != null) &&
                     this._parent.PropertyUnits.Remove(propertyUnitItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public ActivityCodeProxy(IPropertyUnit modelElement) :
     base(modelElement, "activityCode")
 {
 }