當前位置: 首頁>>代碼示例>>C#>>正文


C# AddressType類代碼示例

本文整理匯總了C#中AddressType的典型用法代碼示例。如果您正苦於以下問題:C# AddressType類的具體用法?C# AddressType怎麽用?C# AddressType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AddressType類屬於命名空間,在下文中一共展示了AddressType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ShouldEncodeDecodeAddressString

 public virtual void ShouldEncodeDecodeAddressString()
 {
     AddressType addressType = new AddressType();
     var result2 = addressType.Encode("0034567890abcdef1234567890abcdef12345678").ToHex();
     var result3 = addressType.Decode(result2, typeof(string));
     Assert.Equal("0x0034567890abcdef1234567890abcdef12345678", result3);
 }
開發者ID:Nethereum,項目名稱:Nethereum,代碼行數:7,代碼來源:AddressEncodingTests.cs

示例2: Address

 public Address(string address1,string address2,string postCode,AddressType addressType)
 {
     this._address1 = address1;
     this._address2 = address2;
     this._postCode = postCode;
     this._addressType = addressType;
 }
開發者ID:ryzam,項目名稱:Vaccine-CQRS,代碼行數:7,代碼來源:Address.cs

示例3: GetAddress

 public static string GetAddress(string Host, AddressType AddressFormat)
 {
     string IPAddress = string.Empty;
     AddressFamily addrFamily = AddressFamily.InterNetwork;
     switch (AddressFormat)
     {
         case AddressType.IPv4:
             addrFamily = AddressFamily.InterNetwork;
             break;
         case AddressType.IPv6:
             addrFamily = AddressFamily.InterNetworkV6;
             break;
     }
     IPHostEntry IPE = Dns.GetHostEntry(Host);
     if (Host != IPE.HostName)
     {
         IPE = Dns.GetHostEntry(IPE.HostName);
     }
     foreach (IPAddress IPA in IPE.AddressList)
     {
         if (IPA.AddressFamily == addrFamily)
         {
             return IPA.ToString();
         }
     }
     return string.Empty;
 }
開發者ID:biganth,項目名稱:Curt,代碼行數:27,代碼來源:NetworkUtils.cs

示例4: BaseAddress

 /// <summary>
 /// Initializes a new instance of the <see cref="BaseAddress"/> class.
 /// </summary>
 /// <param name="region">The region.</param>
 /// <param name="address">The address.</param>
 /// <param name="size">The size.</param>
 /// <param name="prefetchable">if set to <c>true</c> [prefetchable].</param>
 public BaseAddress(AddressType region, uint address, uint size, bool prefetchable)
 {
     this.region = region;
     this.address = address;
     this.size = size;
     this.prefetchable = prefetchable;
 }
開發者ID:hj1980,項目名稱:Mosa,代碼行數:14,代碼來源:BaseAddress.cs

示例5: AddressRange

 public AddressRange(AddressType desc, Byte id, UInt32 low, UInt32 high)
 {
     this.PId = id;
     this.PDesc = desc;
     this.PLow = low;
     this.PHigh = high;
 }
開發者ID:xspeedfly,項目名稱:tcp-gecko-dotnet,代碼行數:7,代碼來源:MemAreas.cs

示例6: SocksRequest

 public SocksRequest(StreamTypes type, AddressType addrtype, string address, int port)
 {
     Type = addrtype;
     StreamType = type;
     Address = address;
     Port = port;
 }
開發者ID:tsebring,項目名稱:Socks5,代碼行數:7,代碼來源:Socks.cs

示例7: EmployeeAddress

 public EmployeeAddress(AddressType type, string streetAddress, string city, string state, string zip)
 {
     _type = type;
     _streetAddress = streetAddress;
     _city = city;
     _zip = zip;
 }
開發者ID:spzenk,項目名稱:sfdocsamples,代碼行數:7,代碼來源:EmployeeAddress.cs

示例8: AddAddressType

 public void AddAddressType(AddressType type)
 {
     if (!this.IsAddressType(type))
     {
         this.addressTypes.Add(type);
     }
 }
開發者ID:sjdg,項目名稱:OrderExercise,代碼行數:7,代碼來源:Address.cs

示例9: Option

        internal Option(string displayName, int? addressId, AddressType? addressType, string postcode, OptionType optionType, Model.Link[] links)
        {
            if (string.IsNullOrWhiteSpace(displayName)) throw new ArgumentNullException("displayName");
            if (links == null) throw new ArgumentNullException("links");

            DisplayName = displayName;
            AddressId = addressId;
            AddressType = addressType;
            Postcode = postcode;
            OptionType = optionType;

            var newLinks = new List<Model.Link>();

            foreach (Model.Link link in links)
            {
                Model.Link newLink;

                switch (link.Rel)
                {
                    case "next":
                        newLink = new Link(link.Rel, link.Href);
                        break;
                    default:
                        newLink = link;
                        break;
                }

                newLinks.Add(newLink);
            }

            Links = newLinks.ToArray();
        }
開發者ID:Autoaddress-AA2,項目名稱:autoaddress2.0-sdk-net,代碼行數:32,代碼來源:Option.cs

示例10: Response

        internal Response(ReturnCode result,
                          string postcode,
                          int? addressId,
                          AddressType? addressType,
                          MatchLevel matchLevel,
                          string[] postalAddress,
                          AddressElement[] postalAddressElements,
                          string[] geographicAddress,
                          AddressElement[] geographicAddressElements,
                          string[] vanityAddress,
                          AddressElement[] vanityAddressElements,
                          ReformattedAddressResult? reformattedAddressResult,
                          string[] reformattedAddress,
                          int totalOptions,
                          Option[] options,
                          Request input,
                          Model.Link[] links
            )
        {
            if (links == null) throw new ArgumentNullException("links");

            Result = result;
            Postcode = postcode;
            AddressId = addressId;
            AddressType = addressType;
            MatchLevel = matchLevel;
            PostalAddress = postalAddress;
            PostalAddressElements = postalAddressElements;
            GeographicAddress = geographicAddress;
            GeographicAddressElements = geographicAddressElements;
            VanityAddress = vanityAddress;
            VanityAddressElements = vanityAddressElements;
            ReformattedAddressResult = reformattedAddressResult;
            ReformattedAddress = reformattedAddress;
            TotalOptions = totalOptions;
            Options = options;
            Input = input;

            var newLinks = new List<Model.Link>();

            foreach (Model.Link link in links)
            {
                Model.Link newLink;

                switch (link.Rel)
                {
                    case "self":
                        newLink = new Model.PostcodeLookup.Link(link.Rel, link.Href);
                        break;
                    default:
                        newLink = link;
                        break;
                }

                newLinks.Add(newLink);
            }

            Links = newLinks.ToArray();
        }
開發者ID:Autoaddress-AA2,項目名稱:autoaddress2.0-sdk-net,代碼行數:59,代碼來源:Response.cs

示例11: ParseAddressType_ReturnsCorrectString

        public void ParseAddressType_ReturnsCorrectString(AddressType addressType, string expected)
        {
            //act
            var result = EnumFactory.ParseAddressType(addressType);

            //assert
            result.Should().Be(expected);
        }
開發者ID:letmeproperty,項目名稱:Applications,代碼行數:8,代碼來源:EnumFactory_TestFixture.cs

示例12: EnumHelper_Parse_ReturnsCorrectEnum

        public void EnumHelper_Parse_ReturnsCorrectEnum(string value, AddressType addressType)
        {
            //act
            var result = EnumHelper<AddressType>.Parse(value);

            //assert
            result.Should().Be(addressType);
        }
開發者ID:letmeproperty,項目名稱:Applications,代碼行數:8,代碼來源:EnumHelper_TestFixture.cs

示例13: SocksRequest

 public SocksRequest(StreamTypes type, AddressType addrtype, string address, int port)
 {
     Type = addrtype;
     StreamType = type;
     Address = address;
     Port = port;
     Error = SocksError.Granted;
     IPAddress p = this.IP; //get Error on the stack.
 }
開發者ID:swsmile,項目名稱:Socks5,代碼行數:9,代碼來源:Socks.cs

示例14: SmsMessage

 internal SmsMessage(int index, SmsMessageStatus status, string senderPhoneNumber, 
     AddressType addrType, DateTime timestamp, string body)
 {
     this.Index = index;
     this.Status = status;
     this.Number = senderPhoneNumber;
     this.Timestamp = timestamp;
     this.AddressType = addrType;
     this.Body = body;
 }
開發者ID:Sureshvithani,項目名稱:Fona.net,代碼行數:10,代碼來源:SmsMessage.cs

示例15: Address

 public Address(byte[] data, AddressType type, Network network = null)
 {
     if (data.Length != ADDRESS_SIZE)
     {
         throw new ArgumentException("Invalid Address");
     }
     Data = data;
     Type = type;
     Network = (network ?? Network.Default);
 }
開發者ID:bitcoinkit,項目名稱:BitcoinKit-CSharp,代碼行數:10,代碼來源:Address.cs


注:本文中的AddressType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。