Exemplo n.º 1
0
        public IEnumerable <Page> Convert(Xsd xsd)
        {
            this.Xsd = xsd;

            var pages = new List <Page>()
            {
                this.GenerateSchemaRootPage()
            };

            pages.AddRange(xsd.SimpleTypes.Values.OrderBy(t => t.Name).Select(t => this.SimpleTypeDocumentation(t)));
            pages.AddRange(xsd.Elements.Values.OrderBy(el => el.Name).Select(el => this.ElementDocumentation(el)));

            return(pages);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Order so that all wxs schemas are first, wxl second then evertyhing else alphabetical.
        /// </summary>
        private static int OrderXsds(Xsd x, Xsd y)
        {
            var wxsSchemaX = x.TargetNamespace.Contains("/wxs");
            var wxsSchemaY = y.TargetNamespace.Contains("/wxs");

            if (wxsSchemaX)
            {
                if (wxsSchemaY)
                {
                    return(x.TargetNamespace.CompareTo(y.TargetNamespace));
                }
                else
                {
                    return(-1);
                }
            }
            else if (wxsSchemaY)
            {
                return(1);
            }

            var wxlSchemaX = x.TargetNamespace.Contains("/wxl");
            var wxlSchemaY = y.TargetNamespace.Contains("/wxl");

            if (wxlSchemaX)
            {
                if (wxlSchemaY)
                {
                    return(x.TargetNamespace.CompareTo(y.TargetNamespace));
                }
                else
                {
                    return(-1);
                }
            }
            else if (wxlSchemaY)
            {
                return(1);
            }

            return(x.TargetNamespace.CompareTo(y.TargetNamespace));
        }