internal static InstantMessagingService ToInstantMessagingService(this IMProtocolDataKind protocolKind) { switch (protocolKind) { case IMProtocolDataKind.Aim: return(InstantMessagingService.Aim); case IMProtocolDataKind.Msn: return(InstantMessagingService.Msn); case IMProtocolDataKind.Yahoo: return(InstantMessagingService.Yahoo); case IMProtocolDataKind.Jabber: return(InstantMessagingService.Jabber); case IMProtocolDataKind.Icq: return(InstantMessagingService.Icq); case IMProtocolDataKind.Skype: return(InstantMessagingService.Skype); case IMProtocolDataKind.GoogleTalk: return(InstantMessagingService.Google); case IMProtocolDataKind.Qq: return(InstantMessagingService.QQ); default: return(InstantMessagingService.Other); } }
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); }