Example #1
0
 public override void WriteId(TextWriter trapFile)
 {
     if (ParentNamespace != null && !ParentNamespace.IsGlobalNamespace)
     {
         ParentNamespace.WriteId(trapFile);
         trapFile.Write('.');
     }
     trapFile.Write(Name);
 }
Example #2
0
 public override void WriteId(EscapingTextWriter trapFile)
 {
     if (ParentNamespace is not null && !ParentNamespace.IsGlobalNamespace)
     {
         ParentNamespace.WriteId(trapFile);
         trapFile.Write('.');
     }
     trapFile.Write(Name);
     trapFile.Write(";namespace");
 }
Example #3
0
 public override bool Equals(object? obj)
 {
     if (obj is Namespace ns && Name == ns.Name)
     {
         if (ParentNamespace is null)
             return ns.ParentNamespace is null;
         if (!(ns.ParentNamespace is null))
             return ParentNamespace.Equals(ns.ParentNamespace);
     }
     return false;
 }
Example #4
0
 public override bool Equals(object?obj)
 {
     if (obj is Namespace ns && Name == ns.Name)
     {
         if (ParentNamespace is null)
         {
             return(ns.ParentNamespace is null);
         }
         if (!(ns.ParentNamespace is null))
         {
             return(ParentNamespace.Equals(ns.ParentNamespace));
         }
     }
     return(false);
 }
Example #5
0
        public override int GetHashCode()
        {
            var h = ParentNamespace is null ? 19 : ParentNamespace.GetHashCode();

            return(13 * h + Name.GetHashCode());
        }