コード例 #1
0
        private void Add(INamespaceName item)
        {
            var position = item.GetHashCode() & NamespaceNamesMask;
            var nodes    = _NamespaceNames[position];

            if (nodes == null)
            {
                _NamespaceNames[position] = nodes = new NamespaceNameCollection();
            }
            nodes.Add(item);
        }
コード例 #2
0
 private static string ToName(this INamespaceName name)
 {
     if (name.IsGlobalNamespace)
     {
         return("");
     }
     // TODO @seb: fix analysis and remove this check then
     if (name.ParentNamespace == null)
     {
         return("");
     }
     return(string.Format("{0}{1}/", name.ParentNamespace.ToName(), name.Name));
 }
コード例 #3
0
 public NamespaceName(INamespaceName parent, string fullName)
 {
     FullName = fullName;
     Parent   = parent;
     if (parent.IsGlobal)
     {
         Root = this;
     }
     else
     {
         Root = parent.Root;
     }
 }
コード例 #4
0
        private bool TryGet(string key, out INamespaceName item)
        {
            var position = key.GetHashCode() & NamespaceNamesMask;
            var nodes    = _NamespaceNames[position];

            if (nodes != null)
            {
                return(nodes.TryGet(key, out item));
            }
            else
            {
                item = default(INamespaceName);
                return(false);
            }
        }
コード例 #5
0
 public void Import(INamespaceName namespaceName)
 {
     ImportedNamespaceNames.Add(namespaceName);
 }
コード例 #6
0
 public NamespaceDeclarationFormatterContext(IFormatterContext parent, INamespaceName namespaceName)
 {
     Parent        = parent;
     NamespaceName = namespaceName;
 }
コード例 #7
0
 private static INamespaceName ToAnonymousName(INamespaceName @namespace)
 {
     return(Names.Namespace(@namespace.Identifier.ToHash()));
 }