/// <summary> /// Add using namespace. /// </summary> /// <param name="namespace">namespace</param> protected void AddUsingNamespace(string @namespace) { if (UsingNamespaces != null && !UsingNamespaces.Contains(@namespace)) { UsingNamespaces.Add(@namespace); } }
protected string ScopeTo(AST.Namespace ns) { var usingParent = ns; string ret = ""; while (usingParent != WorkingNamespace && !UsingNamespaces.Contains(usingParent) && !usingParent.IsGlobal) { ret = usingParent.Name + ScopeOperator + ret; usingParent = usingParent.Parent; } return(ret); }
public virtual bool Use(AST.Namespace ns, bool abi) { if (!abi && !UsingNamespaces.Contains(ns)) { UsingNamespaces.Add(ns); } else if (abi && !UsingABINamespaces.Contains(ns)) { UsingABINamespaces.Add(ns); } else { return(false); } return(true); }