本文整理汇总了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);
}
示例2: Address
public Address(string address1,string address2,string postCode,AddressType addressType)
{
this._address1 = address1;
this._address2 = address2;
this._postCode = postCode;
this._addressType = addressType;
}
示例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;
}
示例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;
}
示例5: AddressRange
public AddressRange(AddressType desc, Byte id, UInt32 low, UInt32 high)
{
this.PId = id;
this.PDesc = desc;
this.PLow = low;
this.PHigh = high;
}
示例6: SocksRequest
public SocksRequest(StreamTypes type, AddressType addrtype, string address, int port)
{
Type = addrtype;
StreamType = type;
Address = address;
Port = port;
}
示例7: EmployeeAddress
public EmployeeAddress(AddressType type, string streetAddress, string city, string state, string zip)
{
_type = type;
_streetAddress = streetAddress;
_city = city;
_zip = zip;
}
示例8: AddAddressType
public void AddAddressType(AddressType type)
{
if (!this.IsAddressType(type))
{
this.addressTypes.Add(type);
}
}
示例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();
}
示例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();
}
示例11: ParseAddressType_ReturnsCorrectString
public void ParseAddressType_ReturnsCorrectString(AddressType addressType, string expected)
{
//act
var result = EnumFactory.ParseAddressType(addressType);
//assert
result.Should().Be(expected);
}
示例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);
}
示例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.
}
示例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;
}
示例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);
}