public override void VisitNamespace(NamespaceSymbol @namespace) { Func<NamespaceSymbol, bool> hasInterestingMembers = n => n.Members.Any(x => !(x is NamespaceSymbol) && !NotInterestedIn(x)); if (hasInterestingMembers(@namespace)) { var nameParts = @namespace .Recurse(x => x.Parent.ToMaybe<NamespaceSymbol>()) .TakeWhile(x => x == @namespace || !hasInterestingMembers(x)) .Select(x => x.Name) .Reverse() .ToArray(); var name = new QualifiedIdentifier(nameParts); WriteLine("namespace {0}", name); using (WithBlock()) base.VisitNamespace(@namespace); WriteLine(); } else base.VisitNamespace(@namespace); }
public ExternalEnumSymbol(NamespaceSymbol parent, IEnumerable<Annotation> annotations, Identifier name) { Annotations = Guard.NotNull(annotations, "annotations") .GroupBy(x => x.Name) .ToDictionary(x => x.Key, x => new ReadOnlyCollection<Annotation>(x.ToList())) .ToReadOnlyDictionary(); Parent = Guard.NotNull(parent, "parent"); Name = Guard.NotNull(name, "name"); }
public EntitySymbol(NamespaceSymbol parent, IEnumerable<Annotation> annotations, bool isAbstract, Maybe<TypeReference> identityType, Identifier name, Maybe<TypeLookup> @base, Func<EntitySymbol, IEnumerable<EventSymbol>> events) { Annotations = Guard.NotNull(annotations, "annotations") .GroupBy(x => x.Name) .ToDictionary(x => x.Key, x => new ReadOnlyCollection<Annotation>(x.ToList())) .ToReadOnlyDictionary(); Parent = Guard.NotNull(parent, "parent"); IsAbstract = isAbstract; IdentityType = identityType; Name = Guard.NotNull(name, "name"); _Base = @base; Events = Guard.NotNull(events, "events")(this).ToArray(); }
public virtual void VisitNamespace(NamespaceSymbol @namespace) { Visit(@namespace.Members); }
public ComplexValueSymbol(NamespaceSymbol parent, IEnumerable<Annotation> annotations, bool isAbstract, Identifier name, Maybe<TypeLookup> @base, IEnumerable<AtomSymbol> properties, IEnumerable<Identifier> equalBy) : base(parent, annotations, isAbstract, name, @base, properties) { EqualBy = Guard.NotNull(equalBy, "equalBy").ToArray(); }
public WebApiSymbol(NamespaceSymbol parent, IEnumerable<Annotation> annotations, TypeReference result, Identifier name, Maybe<AtomSymbol> argument, Func<BaseWebApiQuerySymbol, IEnumerable<AtomSymbol>> filters, Func<BaseWebApiPathSymbol, IEnumerable<IWebApiPathMember>> members) : base(annotations, parent, result, name, argument, filters, members) { }