public static string FullName(this IReference reference)
        {
            Contract.Requires(reference != null);

            ITypeReference type = reference as ITypeReference;

            if (type != null)
            {
                return(TypeHelper.GetTypeName(type, NameFormattingOptions.TypeParameters));
            }

            ITypeMemberReference member = reference as ITypeMemberReference;

            if (member != null)
            {
                return(MemberHelper.GetMemberSignature(member, NameFormattingOptions.TypeParameters | NameFormattingOptions.Signature));
            }

            IUnitNamespaceReference ns = reference as IUnitNamespaceReference;

            if (ns != null)
            {
                return(TypeHelper.GetNamespaceName(ns, NameFormattingOptions.None));
            }

            INamedEntity named = reference as INamedEntity;

            if (named != null)
            {
                return(named.Name.Value);
            }

            Contract.Assert(false, String.Format(CultureInfo.CurrentCulture, LocalizedStrings.FellThroughCasesIn, "TypeExtensions.FullName()", reference.GetType()));
            return(LocalizedStrings.UnknownReferenceType);
        }
Exemplo n.º 2
0
        public static string RefDocId(this IReference reference)
        {
            Contract.Requires(reference != null);

            ITypeReference type = reference as ITypeReference;

            if (type != null)
            {
                return(type.DocId());
            }

            ITypeMemberReference member = reference as ITypeMemberReference;

            if (member != null)
            {
                return(member.DocId());
            }

            IUnitNamespaceReference ns = reference as IUnitNamespaceReference;

            if (ns != null)
            {
                return(ns.DocId());
            }

            IAssemblyReference assembly = reference as IAssemblyReference;

            if (assembly != null)
            {
                return(assembly.DocId());
            }

            Contract.Assert(false, string.Format("Fell through cases in TypeExtensions.RefDocId() Type of reference: {0}", reference.GetType()));
            return("<Unknown Reference Type>");
        }
Exemplo n.º 3
0
        public static string FullName(this IReference reference)
        {
            Contract.Requires(reference != null);

            ITypeReference type = reference as ITypeReference;

            if (type != null)
            {
                return(TypeHelper.GetTypeName(type, NameFormattingOptions.TypeParameters));
            }

            ITypeMemberReference member = reference as ITypeMemberReference;

            if (member != null)
            {
                return(MemberHelper.GetMemberSignature(member, NameFormattingOptions.TypeParameters | NameFormattingOptions.Signature));
            }

            IUnitNamespaceReference ns = reference as IUnitNamespaceReference;

            if (ns != null)
            {
                return(TypeHelper.GetNamespaceName(ns, NameFormattingOptions.None));
            }

            INamedEntity named = reference as INamedEntity;

            if (named != null)
            {
                return(named.Name.Value);
            }

            Contract.Assert(false, String.Format("Fell through cases in TypeExtensions.FullName() Type of reference: {0}", reference.GetType()));
            return("<Unknown Reference Type>");
        }
Exemplo n.º 4
0
        public static string UniqueId(this IReference reference)
        {
            Contract.Requires(reference != null);

            ITypeReference type = reference as ITypeReference;

            if (type != null)
            {
                return(type.DocId());
            }

            ITypeMemberReference member = reference as ITypeMemberReference;

            if (member != null)
            {
                return(member.DocId());
            }

            IUnitNamespaceReference ns = reference as IUnitNamespaceReference;

            if (ns != null)
            {
                return(ns.DocId());
            }

            IAssemblyReference assembly = reference as IAssemblyReference;

            if (assembly != null)
            {
                return(assembly.DocId());
            }

            // Include the hash code as well to make it unique so we can use this for a key
            return("<Unknown Reference Type>" + reference.GetHashCode().ToString());
        }
Exemplo n.º 5
0
        public static string RefDocId(this IReference reference)
        {
            Contract.Requires(reference != null);

            ITypeReference type = reference as ITypeReference;

            if (type != null)
            {
                return(type.DocId());
            }

            ITypeMemberReference member = reference as ITypeMemberReference;

            if (member != null)
            {
                return(member.DocId());
            }

            IUnitNamespaceReference ns = reference as IUnitNamespaceReference;

            if (ns != null)
            {
                return(ns.DocId());
            }

            IAssemblyReference assembly = reference as IAssemblyReference;

            if (assembly != null)
            {
                return(assembly.DocId());
            }

            Contract.Assert(false, string.Format(CultureInfo.CurrentUICulture, LocalizedStrings.FellThroughCasesIn, "DocIdExtensions.RefDocId()", reference.GetType()));
            return(LocalizedStrings.UnknownReferenceType);
        }
 public override void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     if (Process(unitNamespaceReference))
     {
         visitor.Visit(unitNamespaceReference);
     }
     base.Visit(unitNamespaceReference);
 }
Exemplo n.º 7
0
        private void AddUpwardNamespace(IUnitNamespaceReference iUnitNamespaceReference)
        {
            this.thingsToKeep.Add(iUnitNamespaceReference);
            var nested = iUnitNamespaceReference as INestedUnitNamespaceReference;

            if (nested != null)
            {
                this.AddUpwardNamespace(nested.ContainingUnitNamespace);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Returns a unit namespace definition, nested in the given unitNamespace if possible,
        /// otherwise nested in the given unit if possible, otherwise nested in the given host if possible, otherwise it returns Dummy.UnitNamespace.
        /// If unitNamespaceReference is a root namespace, the result is equal to the given unitNamespace if not null,
        /// otherwise the result is the root namespace of the given unit if not null,
        /// otherwise the result is root namespace of unitNamespaceReference.Unit, if that can be resolved via the given host,
        /// otherwise the result is Dummy.UnitNamespace.
        /// </summary>
        public static IUnitNamespace Resolve(IUnitNamespaceReference unitNamespaceReference, IMetadataHost host, IUnit unit = null, IUnitNamespace unitNamespace = null)
        {
            Contract.Requires(unitNamespaceReference != null);
            Contract.Requires(host != null);
            Contract.Requires(unit != null || unitNamespace == null);
            Contract.Ensures(Contract.Result <IUnitNamespace>() != null);

            var rootNsRef = unitNamespaceReference as IRootUnitNamespaceReference;

            if (rootNsRef != null)
            {
                if (unitNamespace != null)
                {
                    return(unitNamespace);
                }
                if (unit != null)
                {
                    return(unit.UnitNamespaceRoot);
                }
                unit = UnitHelper.Resolve(unitNamespaceReference.Unit, host);
                if (unit is Dummy)
                {
                    return(Dummy.UnitNamespace);
                }
                return(unit.UnitNamespaceRoot);
            }
            var nestedNsRef = unitNamespaceReference as INestedUnitNamespaceReference;

            if (nestedNsRef == null)
            {
                return(Dummy.UnitNamespace);
            }
            var containingNsDef = UnitHelper.Resolve(nestedNsRef.ContainingUnitNamespace, host, unit, unitNamespace);

            if (containingNsDef is Dummy)
            {
                return(Dummy.UnitNamespace);
            }
            foreach (var nsMem in containingNsDef.GetMembersNamed(nestedNsRef.Name, ignoreCase: false))
            {
                var neNsDef = nsMem as INestedUnitNamespace;
                if (neNsDef != null)
                {
                    return(neNsDef);
                }
            }
            return(Dummy.UnitNamespace);
        }
Exemplo n.º 9
0
        private static void WriteNamespaceAndSeparator(IUnitNamespaceReference ns, TextWriter writer)
        {
            Contract.Requires(ns != null);
            Contract.Requires(writer != null);

            INestedUnitNamespaceReference nested = ns as INestedUnitNamespaceReference;

            if (nested == null)
            {
                return;           // top-level
            }
            Contract.Assume(nested.ContainingUnitNamespace != null, "lack of CCI2 contracts");

            WriteNamespaceAndSeparator(nested.ContainingUnitNamespace, writer);
            writer.Write(nested.Name.Value);
            writer.Write(".");
        }
Exemplo n.º 10
0
        /// <summary>
        /// Returns true if the given two unit namespaces are to be considered equivalent as containers.
        /// </summary>
        public static bool UnitNamespacesAreEquivalent(IUnitNamespaceReference /*?*/ unitNamespace1, IUnitNamespaceReference /*?*/ unitNamespace2)
        {
            if (unitNamespace1 == null || unitNamespace2 == null)
            {
                return(false);
            }
            if (unitNamespace1 == unitNamespace2)
            {
                return(true);
            }
            INestedUnitNamespaceReference /*?*/ nstUnitNamespace1 = unitNamespace1 as INestedUnitNamespaceReference;
            INestedUnitNamespaceReference /*?*/ nstUnitNamespace2 = unitNamespace2 as INestedUnitNamespaceReference;

            if (nstUnitNamespace1 != null && nstUnitNamespace2 != null)
            {
                return(nstUnitNamespace1.Name.UniqueKey == nstUnitNamespace2.Name.UniqueKey &&
                       UnitHelper.UnitNamespacesAreEquivalent(nstUnitNamespace1.ContainingUnitNamespace, nstUnitNamespace2.ContainingUnitNamespace));
            }
            if (nstUnitNamespace1 != null || nstUnitNamespace2 != null)
            {
                return(false);
            }
            return(UnitHelper.UnitsAreContainmentEquivalent(unitNamespace1.Unit, unitNamespace2.Unit));
        }
Exemplo n.º 11
0
        public IUnitNamespaceReference Map(INamespaceSymbol namespaceSymbol)
        {
            Contract.Requires(namespaceSymbol != null);
            Contract.Ensures(Contract.Result <IUnitNamespaceReference>() != null);
            IUnitNamespaceReference nsr = null;

            if (!namespaceSymbolCache.TryGetValue(namespaceSymbol, out nsr))
            {
                if (namespaceSymbol.ContainingAssembly.Equals(this.assemblyBeingTranslated))
                {
                    var n = this.CreateNamespaceDefinition(namespaceSymbol);
                    return(n);
                }

                if (namespaceSymbol.IsGlobalNamespace)
                {
                    var n = new Microsoft.Cci.MutableCodeModel.RootUnitNamespaceReference()
                    {
                        Unit = Map(namespaceSymbol.ContainingAssembly),
                    };
                    nsr = n;
                }
                else
                {
                    var ns = new Microsoft.Cci.MutableCodeModel.NestedUnitNamespaceReference()
                    {
                        ContainingUnitNamespace = Map(namespaceSymbol.ContainingNamespace),
                        Name = this.nameTable.GetNameFor(namespaceSymbol.Name),
                    };
                    nsr = ns;
                }
                namespaceSymbolCache[namespaceSymbol] = nsr;
            }
            Contract.Assume(nsr != null);
            return(nsr);
        }
Exemplo n.º 12
0
    uint GetNamespaceTypeReferenceInternId(IUnitNamespaceReference containingUnitNamespace, IName typeName, uint genericParameterCount) {
      Contract.Requires(containingUnitNamespace != null);
      Contract.Requires(typeName != null);

      uint containingUnitNamespaceInteredId = this.GetUnitNamespaceInternId(containingUnitNamespace);
      foreach (NamespaceTypeStore nsTypeStore in this.NamespaceTypeHashtable.GetValuesFor((uint)typeName.UniqueKey)) {
        if (nsTypeStore.ContainingNamespaceInternedId == containingUnitNamespaceInteredId && nsTypeStore.GenericParameterCount == genericParameterCount) {
          return nsTypeStore.InternedId;
        }
      }
      NamespaceTypeStore nsTypeStore1 = new NamespaceTypeStore(containingUnitNamespaceInteredId, genericParameterCount, this.CurrentTypeInternValue++);
      this.NamespaceTypeHashtable.Add((uint)typeName.UniqueKey, nsTypeStore1);
      return nsTypeStore1.InternedId;
    }
Exemplo n.º 13
0
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 public void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
 }
Exemplo n.º 14
0
        /// <summary>
        /// Allocates a type definition that is a member of a namespace definition.
        /// </summary>
        /// <param name="host">Provides a standard abstraction over the applications that host components that provide or consume objects from the metadata model.</param>
        /// <param name="containingUnitNamespace">The namespace that contains the referenced type.</param>
        /// <param name="name">The name of the referenced type.</param>
        /// <param name="genericParameterCount">The number of generic parameters. Zero if the type is not generic.</param>
        /// <param name="isEnum">True if the type is an enumeration (it extends System.Enum and is sealed). Corresponds to C# enum.</param>
        /// <param name="isValueType">True if the referenced type is a value type.</param>
        /// <param name="typeCode">A value indicating if the type is a primitive type or not.</param>
        public NamespaceTypeReference(IMetadataHost host, IUnitNamespaceReference containingUnitNamespace, IName name, ushort genericParameterCount, bool isEnum, bool isValueType, PrimitiveTypeCode typeCode)
            : base(host, isEnum, isValueType)
        {
            Contract.Requires(host != null);
              Contract.Requires(containingUnitNamespace != null);
              Contract.Requires(name != null);

              this.containingUnitNamespace = containingUnitNamespace;
              this.name = name;
              this.genericParameterCount = genericParameterCount;
              this.typeCode = typeCode;
        }
Exemplo n.º 15
0
 /// <summary>
 /// Traverses the specified unit namespace reference.
 /// </summary>
 public void Traverse(IUnitNamespaceReference unitNamespaceReference)
 {
     Contract.Requires(unitNamespaceReference != null);
       unitNamespaceReference.DispatchAsReference(this.dispatchingVisitor);
 }
Exemplo n.º 16
0
 //^ ensures this.path.Count == old(this.path.Count);
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 /// <param name="unitNamespaceReference">The unit namespace reference.</param>
 public virtual void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     unitNamespaceReference.Dispatch(this);
 }
 public override void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     if(Process(unitNamespaceReference)){visitor.Visit(unitNamespaceReference);}
     base.Visit(unitNamespaceReference);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 /// <param name="unitNamespaceReference">The unit namespace reference.</param>
 public virtual void Visit(IUnitNamespaceReference unitNamespaceReference)
   //^ ensures this.path.Count == old(this.path.Count);
 {
   unitNamespaceReference.Dispatch(this);
 }
Exemplo n.º 19
0
    private static void WriteNamespaceAndSeparator(IUnitNamespaceReference ns, TextWriter writer)
    {
      Contract.Requires(ns != null);
      Contract.Requires(writer != null);

      INestedUnitNamespaceReference nested = ns as INestedUnitNamespaceReference;
      if (nested == null) return; // top-level

      Contract.Assume(nested.ContainingUnitNamespace != null, "lack of CCI2 contracts");

      WriteNamespaceAndSeparator(nested.ContainingUnitNamespace, writer);
      writer.Write(nested.Name.Value);
      writer.Write(".");
    }
Exemplo n.º 20
0
    private void AppendMangledName(StringBuilder sb, IUnitNamespaceReference unitNamespace) {
      Contract.Requires(sb != null);
      Contract.Requires(unitNamespace != null);

      var nestedNamespace = unitNamespace as INestedUnitNamespaceReference;
      if (nestedNamespace == null) return;
      this.AppendMangledName(sb, nestedNamespace.ContainingUnitNamespace);
      sb.Append('_');
      this.AppendSanitizedName(sb, nestedNamespace.Name.Value);
    }
Exemplo n.º 21
0
        public bool TryGetNamespaceReference(CSharpNamespace semanticNamespace, IAssemblyReference cciAssembly, out IUnitNamespaceReference cciNamespace)
        {
            Contract.Ensures(!Contract.Result <bool>() || (Contract.ValueAtReturn(out cciNamespace) != null));

            cciNamespace = null;

            #region Check input
            if (semanticNamespace == null || cciAssembly == null)
            {
                return(false);
            }
            #endregion
            #region If root
            try {
                if (semanticNamespace.IsRoot)
                {
                    cciNamespace = new Microsoft.Cci.MutableCodeModel.RootUnitNamespaceReference()
                    {
                        Unit = cciAssembly
                    };
                    goto ReturnTrue;
                }
            } catch (InvalidOperationException e) { //For some reason, an InvalidOperationException may get thrown.
                if (e.Message.Contains(ContractsPackageAccessor.InvalidOperationExceptionMessage_TheSnapshotIsOutOfDate))
                {
                    goto ReturnFalse;
                }
                else
                {
                    throw e;
                }
            }
            #endregion
            #region If nested
            if (semanticNamespace.ContainingNamespace != null)
            {
                IUnitNamespaceReference parentNs;
                if (!TryGetNamespaceReference(semanticNamespace.ContainingNamespace, cciAssembly, out parentNs))
                {
                    goto ReturnFalse;
                }
                if (semanticNamespace.Name == null)
                {
                    goto ReturnFalse;
                }
                cciNamespace = new Microsoft.Cci.Immutable.NestedUnitNamespaceReference(parentNs, Host.NameTable.GetNameFor(semanticNamespace.Name.Text));
                goto ReturnTrue;
            }
            #endregion
            Contract.Assert(cciNamespace == null);
            goto ReturnFalse;

            #region ReturnTrue:
ReturnTrue:
            return(true);

            #endregion
            #region ReturnFalse:
ReturnFalse:
            return(false);

            #endregion
        }
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 public virtual void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     Contract.Requires(unitNamespaceReference != null);
 }
 /// <summary>
 /// Rewrites the specified reference to a unit namespace.
 /// </summary>
 public virtual IUnitNamespaceReference Rewrite(IUnitNamespaceReference unitNamespaceReference)
 {
     return unitNamespaceReference;
 }
 void ModuleQualifiedUnitNamespace(IUnitNamespaceReference unitNamespace, out bool wasRoot) {
   INestedUnitNamespaceReference nestedUnitNamespace = unitNamespace as INestedUnitNamespaceReference;
   if (nestedUnitNamespace != null) {
     this.ModuleQualifiedUnitNamespace(nestedUnitNamespace.ContainingUnitNamespace, out wasRoot);
     if (!wasRoot) {
       this.ILDasmPaper.Symbol(".");
     }
     this.ILDasmPaper.Identifier(nestedUnitNamespace.Name.Value);
     wasRoot = false;
   } else {
     IModuleReference module = (IModuleReference)unitNamespace.Unit;
     if (module.ContainingAssembly != null)
       module = module.ContainingAssembly;
     if (!module.Equals(this.CurrentModule))
       this.ModuleAsReference(module);
     wasRoot = true;
   }
 }
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 public virtual void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     Contract.Requires(unitNamespaceReference != null);
 }
Exemplo n.º 26
0
 public override void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     allElements.Add(new InvokInfo(Traverser, "IUnitNamespaceReference", unitNamespaceReference));
 }
Exemplo n.º 27
0
 public override void Visit(IUnitNamespaceReference unitNamespaceReference) {
   unitNamespaceReference.ResolvedUnitNamespace.Dispatch(this);
 }
Exemplo n.º 28
0
        public override void TraverseChildren(IUnitNamespaceReference unitNamespaceReference)
{ MethodEnter(unitNamespaceReference);
            base.TraverseChildren(unitNamespaceReference);
     MethodExit();   }
Exemplo n.º 29
0
 /// <summary>
 /// Visits the specified unit namespace reference.
 /// </summary>
 public virtual void Visit(IUnitNamespaceReference unitNamespaceReference)
 {
     //IUnitNamespaceReference is a base interface that should never be implemented directly.
       //Get unitNamespaceReference to call the most type specific visitor.
       unitNamespaceReference.Dispatch(this);
 }
Exemplo n.º 30
0
 public override void TraverseChildren(IUnitNamespaceReference unitNamespaceReference)
 {
     MethodEnter(unitNamespaceReference);
     base.TraverseChildren(unitNamespaceReference);
     MethodExit();
 }
Exemplo n.º 31
0
 /// <summary>
 /// Traverses the specified unit namespace reference.
 /// </summary>
 public virtual void TraverseChildren(IUnitNamespaceReference unitNamespaceReference)
 {
     Contract.Requires(unitNamespaceReference != null);
       this.Traverse(unitNamespaceReference.Unit);
 }
Exemplo n.º 32
0
 /// <summary>
 /// Traverses the specified unit namespace reference.
 /// </summary>
 public virtual void TraverseChildren(IUnitNamespaceReference unitNamespaceReference)
 {
     this.Traverse(unitNamespaceReference.Unit);
 }
Exemplo n.º 33
0
 /// <summary>
 /// Allocates a reference to a nested unit namespace.
 /// </summary>
 /// <param name="containingUnitNamespace">A reference to the unit namespace that contains the referenced nested unit namespace.</param>
 /// <param name="name">The name of the referenced nested unit namespace.</param>
 public NestedUnitNamespaceReference(IUnitNamespaceReference containingUnitNamespace, IName name)
 {
     this.containingUnitNamespace = containingUnitNamespace;
       this.name = name;
 }
Exemplo n.º 34
0
 public static string DocId(this IUnitNamespaceReference ns)
 {
     return("N:" + TypeHelper.GetNamespaceName(ns, NameFormattingOptions.None));
 }
 public override void TraverseChildren(IUnitNamespaceReference unitNamespaceReference) {
   base.TraverseChildren(unitNamespaceReference);
 }
Exemplo n.º 36
0
 private void AddUpwardNamespace(IUnitNamespaceReference iUnitNamespaceReference) {
   this.thingsToKeep.Add(iUnitNamespaceReference);
   var nested = iUnitNamespaceReference as INestedUnitNamespaceReference;
   if (nested != null)
     this.AddUpwardNamespace(nested.ContainingUnitNamespace);
 }
Exemplo n.º 37
0
    uint GetUnitNamespaceInternId(IUnitNamespaceReference unitNamespaceReference) {
      Contract.Requires(unitNamespaceReference != null);

      INestedUnitNamespaceReference/*?*/ nestedUnitNamespaceReference = unitNamespaceReference as INestedUnitNamespaceReference;
      if (nestedUnitNamespaceReference != null) {
        return this.GetNestedNamespaceInternId(nestedUnitNamespaceReference);
      }
      return this.GetUnitRootNamespaceInternId(unitNamespaceReference.Unit);
    }
 public uint GetNamespaceTypeReferenceInternedKey(IUnitNamespaceReference containingUnitNamespace, IName typeName, uint genericParameterCount) {
   return 0;
 }
Exemplo n.º 39
0
 uint IInternFactory.GetNamespaceTypeReferenceInternedKey(IUnitNamespaceReference containingUnitNamespace, IName typeName, uint genericParameterCount) {
   lock (GlobalLock.LockingObject) {
     return this.GetNamespaceTypeReferenceInternId(containingUnitNamespace, typeName, genericParameterCount);
   }
 }
Exemplo n.º 40
0
 public uint GetNamespaceTypeReferenceInternedKey(IUnitNamespaceReference containingUnitNamespace, IName typeName, uint genericParameterCount)
 {
     return(m_factory.GetNamespaceTypeReferenceInternedKey(containingUnitNamespace, typeName, genericParameterCount));
 }
Exemplo n.º 41
0
    public bool TryGetNamespaceReference(INamespaceSymbol semanticNamespace, IAssemblyReference cciAssembly, out IUnitNamespaceReference cciNamespace) {
      Contract.Ensures(!Contract.Result<bool>() || (Contract.ValueAtReturn(out cciNamespace) != null));

      cciNamespace = null;

      #region Check input
      if (semanticNamespace == null || cciAssembly == null) {
        return false;
      }
      #endregion
      #region If root
      try {
        if (semanticNamespace.IsGlobalNamespace) {
          cciNamespace = new Microsoft.Cci.MutableCodeModel.RootUnitNamespaceReference() { Unit = cciAssembly };
          goto ReturnTrue;
        }
      } catch (InvalidOperationException e) { //For some reason, an InvalidOperationException may get thrown.
        if (e.Message.Contains(ContractsPackageAccessor.InvalidOperationExceptionMessage_TheSnapshotIsOutOfDate))
          goto ReturnFalse;
        else
          throw e;
      }
      #endregion
      #region If nested
      if (semanticNamespace.ContainingNamespace != null) {
        IUnitNamespaceReference parentNs;
        if (!TryGetNamespaceReference(semanticNamespace.ContainingNamespace, cciAssembly, out parentNs))
          goto ReturnFalse;
        if (semanticNamespace.Name == null) goto ReturnFalse;
        cciNamespace = new Microsoft.Cci.Immutable.NestedUnitNamespaceReference(parentNs, Host.NameTable.GetNameFor(semanticNamespace.Name));
        goto ReturnTrue;
      }
      #endregion
      Contract.Assert(cciNamespace == null);
      goto ReturnFalse;

      #region ReturnTrue:
    ReturnTrue:
      return true;
      #endregion
      #region ReturnFalse:
    ReturnFalse:
      return false;
      #endregion
    }
Exemplo n.º 42
0
 /// <summary>
 /// Traverses the specified unit namespace reference.
 /// </summary>
 public void Traverse(IUnitNamespaceReference unitNamespaceReference)
 {
     unitNamespaceReference.DispatchAsReference(this.dispatchingVisitor);
 }