IfcDoc.Program.ImportXsdSimple C# (CSharp) Method

ImportXsdSimple() static private method

static private ImportXsdSimple ( IfcDoc simple, DocSchema docSchema, string name ) : void
simple IfcDoc
docSchema DocSchema
name string
return void
        internal static void ImportXsdSimple(IfcDoc.Schema.XSD.simpleType simple, DocSchema docSchema, string name)
        {
            string thename = simple.name;
            if (simple.name == null)
            {
                thename = name;
            }

            if (simple.restriction != null && simple.restriction.enumeration.Count > 0)
            {
                DocEnumeration docEnum = new DocEnumeration();
                docSchema.Types.Add(docEnum);
                docEnum.Name = thename;
                docEnum.Documentation = ImportXsdAnnotation(simple.annotation);
                foreach (IfcDoc.Schema.XSD.enumeration en in simple.restriction.enumeration)
                {
                    DocConstant docConst = new DocConstant();
                    docConst.Name = en.value;
                    docConst.Documentation = ImportXsdAnnotation(en.annotation);

                    docEnum.Constants.Add(docConst);
                }
            }
            else
            {
                DocDefined docDef = new DocDefined();
                docDef.Name = thename;
                docDef.Documentation = ImportXsdAnnotation(simple.annotation);
                if (simple.restriction != null)
                {
                    docDef.DefinedType = ImportXsdType(simple.restriction.basetype);
                }
                docSchema.Types.Add(docDef);
            }
        }