public override void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     if (Process(namespaceAliasForType))
     {
         visitor.Visit(namespaceAliasForType);
     }
     base.Visit(namespaceAliasForType);
 }
Example #2
0
        private static INamespaceAliasForType GetAliasForType(IAliasForType aliasForType)
        {
            INestedAliasForType nestedAliasForType = aliasForType as INestedAliasForType;

            while (nestedAliasForType != null)
            {
                aliasForType       = nestedAliasForType.ContainingAlias;
                nestedAliasForType = aliasForType as INestedAliasForType;
            }
            INamespaceAliasForType namespaceAliasForType = aliasForType as INamespaceAliasForType;

            return(namespaceAliasForType);
        }
Example #3
0
        // Walk up the path of defining namespaces and units until we get to the assembly
        public static IAssembly GetDefiningAssembly(IAliasForType aliasForType)
        {
            INamespaceAliasForType namespaceAliasForType = GetAliasForType(aliasForType);

            if (namespaceAliasForType == null)
            {
                return(null);
            }
            INamespaceDefinition containingNamespace = namespaceAliasForType.ContainingNamespace;

            IUnitNamespace unitNamespace = GetUnitNamespace(containingNamespace);

            if (unitNamespace == null)
            {
                return(null);
            }

            IUnit unit = unitNamespace.Unit;

            IAssembly assembly = GetAssembly(unit);

            return(assembly);
        }
Example #4
0
        public static IEnumerable <INamespaceTypeDefinition> GetTypes(this INamespaceDefinition ns, bool includeForwards = false)
        {
            IEnumerable <INamespaceTypeDefinition> types;

            if (includeForwards)
            {
                types = ns.Members.Select <INamespaceMember, INamespaceTypeDefinition>(nsMember =>
                {
                    INamespaceAliasForType nsAlias = nsMember as INamespaceAliasForType;
                    if (nsAlias != null)
                    {
                        nsMember = nsAlias.AliasedType.ResolvedType as INamespaceTypeDefinition;
                    }

                    return(nsMember as INamespaceTypeDefinition);
                }).Where(t => t != null);
            }
            else
            {
                types = ns.Members.OfType <INamespaceTypeDefinition>();
            }
            return(types);
        }
Example #5
0
 public void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     this.traverser.Traverse(namespaceAliasForType);
 }
Example #6
0
 /// <summary>
 /// Traverses the children of the namespace alias for type.
 /// </summary>
 public virtual void TraverseChildren(INamespaceAliasForType namespaceAliasForType)
 {
     Contract.Requires(namespaceAliasForType != null);
       this.TraverseChildren((IAliasForType)namespaceAliasForType);
 }
Example #7
0
 /// <summary>
 /// Traverses the alias for a namespace type definition.
 /// </summary>
 public void Traverse(INamespaceAliasForType namespaceAliasForType)
 {
     Contract.Requires(namespaceAliasForType != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(namespaceAliasForType);
       if (this.stopTraversal) return;
       this.TraverseChildren(namespaceAliasForType);
       if (this.stopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(namespaceAliasForType);
 }
Example #8
0
 /// <summary>
 /// Performs some computation with the given alias for a namespace type definition, as a reference.
 /// </summary>
 /// <param name="namespaceAliasForType"></param>
 public virtual void VisitReference(INamespaceAliasForType namespaceAliasForType)
 {
 }
 public override void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     if(Process(namespaceAliasForType)){visitor.Visit(namespaceAliasForType);}
     base.Visit(namespaceAliasForType);
 }
 public virtual void onMetadataElement(INamespaceAliasForType namespaceAliasForType) { }
Example #11
0
 /// <summary>
 /// Performs some computation with the given alias for a namespace type definition.
 /// </summary>
 public void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     this.Visit((IAliasForType)namespaceAliasForType);
     if (!namespaceAliasForType.IsPublic && !(TypeHelper.GetDefiningUnitReference(namespaceAliasForType.AliasedType) is IAssemblyReference))
       this.ReportError(MetadataError.NonPublicTypeAlias, namespaceAliasForType);
 }
Example #12
0
 public virtual void onMetadataElement(INamespaceAliasForType namespaceAliasForType)
 {
 }
 /// <summary>
 /// Performs some computation with the given alias for a namespace type definition.
 /// </summary>
 public virtual void Visit(INamespaceAliasForType namespaceAliasForType)
 {
 }
 /// <summary>
 /// Rewrites the namespace alias for type.
 /// </summary>
 public virtual INamespaceAliasForType Rewrite(INamespaceAliasForType namespaceAliasForType)
 {
     return namespaceAliasForType;
 }
Example #15
0
 public override void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     allElements.Add(new InvokInfo(Traverser, "INamespaceAliasForType", namespaceAliasForType));
 }
Example #16
0
 /// <summary>
 /// Performs some computation with the given alias for a namespace type definition.
 /// </summary>
 public virtual void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     this.Visit((IAliasForType)namespaceAliasForType);
 }
Example #17
0
 /// <summary>
 /// Performs some computation with the given alias for a namespace type definition.
 /// </summary>
 /// <param name="namespaceAliasForType"></param>
 public virtual void Visit(INamespaceAliasForType namespaceAliasForType)
 {
 }
        public override void TraverseChildren(INamespaceAliasForType namespaceAliasForType)
{ MethodEnter(namespaceAliasForType);
            base.TraverseChildren(namespaceAliasForType);
     MethodExit();   }
 public override void TraverseChildren(INamespaceAliasForType namespaceAliasForType) {
   base.TraverseChildren(namespaceAliasForType);
 }
Example #20
0
 public void Visit(INamespaceAliasForType namespaceAliasForType)
 {
     throw new NotImplementedException();
 }
Example #21
0
 public override void TraverseChildren(INamespaceAliasForType namespaceAliasForType)
 {
     MethodEnter(namespaceAliasForType);
     base.TraverseChildren(namespaceAliasForType);
     MethodExit();
 }
Example #22
0
 /// <summary>
 /// Traverses the children of the namespace alias for type.
 /// </summary>
 public virtual void TraverseChildren(INamespaceAliasForType namespaceAliasForType)
 {
     this.TraverseChildren((IAliasForType)namespaceAliasForType);
 }