Exemplo 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));
        }
Exemplo 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);
        }
Exemplo 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);
 }
Exemplo 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);
        }
Exemplo n.º 5
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;
     }
 }
Exemplo 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;
         }
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Does this set contain a matching namespace?
 /// </summary>
 public bool ContainsMatching(NamespaceDocumentation @namespace)
 {
     return namespaceTypes.ContainsKey(@namespace.Name);
 }
Exemplo 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);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Add the given namespace.
 /// </summary>
 protected void Add(NamespaceDocumentation ns)
 {
     namespaceTypes.Add(ns.Name, ns);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Does this set contain a matching namespace?
 /// </summary>
 public bool ContainsMatching(NamespaceDocumentation @namespace)
 {
     return(namespaceTypes.ContainsKey(@namespace.Name));
 }
Exemplo 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));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Add the given namespace.
 /// </summary>
 protected void Add(NamespaceDocumentation ns)
 {
     namespaceTypes.Add(ns.Name, ns);
 }
Exemplo 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));
 }
Exemplo 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;
 }