当前位置: 首页>>代码示例>>C#>>正文


C# Contact.GetNames方法代码示例

本文整理汇总了C#中Contact.GetNames方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.GetNames方法的具体用法?C# Contact.GetNames怎么用?C# Contact.GetNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contact的用法示例。


在下文中一共展示了Contact.GetNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ListProperties

 private void ListProperties(Contact cContact)
 {
     Console.WriteLine("ID=" + cContact.ID);
        Console.WriteLine("USERNAME=" + cContact.UserName);
        if (cContact.FN != "")
        {
     Console.WriteLine("FN=" + cContact.FN);
        }
        IABList nList = cContact.GetNames();
        foreach(Name cName in nList)
        {
     Console.Write("N=(");
     Console.Write("ID=" + cName.ID);
     if (cName.Prefix != "")
     {
      Console.Write(";Prefix=");
      Console.Write(cName.Prefix);
     }
     if (cName.Given != "")
     {
      Console.Write(";Given=");
      Console.Write(cName.Given);
     }
     if (cName.Other != "")
     {
      Console.Write(";Other=");
      Console.Write(cName.Other);
     }
     if (cName.Family != "")
     {
      Console.Write(";Family=");
      Console.Write(cName.Family);
     }
     if (cName.Suffix != "")
     {
      Console.Write(";Suffix=");
      Console.Write(cName.Suffix);
     }
     if (cName.Preferred == true)
     {
      Console.Write(";PREF");
     }
     Console.WriteLine(")");
        }
        if (cContact.Nickname != "")
        {
     Console.WriteLine("NICKNAME=" + cContact.Nickname);
        }
        if (cContact.Title != "")
        {
     Console.WriteLine("TITLE=" + cContact.Title);
        }
        if (cContact.Role != "")
        {
     Console.WriteLine("ROLE=" + cContact.Role);
        }
        IABList mList = cContact.GetEmailAddresses();
        foreach(Email tMail in mList)
        {
     Console.Write("EMAIL=" + tMail.Address);
     if (tMail.Preferred == true)
     {
      Console.Write(";PREF");
     }
     if ((tMail.Types & EmailTypes.work) == EmailTypes.work)
     {
      Console.Write(";WORK");
     }
     if ((tMail.Types & EmailTypes.personal) == EmailTypes.personal)
     {
      Console.Write(";PERSONAL");
     }
     if ((tMail.Types & EmailTypes.internet) == EmailTypes.internet)
     {
      Console.Write(";INTERNET");
     }
     if ((tMail.Types & EmailTypes.x400) == EmailTypes.x400)
     {
      Console.Write(";X.400");
     }
     Console.WriteLine("");
        }
        IABList tList = cContact.GetTelephoneNumbers();
        foreach(Telephone tPhone in tList)
        {
     Console.Write("TEL=" + tPhone.Number);
     if (tPhone.Preferred == true)
     {
      Console.Write(";PREF");
     }
     if ((tPhone.Types & PhoneTypes.home) == PhoneTypes.home)
     {
      Console.Write(";HOME");
     }
     if ((tPhone.Types & PhoneTypes.work) == PhoneTypes.work)
     {
      Console.Write(";WORK");
     }
     if ((tPhone.Types & PhoneTypes.other) == PhoneTypes.other)
     {
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:AddressBookCmd.cs


注:本文中的Contact.GetNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。