当前位置: 首页>>代码示例>>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;未经允许,请勿转载。