Example #1
0
 private Abstractions.InstantMessagingAccount Convert(ContactConnectedServiceAccount contactIM)
 {
     Abstractions.InstantMessagingAccount im = new Abstractions.InstantMessagingAccount();
     im.Account      = contactIM.Id;
     im.ServiceLabel = contactIM.ServiceName;
     return(im);
 }
    internal static InstantMessagingAccount GetImAccount(ICursor c, Resources resources)
    {
      InstantMessagingAccount ima = new InstantMessagingAccount();
      ima.Account = c.GetString(CommonColumns.Data);

      //IMTypeDataKind imKind = (IMTypeDataKind) c.GetInt (c.GetColumnIndex (CommonColumns.Type));
      //ima.Type = imKind.ToInstantMessagingType();
      //ima.Label = InstantMessaging.GetTypeLabel (resources, imKind, c.GetString (CommonColumns.Label));

      IMProtocolDataKind serviceKind = (IMProtocolDataKind)c.GetInt(c.GetColumnIndex(InstantMessaging.Protocol));
      ima.Service = serviceKind.ToInstantMessagingService();
      ima.ServiceLabel = (serviceKind != IMProtocolDataKind.Custom)
                ? InstantMessaging.GetProtocolLabel(resources, serviceKind, String.Empty)
                : c.GetString(InstantMessaging.CustomProtocol);

      return ima;
    }