public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _approvedProperties.InternalAdd((IfcProperty)value.EntityVal);
                return;

            case 1:
                _approval = (IfcApproval)(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:
                ((IXbimNoNotifyCollection)_approvedResources).Add((IfcResource)value.EntityVal);
                break;

            case 1:
                _approval = (IfcApproval)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:
             _relatingApproval = (IfcApproval)value.EntityVal; 
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Example #4
0
        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
            IfcApproval root = (IfcApproval)obj;

            return(this == root);
        }
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _actor = (IfcActorSelect)value.EntityVal;
                break;

            case 1:
                _approval = (IfcApproval)value.EntityVal;
                break;

            case 2:
                _role = (IfcActorRole)value.EntityVal;
                break;

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

            case 1:
                _relatingApproval = (IfcApproval)(value.EntityVal);
                return;

            case 2:
                _description = value.StringVal;
                return;

            case 3:
                _name = value.StringVal;
                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:
                _relatedApproval = (IfcApproval)value.EntityVal;
                break;

            case 3:
                _relatingApproval = (IfcApproval)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
 public virtual void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _approvedProperties.Add((IfcProperty)value.EntityVal);
             break;
         case 1:
             _approval = (IfcApproval) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 public virtual void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _name = value.StringVal;
             break;
         case 1:
             _description = value.StringVal;
             break;
         case 2:
             _relatedApproval = (IfcApproval) value.EntityVal;
             break;
         case 3:
             _relatingApproval = (IfcApproval) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
                case 0:
                    _actor = (IfcActorSelect) value.EntityVal;
                    break;
                case 1:
                    _approval = (IfcApproval) value.EntityVal;
                    break;
                case 2:
                    _role = (IfcActorRole) value.EntityVal;
                    break;

                default:
                    this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Example #11
0
        /// <summary>
        /// Set the IfcRelAssociatesApproval object
        /// </summary>
        /// <param name="sheetName">Sheet name</param>
        /// <param name="rowName">Row name</param>
        /// <param name="ifcApproval">IfcApproval object</param>
        /// <param name="ifcRelAssociatesApproval">IfcRelAssociatesApproval object</param>
        private void SetRelObjectToApproval(string sheetName, string rowName, IfcApproval ifcApproval, IfcRelAssociatesApproval ifcRelAssociatesApproval)
        {
            IfcRoot ifcRoot = GetRootObject(sheetName, rowName);
            //sheetName = sheetName.ToLower().Trim();
            if (ifcRoot != null) //we have a object
            {
                ifcRelAssociatesApproval.RelatedObjects.Add_Reversible(ifcRoot);
                return;
            }

            if (sheetName == Constants.WORKSHEET_CONTACT)
            {
                IfcActorSelect ifcActorSelect = GetActorSelect(rowName);
                if (ifcActorSelect != null)
                {
                    //see if the relation ship exists, if so no need to create
                    IfcActorSelect IfcActorSelectTest = Model.Instances.OfType<IfcApprovalActorRelationship>()
                                                        .Where(aar => aar.Approval == ifcApproval)
                                                        .Select(aar => aar.Actor).OfType<IfcActorSelect>()
                                                        .Where(po => po == ifcActorSelect)
                                                        .FirstOrDefault();
                    if (IfcActorSelectTest == null)
                    {
                        IfcApprovalActorRelationship ifcApprovalActorRelationship = Model.Instances.New<IfcApprovalActorRelationship>();
                        ifcApprovalActorRelationship.Actor = ifcActorSelect;
                        ifcApprovalActorRelationship.Approval = ifcApproval;
                    }
                }
            }
        }
 public virtual void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             ((IXbimNoNotifyCollection)_approvedResources).Add((IfcResource) value.EntityVal);
             break;
         case 1:
             _approval = (IfcApproval) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }