Beispiel #1
0
 internal static bool TryParse(string address, out AddressSpace addressSpace, bool performFullValidation)
 {
     try
     {
         addressSpace = AddressSpace.Parse(address, performFullValidation);
     }
     catch (FormatException)
     {
         addressSpace = null;
         return(false);
     }
     return(true);
 }
Beispiel #2
0
        internal static AddressSpace ADParse(string address)
        {
            bool flag = false;

            if (address.StartsWith("Local:", StringComparison.OrdinalIgnoreCase))
            {
                address = address.Substring("Local:".Length);
                flag    = true;
            }
            AddressSpace addressSpace = AddressSpace.Parse(address, false);

            addressSpace.isLocal = flag;
            return(addressSpace);
        }
Beispiel #3
0
        private void Initialize(string addressSpace, bool performFullAddressTypeValidation)
        {
            if (addressSpace.StartsWith("Local:", StringComparison.OrdinalIgnoreCase))
            {
                throw new FormatException(DataStrings.InvalidScopedAddressSpace(addressSpace));
            }
            int    num = addressSpace.IndexOf(':');
            string addressType;

            if (num == -1 || num == 0)
            {
                addressType = "smtp";
            }
            else
            {
                addressType = addressSpace.Substring(0, num);
            }
            int num2 = addressSpace.LastIndexOf(';');

            if (AddressSpace.IsX400AddressType(addressType) && num2 == addressSpace.Length - 1)
            {
                num2 = -1;
            }
            string text;
            int    num3;

            if (num2 == -1 || num2 <= num)
            {
                text = addressSpace.Substring(num + 1);
                num3 = 1;
            }
            else
            {
                text = addressSpace.Substring(num + 1, num2 - num - 1);
                if (num2 == addressSpace.Length - 1)
                {
                    num3 = 1;
                }
                else if (!int.TryParse(addressSpace.Substring(num2 + 1), out num3))
                {
                    throw new ArgumentException(DataStrings.InvalidAddressSpaceCostFormat(addressSpace.Substring(num2 + 1)), "Cost");
                }
            }
            this.Initialize(addressType, text, num3, false, performFullAddressTypeValidation);
        }
Beispiel #4
0
 public static bool TryParse(string address, out AddressSpace addressSpace)
 {
     return(AddressSpace.TryParse(address, out addressSpace, true));
 }
Beispiel #5
0
 public static AddressSpace Parse(string addressSpace)
 {
     return(AddressSpace.Parse(addressSpace, true));
 }
Beispiel #6
0
        public override bool Equals(object comparand)
        {
            AddressSpace addressSpace = comparand as AddressSpace;

            return(addressSpace != null && this.Equals(addressSpace));
        }
 public ConnectedDomain(string organizationName, string adminGroupName, Guid routingGroupGuid, AddressSpace addressSpace)
 {
     this.organizationName = organizationName;
     this.adminGroupName   = adminGroupName;
     this.routingGroupGuid = routingGroupGuid;
     this.addressSpace     = addressSpace;
 }