public override bool Equals(object obj)
        {
            // Check for null
            if (obj == null)
            {
                return(false);
            }

            // Check for type
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }

            // Cast as IfcRoot
            IfcMeasureWithUnit root = (IfcMeasureWithUnit)obj;

            return(this == root);
        }
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.IfcParse(propIndex, value);
                break;

            case 2:
                _name = value.StringVal;
                break;

            case 3:
                _conversionFactor = (IfcMeasureWithUnit)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 2:
                _name = value.StringVal;
                return;

            case 3:
                _conversionFactor = (IfcMeasureWithUnit)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
                case 0:
                    _name = value.StringVal;
                    break;
                case 1:
                    _description = value.StringVal;
                    break;
                case 2:
                    _appliedValue = (IfcAppliedValueSelect) value.EntityVal;
                    break;
                case 3:
                    _unitBasis = (IfcMeasureWithUnit) value.EntityVal;
                    break;
                case 4:
                    _applicableDate = (IfcDateTimeSelect) value.EntityVal;
                    break;
                case 5:
                    _fixedUntilDate = (IfcDateTimeSelect) value.EntityVal;
                    break;

                default:
                    this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
             base.IfcParse(propIndex, value);
             break;
         case 2:
             _name = value.StringVal;
             break;
         case 3:
             _conversionFactor = (IfcMeasureWithUnit) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
             base.IfcParse(propIndex, value);
             break;
         case 5:
             _resourceIdentifier = value.StringVal;
             break;
         case 6:
             _resourceGroup = value.StringVal;
             break;
         case 7:
             _resourceConsumption =
                 (IfcResourceConsumptionEnum) Enum.Parse(typeof (IfcResourceConsumptionEnum), value.EnumVal);
             break;
         case 8:
             _baseQuantity = (IfcMeasureWithUnit) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 private static string GetMeasureWithUnitAsString(IfcMeasureWithUnit ifcMeasureWithUnit)
 {
     string value = string.Format("{0,0:N2}", ifcMeasureWithUnit.ValueComponent.Value);
     IfcUnit ifcUnit = ifcMeasureWithUnit.UnitComponent;
     string unit = ifcUnit.GetSymbol();
     if (!string.IsNullOrEmpty(unit))
     {
         value += unit;
     }
     
     return value;
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
         case 2:
         case 3:
         case 4:
         case 5:
             base.IfcParse(propIndex, value);
             break;
         case 6:
             _relatingProcess = (IfcProcess) value.EntityVal;
             break;
         case 7:
             _quantityInProcess = (IfcMeasureWithUnit) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }