IfcDoc.Program.ExportCnfAttribute C# (CSharp) Method

ExportCnfAttribute() static private method

static private ExportCnfAttribute ( IfcDoc ent, DocAttribute docAttr, DocXsdFormatEnum xsdformat, bool tagless ) : void
ent IfcDoc
docAttr DocAttribute
xsdformat DocXsdFormatEnum
tagless bool
return void
        internal static void ExportCnfAttribute(IfcDoc.Schema.CNF.entity ent, DocAttribute docAttr, DocXsdFormatEnum xsdformat, bool? tagless)
        {
            Schema.CNF.exp_attribute exp = Schema.CNF.exp_attribute.unspecified;
            bool keep = true;
            switch (xsdformat)
            {
                case DocXsdFormatEnum.Content:
                    exp = Schema.CNF.exp_attribute.attribute_content;
                    break;

                case DocXsdFormatEnum.Attribute:
                    exp = Schema.CNF.exp_attribute.attribute_tag;
                    break;

                case DocXsdFormatEnum.Element:
                    exp = Schema.CNF.exp_attribute.double_tag;
                    break;

                case DocXsdFormatEnum.Hidden:
                    keep = false;
                    break;

                default:
                    break;
            }

            if (!String.IsNullOrEmpty(docAttr.Inverse))
            {
                IfcDoc.Schema.CNF.inverse inv = new Schema.CNF.inverse();
                inv.select = docAttr.Name;
                inv.exp_attribute = exp;
                ent.inverse.Add(inv);
            }
            else
            {
                IfcDoc.Schema.CNF.attribute att = new Schema.CNF.attribute();
                att.select = docAttr.Name;
                att.exp_attribute = exp;
                att.keep = keep;

                if (tagless != null)
                {
                    if (tagless == true)
                    {
                        att.tagless = Schema.CNF.boolean_or_unspecified.boolean_true;
                    }
                    else
                    {
                        att.tagless = Schema.CNF.boolean_or_unspecified.boolean_false;
                    }
                }
                ent.attribute.Add(att);
            }
        }