Ejemplo n.º 1
0
        public static bool TryParse(string s, out ConnectedDomain connectedDomain)
        {
            connectedDomain = null;
            int num = s.IndexOf(ConnectedDomain.Separator);

            if (-1 == num)
            {
                return(false);
            }
            string text = s.Substring(0, num);
            int    num2 = s.IndexOf(ConnectedDomain.Separator, num + 1);

            if (-1 == num2)
            {
                return(false);
            }
            string text2 = s.Substring(num + 1, num2 - num - 1);
            int    num3  = s.IndexOf(ConnectedDomain.Separator, num2 + 1);

            if (-1 == num3 || num3 - num2 < 4)
            {
                return(false);
            }
            string g = s.Substring(num2 + 1, num3 - num2 - 1);
            Guid   guid;

            if (!GuidHelper.TryParseGuid(g, out guid))
            {
                return(false);
            }
            int num4 = 1;
            int num5 = s.IndexOf(ConnectedDomain.Separator, num3 + 1);

            if (-1 != num5)
            {
                string s2 = s.Substring(num3 + 1, num5 - num3 - 1);
                if (!int.TryParse(s2, out num4) || num4 < 1 || num4 > 100)
                {
                    return(false);
                }
            }
            else
            {
                num5 = num3;
            }
            string       address = s.Substring(num5 + 1, s.Length - num5 - 1);
            AddressSpace addressSpace;

            if (!AddressSpace.TryParse(address, out addressSpace, false))
            {
                return(false);
            }
            addressSpace.Cost = num4;
            connectedDomain   = new ConnectedDomain(text, text2, guid, addressSpace);
            return(true);
        }
Ejemplo n.º 2
0
        public static ConnectedDomain Parse(string s)
        {
            ConnectedDomain result;

            if (!ConnectedDomain.TryParse(s, out result))
            {
                throw new FormatException(DataStrings.InvalidConnectedDomainFormat(s));
            }
            return(result);
        }
Ejemplo n.º 3
0
        public override bool Equals(object comparand)
        {
            ConnectedDomain connectedDomain = comparand as ConnectedDomain;

            return(connectedDomain != null && this.Equals(connectedDomain));
        }
Ejemplo n.º 4
0
 public bool Equals(ConnectedDomain value)
 {
     return(object.ReferenceEquals(this, value) || (this.organizationName.Equals(value.organizationName, StringComparison.OrdinalIgnoreCase) && this.adminGroupName.Equals(value.adminGroupName, StringComparison.OrdinalIgnoreCase) && this.routingGroupGuid.Equals(value.routingGroupGuid) && this.addressSpace.Equals(value.addressSpace)));
 }