Exemple #1
0
 /// <summary>
 /// Add using namespace.
 /// </summary>
 /// <param name="namespace">namespace</param>
 protected void AddUsingNamespace(string @namespace)
 {
     if (UsingNamespaces != null && !UsingNamespaces.Contains(@namespace))
     {
         UsingNamespaces.Add(@namespace);
     }
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 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);
 }