Example #1
0
        public NativeSchemaInfo(XmlSchemaTypeLoader typeLoader)
        {
            m_nativeClasses = new List <NativeClassInfo>();

            // parse schema & add our Annotations
            foreach (DomNodeType domType in typeLoader.GetNodeTypes())
            {
                IEnumerable <XmlNode> annotations = domType.GetTagLocal <IEnumerable <XmlNode> >();
                if (annotations == null)
                {
                    continue;
                }

                NativeClassInfo classInfo = null;
                foreach (XmlNode annot in annotations)
                {
                    XmlElement elm = annot as XmlElement;
                    if (elm.LocalName == SchemaStrings.LegeNativeType)
                    {
                        classInfo = new NativeClassInfo(elm, domType.IsAbstract);
                        m_nativeClasses.Add(classInfo);
                        break;
                    }
                }

                if (classInfo == null)
                {
                    continue;
                }

                foreach (XmlNode annot in annotations)
                {
                    XmlElement elm = annot as XmlElement;
                    if (elm.LocalName == SchemaStrings.LeGeNativeProperty)
                    {
                        NativePropertyInfo info = new NativePropertyInfo(elm);
                        classInfo.Properties.Add(info);
                    }
                    else if (elm.LocalName == SchemaStrings.LeGeNativeElement)
                    {
                        NativeListInfo info = new NativeListInfo(elm);
                        classInfo.Lists.Add(info);
                    }
                }
            }
        }