Example #1
0
        public Address(string codedAddressField)
        {
            int length = int.Parse(codedAddressField.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);

            this.m_AddressValue = BaseConversionHelper.DecimalSemiOctetToDecimal(codedAddressField.Substring(4, codedAddressField.Length - 4)).ToString();

            if (this.m_AddressValue.Length != length)
            {
                throw new NotImplementedException();
            }

            int[] typeOfAddress = BaseConversionHelper.HexToBinary(codedAddressField.Substring(2, 2));

            this.m_TypeOfNumber = (TypeOfNumber)BaseConversionHelper.BinaryToDecimal(new int[] { typeOfAddress[4], typeOfAddress[5], typeOfAddress[6] });

            this.m_NumberingPlanIdentification = (NumberingPlanIdentification)BaseConversionHelper.BinaryToDecimal(new int[] { typeOfAddress[0], typeOfAddress[1], typeOfAddress[2], typeOfAddress[3] });
        }