本文整理汇总了C#中AddressType类的典型用法代码示例。如果您正苦于以下问题:C# AddressType类的具体用法?C# AddressType怎么用?C# AddressType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddressType类属于命名空间,在下文中一共展示了AddressType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Address
// constructor for loading an EXISTING Address - This constructor DOES NOT create a new GUID
public Address(Guid addressId, Guid personId, int streetNumber, string streetName, string addressCity, string addressState, string addressZip,
AddressType addressType)
{
_addressId = addressId;
_personId = personId;
_streetNumber = streetNumber;
_streetName = streetName;
_addressCity = addressCity;
_addressState = addressState;
_addressZip = addressZip;
_addressType = addressType;
}
开发者ID:sqlhammer,项目名称:CIS470-Devry-Senior-Project,代码行数:13,代码来源:Address.cs
示例17: MapCustomerAddressTypeToAddressType
public static IAddressType MapCustomerAddressTypeToAddressType(this AuthorizeNet.APICore.customerAddressType response)
{
var result = new AddressType();
result.AddressLine1 = response.address;
result.City = response.city;
result.Company = response.company;
result.Country = response.country;
result.PhoneNumber = response.phoneNumber;
result.PostalCode = response.zip;
result.State = response.state;
return result;
}
开发者ID:T2BE,项目名称:Common,代码行数:12,代码来源:AuthorizeNetGatewayExtensions.cs
示例18: SetAddress
public virtual void SetAddress(Address address, AddressType type)
{
if (address == null) return;
Addresses = Addresses ?? new HashSet<ClientAddress>();
var customerAddress = Addresses.FirstOrDefault(x => Equals(x.Address, address));
if (customerAddress == null)
{
customerAddress = new ClientAddress(this, address, type);
Addresses.Add(customerAddress);
}
customerAddress.Address = address;
}
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:13,代码来源:Client.cs
示例19: ToAddress
/// <summary>
/// Converts a braintree address to a <see cref="IAddress"/>.
/// </summary>
/// <param name="address">
/// The address.
/// </param>
/// <param name="addressType">
/// The address type.
/// </param>
/// <returns>
/// The <see cref="IAddress"/>.
/// </returns>
public static IAddress ToAddress(this global::Braintree.Address address, AddressType addressType)
{
return new Core.Models.Address()
{
Name = string.Format("{0} {1}", address.FirstName, address.LastName),
Address1 = address.StreetAddress,
Locality = address.Locality,
Region = address.Region,
PostalCode = address.PostalCode,
CountryCode = address.CountryCodeAlpha2,
AddressType = addressType
};
}
开发者ID:cmgrey83,项目名称:Merchello.Plugin.Payment.Braintree,代码行数:25,代码来源:MappingExtensions.cs
示例20: GetAddress
private Address GetAddress(int userId, AddressType type)
{
var address = _db.Addresses.FirstOrDefault(a => a.UserId == userId && a.AddressType == type);
if (address == null)
{
address = new Address
{
AddressType = type,
AddressId = 0,
UserId = userId,
};
}
return address;
}
开发者ID:arunghosh,项目名称:alumni-network,代码行数:14,代码来源:AddressController.cs
注:本文中的AddressType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论