本文整理汇总了C#中Contact.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.GetHashCode方法的具体用法?C# Contact.GetHashCode怎么用?C# Contact.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact.GetHashCode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FormatJSONContact
private string FormatJSONContact(Contact con, string[] fields)
{
string contactFormatStr = "\"id\":\"{0}\"," +
"\"displayName\":\"{1}\"," +
"\"nickname\":\"{2}\"," +
"\"phoneNumbers\":[{3}]," +
"\"emails\":[{4}]," +
"\"addresses\":[{5}]," +
"\"urls\":[{6}]," +
"\"name\":{7}," +
"\"note\":\"{8}\"," +
"\"birthday\":\"{9}\"";
string jsonContact = String.Format(contactFormatStr,
con.GetHashCode(),
EscapeJson(con.DisplayName),
EscapeJson(con.CompleteName != null ? con.CompleteName.Nickname : ""),
FormatJSONPhoneNumbers(con),
FormatJSONEmails(con),
FormatJSONAddresses(con),
FormatJSONWebsites(con),
FormatJSONName(con),
EscapeJson(con.Notes.FirstOrDefault()),
EscapeJson(Convert.ToString(con.Birthdays.FirstOrDefault())));
return "{" + jsonContact + "}";
}
示例2: FormatJSONContact
private string FormatJSONContact(Contact con, string[] fields)
{
string contactFormatStr = "\"id\":\"{0}\"," +
"\"displayName\":\"{1}\"," +
"\"nickname\":\"{2}\"," +
"\"phoneNumbers\":[{3}]," +
"\"emails\":[{4}]," +
"\"addresses\":[{5}]," +
"\"urls\":[{6}]," +
"\"name\":{7}," +
"\"note\":\"{8}\"";
string jsonContact = String.Format(contactFormatStr,
con.GetHashCode(),
con.DisplayName,
con.CompleteName.Nickname,
FormatJSONPhoneNumbers(con),
FormatJSONEmails(con),
FormatJSONAddresses(con),
FormatJSONWebsites(con),
FormatJSONName(con),
con.Notes.FirstOrDefault());
Debug.WriteLine("jsonContact = " + jsonContact);
return "{" + jsonContact + "}";
}
示例3: FormatJSONContact
private string FormatJSONContact(Contact con, string[] fields)
{
string contactFormatStr = "\"id\":\"{0}\"," +
"\"displayName\":\"{1}\"," +
"\"nickname\":\"{2}\"," +
"\"phoneNumbers\":[{3}]," +
"\"emails\":[{4}]," +
"\"addresses\":[{5}]," +
"\"urls\":[{6}]," +
"\"name\":{7}," +
"\"note\":\"{8}\"," +
"\"birthday\":\"{9}\"";
string jsonContact = String.Format(contactFormatStr,
con.GetHashCode(),
con.DisplayName,
con.CompleteName != null ? con.CompleteName.Nickname : "",
FormatJSONPhoneNumbers(con),
FormatJSONEmails(con),
FormatJSONAddresses(con),
FormatJSONWebsites(con),
FormatJSONName(con),
con.Notes.FirstOrDefault(),
con.Birthdays.FirstOrDefault());
//Debug.WriteLine("jsonContact = " + jsonContact);
// JSON requires new line characters be escaped
return "{" + jsonContact.Replace("\n", "\\n") + "}";
}
示例4: FormatJSONContact
private string FormatJSONContact(Contact con, string[] fields)
{
string contactFormatStr = "\"id\":\"{0}\"," +
"\"displayName\":\"{1}\"," +
"\"nickname\":\"{2}\"," +
"\"phoneNumbers\":[{3}]," +
"\"emails\":[{4}]," +
"\"addresses\":[{5}]," +
"\"urls\":[{6}]";
string jsonContact = String.Format(contactFormatStr,
con.GetHashCode(),
con.DisplayName,
con.DisplayName,
FormatJSONPhoneNumbers(con),
FormatJSONEmails(con),
FormatJSONAddresses(con),
FormatJSONWebsites(con));
jsonContact = "{" + jsonContact + "}";
//Debug.WriteLine("jsonContact = " + jsonContact);
return jsonContact;
}