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


C# Contact.GetAddresses方法代码示例

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


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

示例1: ListProperties


//.........这里部分代码省略.........
     {
      Console.Write(";VIDEO");
     }
     if ((tPhone.Types & PhoneTypes.voip) == PhoneTypes.voip)
     {
      Console.Write(";VOIP");
     }
     Console.WriteLine("");
        }
        if (cContact.Organization != "")
        {
     Console.WriteLine("ORG=" + cContact.Organization);
        }
        if (cContact.WorkForceID != "")
        {
     Console.WriteLine("WORKFORCEID=" + cContact.WorkForceID);
        }
        if (cContact.ManagerID != "")
        {
     Console.WriteLine("MANAGERID=" + cContact.ManagerID);
        }
        if (cContact.Birthday != "")
        {
     Console.WriteLine("BDAY=" + cContact.Birthday);
        }
        if (cContact.Blog != "")
        {
     Console.WriteLine("BLOG=" + cContact.Blog);
        }
        if (cContact.Url != "")
        {
     Console.WriteLine("URL=" + cContact.Url);
        }
        IABList aList = cContact.GetAddresses();
        foreach(Address cAddress in aList)
        {
     Console.Write("ADR=(");
     if (cAddress.ID != "")
     {
      Console.Write("ID=" + cAddress.ID);
     }
     if (cAddress.Street != "")
     {
      Console.Write(";STREET=" + cAddress.Street);
     }
     if (cAddress.Locality != "")
     {
      Console.Write(";LOCALITY=" + cAddress.Locality);
     }
     if (cAddress.Region != "")
     {
      Console.Write(";REGION=" + cAddress.Region);
     }
     if (cAddress.PostalCode != "")
     {
      Console.Write(";PCODE=" + cAddress.PostalCode);
     }
     if (cAddress.PostalBox != "")
     {
      Console.Write(";PBOX=" + cAddress.PostalBox);
     }
     if (cAddress.Country != "")
     {
      Console.Write(";COUNTRY=" + cAddress.Country);
     }
     if (cAddress.Types != 0)
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:67,代码来源:AddressBookCmd.cs

示例2: DisplayContactDetails

 public void DisplayContactDetails(Contact c)
 {
     bool addBlank = false;
        ClearContactDetails();
        if(c != null)
        {
     Pixbuf cPhoto = GetScaledPhoto(c, 64);
     if(cPhoto != null)
      AddPicture(cPhoto);
     else
      AddPicture(BlankHeadPixBuf);
     if(c.FN != null)
     {
      AddTitles(c.FN, c.Title, null);
     }
     else
     {
      AddTitles(c.UserName, c.Title, null);
     }
     foreach(Telephone phone in c.GetTelephoneNumbers())
     {
      addBlank = true;
      if((phone.Types & PhoneTypes.home) == PhoneTypes.home)
      {
       AddLabeledValue("home", phone.Number);
      }
      if((phone.Types & PhoneTypes.work) == PhoneTypes.work)
      {
       AddLabeledValue("work", phone.Number);
      }
      if((phone.Types & PhoneTypes.other) == PhoneTypes.other)
      {
       AddLabeledValue("other", phone.Number);
      }
      if((phone.Types & PhoneTypes.cell) == PhoneTypes.cell)
      {
       AddLabeledValue("mobile", phone.Number);
      }
      if((phone.Types & PhoneTypes.pager) == PhoneTypes.pager)
      {
       AddLabeledValue("pager", phone.Number);
      }
      if((phone.Types & PhoneTypes.fax) == PhoneTypes.fax)
      {
       AddLabeledValue("fax", phone.Number);
      }
     }
     if(addBlank)
     {
      AddLabeledValue(null, null);
      addBlank = false;
     }
     foreach(Email e in c.GetEmailAddresses())
     {
      addBlank = true;
      if((e.Types & EmailTypes.personal) == EmailTypes.personal)
      {
       AddLabeledValue("home", e.Address);
      }
      if((e.Types & EmailTypes.work) == EmailTypes.work)
      {
       AddLabeledValue("work", e.Address);
      }
      if((e.Types & EmailTypes.other) == EmailTypes.other)
      {
       AddLabeledValue("other", e.Address);
      }
     }
     if(addBlank)
     {
      AddLabeledValue(null, null);
      addBlank = false;
     }
     foreach(IM im in c.GetInstantMessageAccounts())
     {
      addBlank = true;
      if((im.Types & IMTypes.home) == IMTypes.home)
      {
       AddLabeledValue("home",
     im.Address + " (" + im.Provider + ")");
      }
      if((im.Types & IMTypes.work) == IMTypes.work)
      {
       AddLabeledValue("work",
     im.Address + " (" + im.Provider + ")");
      }
      if((im.Types & IMTypes.other) == IMTypes.other)
      {
       AddLabeledValue("other",
     im.Address + " (" + im.Provider + ")");
      }
     }
     if(addBlank)
     {
      AddLabeledValue(null, null);
      addBlank = false;
     }
     foreach(Address addr in c.GetAddresses())
     {
      string addressLine = "";
//.........这里部分代码省略.........
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:101,代码来源:ContactBrowser.cs


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