Esempio n. 1
0
        /// <summary>
        /// Add namespace reference attributes.
        /// </summary>
        internal static void AddNamespaceRef(XElement element, NamespaceDocumentation ns)
        {
            var xid = ns.Xid;

            element.Add(new XAttribute("namespace-name", ns.Name),
                        new XAttribute("namespace-xid", xid));
        }
Esempio n. 2
0
        /// <summary>
        /// Add namespace reference attributes.
        /// </summary>
        internal static XElement CreateNamespaceRef(string elementName, NamespaceDocumentation ns)
        {
            var element = new XElement(elementName);

            AddNamespaceRef(element, ns);
            return(element);
        }
Esempio n. 3
0
 /// <summary>
 /// Add the given type to this set.
 /// </summary>
 internal void Add(TypeDocumentation type)
 {
     NamespaceDocumentation ns;
     if (!namespaceTypes.TryGetValue(type.Namespace, out ns))
     {
         ns = new NamespaceDocumentation(type.Namespace);
         namespaceTypes.Add(type.Namespace, ns);
     }
     ns.Add(type);
 }
Esempio n. 4
0
        /// <summary>
        /// Add the given type to this set.
        /// </summary>
        internal void Add(TypeDocumentation type)
        {
            NamespaceDocumentation ns;

            if (!namespaceTypes.TryGetValue(type.Namespace, out ns))
            {
                ns = new NamespaceDocumentation(type.Namespace);
                namespaceTypes.Add(type.Namespace, ns);
            }
            ns.Add(type);
        }
 /// <summary>
 /// Create namespaces for each missing parent namespace.
 /// </summary>
 private void AddEmptyNamespaces()
 {
     while (true)
     {
         var allParents = Namespaces.Select(x => x.ParentName).Where(x => x != null).Distinct().ToList();
         var namespacesAdded = false;
         foreach (var parentName in allParents)
         {
             NamespaceDocumentation ns;
             if (!TryGetNamespace(parentName, out ns))
             {
                 namespacesAdded = true;
                 ns = new NamespaceDocumentation(parentName);
                 Add(ns);
             }
         }
         if (!namespacesAdded)
             break;
     }
 }
Esempio n. 6
0
 /// <summary>
 /// Create namespaces for each missing parent namespace.
 /// </summary>
 private void AddEmptyNamespaces()
 {
     while (true)
     {
         var allParents      = Namespaces.Select(x => x.ParentName).Where(x => x != null).Distinct().ToList();
         var namespacesAdded = false;
         foreach (var parentName in allParents)
         {
             NamespaceDocumentation ns;
             if (!TryGetNamespace(parentName, out ns))
             {
                 namespacesAdded = true;
                 ns = new NamespaceDocumentation(parentName);
                 Add(ns);
             }
         }
         if (!namespacesAdded)
         {
             break;
         }
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Does this set contain a matching namespace?
 /// </summary>
 public bool ContainsMatching(NamespaceDocumentation @namespace)
 {
     return namespaceTypes.ContainsKey(@namespace.Name);
 }
Esempio n. 8
0
 /// <summary>
 /// Try to get a namespace by name.
 /// Returns true if found, false otherwise.
 /// </summary>
 public bool TryGetNamespace(string name, out NamespaceDocumentation ns)
 {
     return namespaceTypes.TryGetValue(name, out ns);
 }
Esempio n. 9
0
 /// <summary>
 /// Add the given namespace.
 /// </summary>
 protected void Add(NamespaceDocumentation ns)
 {
     namespaceTypes.Add(ns.Name, ns);
 }
Esempio n. 10
0
 /// <summary>
 /// Does this set contain a matching namespace?
 /// </summary>
 public bool ContainsMatching(NamespaceDocumentation @namespace)
 {
     return(namespaceTypes.ContainsKey(@namespace.Name));
 }
Esempio n. 11
0
 /// <summary>
 /// Try to get a namespace by name.
 /// Returns true if found, false otherwise.
 /// </summary>
 public bool TryGetNamespace(string name, out NamespaceDocumentation ns)
 {
     return(namespaceTypes.TryGetValue(name, out ns));
 }
Esempio n. 12
0
 /// <summary>
 /// Add the given namespace.
 /// </summary>
 protected void Add(NamespaceDocumentation ns)
 {
     namespaceTypes.Add(ns.Name, ns);
 }
Esempio n. 13
0
 /// <summary>
 /// Add namespace reference attributes.
 /// </summary>
 internal static void AddNamespaceRef(XElement element, NamespaceDocumentation ns)
 {
     var xid = ns.Xid;
     element.Add(new XAttribute("namespace-name", ns.Name),
                 new XAttribute("namespace-xid", xid));
 }
Esempio n. 14
0
 /// <summary>
 /// Add namespace reference attributes.
 /// </summary>
 internal static XElement CreateNamespaceRef(string elementName, NamespaceDocumentation ns)
 {
     var element = new XElement(elementName);
     AddNamespaceRef(element, ns);
     return element;
 }