Example #1
0
 public bool Equals(DnsLabel label)
 {
     if (object.ReferenceEquals(null, label))
     {
         return(false);
     }
     return(_Label.Equals(label._Label));
 }
Example #2
0
        public static bool TryParse(string input, out DnsLabel label)
        {
            if (object.ReferenceEquals(null, input))
            {
                throw new ArgumentNullException("input");
            }

            label = null;
            input = input.Trim();

            if (input.Length == 0)
            {
                return(false);
            }

            if (input.Length > 63)
            {
                return(false);
            }

            string check;

            input = GetNormalized(input, out check);

            if (check.Length > 0)
            {
                if (check[0] == '-')
                {
                    return(false);
                }
                if (check[check.Length - 1] == '-')
                {
                    return(false);
                }
                foreach (int c in check.ToCharArray().Select(c => (int)c))
                {
                    if (!IsLDH(c))
                    {
                        return(false);
                    }
                }
            }

            label = new DnsLabel(input);
            return(true);
        }
Example #3
0
        public static bool TryParse(string input, out DnsLabel label)
        {
            if (object.ReferenceEquals(null, input))
            throw new ArgumentNullException("input");

              label = null;
              input = input.Trim();

              if (input.Length == 0)
            return false;

              if (input.Length > 63)
            return false;

              string check;
              input = GetNormalized(input, out check);

              if (check.Length > 0)
              {
            if (check[0] == '-')
              return false;
            if (check[check.Length - 1] == '-')
              return false;
            foreach (int c in check.ToCharArray().Select(c => (int)c))
            {
              if (!IsLDH(c))
            return false;
            }
              }

              label = new DnsLabel(input);
              return true;
        }
Example #4
0
 public bool Equals(DnsLabel label)
 {
     if (object.ReferenceEquals(null, label))
     return false;
       return _Label.Equals(label._Label);
 }