private static void AppendNamespaceHashCode(ref HashCodeBuilder builder, NamespaceDefinitionHandle namespaceDefHandle, MetadataReader reader)
        {
            NamespaceDefinition namespaceDefinition = reader.GetNamespaceDefinition(namespaceDefHandle);

            Handle parentHandle = namespaceDefinition.ParentScopeOrNamespace;
            HandleType parentHandleType = parentHandle.HandleType;
            if (parentHandleType == HandleType.NamespaceDefinition)
            {
                AppendNamespaceHashCode(ref builder, parentHandle.ToNamespaceDefinitionHandle(reader), reader);
                string namespaceNamePart = reader.GetString(namespaceDefinition.Name);
                builder.Append(namespaceNamePart);
                builder.Append(".");
            }
            else
            {
                Debug.Assert(parentHandleType == HandleType.ScopeDefinition);
                Debug.Assert(String.IsNullOrEmpty(reader.GetString(namespaceDefinition.Name)), "Root namespace with a name?");
            }
        }
Ejemplo n.º 2
0
        private static void AppendNamespaceHashCode(ref HashCodeBuilder builder, NamespaceDefinitionHandle namespaceDefHandle, MetadataReader reader)
        {
            NamespaceDefinition namespaceDefinition = reader.GetNamespaceDefinition(namespaceDefHandle);

            Handle     parentHandle     = namespaceDefinition.ParentScopeOrNamespace;
            HandleType parentHandleType = parentHandle.HandleType;

            if (parentHandleType == HandleType.NamespaceDefinition)
            {
                AppendNamespaceHashCode(ref builder, parentHandle.ToNamespaceDefinitionHandle(reader), reader);
                string namespaceNamePart = reader.GetString(namespaceDefinition.Name);
                builder.Append(namespaceNamePart);
                builder.Append(".");
            }
            else
            {
                Debug.Assert(parentHandleType == HandleType.ScopeDefinition);
                Debug.Assert(String.IsNullOrEmpty(reader.GetString(namespaceDefinition.Name)), "Root namespace with a name?");
            }
        }
Ejemplo n.º 3
0
        } // Offset

        public NamespaceDefinition GetNamespaceDefinition(MetadataReader reader)
        {
            return reader.GetNamespaceDefinition(this);
        } // GetNamespaceDefinition