private object DoGetNamespace(CsUsingDirective u) { return u.Namespace; }
public CsNamespace(CsBody body, string name, CsExternAlias[] externs, CsUsingAlias[] aliases, CsUsingDirective[] uses, CsNamespace[] namespaces, CsType[] types, int offset, int length, int line) : base(body, types, offset, length, line) { Contract.Requires(!string.IsNullOrEmpty(name), "name is null or empty"); Contract.Requires(externs != null, "externs is null"); Contract.Requires(aliases != null, "aliases is null"); Contract.Requires(uses != null, "uses is null"); Contract.Requires(namespaces != null, "namespaces is null"); Name = name; Externs = externs; Aliases = aliases; Uses = uses; Namespaces = namespaces; var decs = new List<CsDeclaration>(); decs.AddRange(namespaces); SetDeclarations(decs); foreach (CsNamespace n in Namespaces) n.Namespace = this; foreach (CsType t in Types) t.Namespace = this; }
private bool DoIsSorted(CsUsingDirective[] uses) { for (int i = 1; i < uses.Length; ++i) { if (uses[i - 1].Namespace.CompareTo(uses[i].Namespace) > 0) return false; } return true; }
public CsGlobalNamespace(CsPreprocess[] preprocess, CsBody body, CsAttribute[] attrs, CsExternAlias[] externs, CsUsingAlias[] aliases, CsUsingDirective[] uses, CsNamespace[] namespaces, CsType[] types, int length) : base(body, "<globals>", externs, aliases, uses, namespaces, types, 0, length, 1) { Contract.Requires(attrs != null, "attrs is null"); Contract.Requires(preprocess != null, "preprocess is null"); Attributes = attrs; Preprocess = preprocess; }