Ejemplo n.º 1
0
        internal static EmailType ToEmailType(this EmailDataKind emailKind)
        {
            switch (emailKind)
            {
            case EmailDataKind.Home:
                return(EmailType.Home);

            case EmailDataKind.Work:
                return(EmailType.Work);

            default:
                return(EmailType.Other);
            }
        }
Ejemplo n.º 2
0
        internal static Email GetEmail(ICursor c, Resources resources)
        {
            Email e = new Email();

            e.Address = c.GetString(ContactsContract.DataColumns.Data1);

            EmailDataKind ekind = (EmailDataKind)c.GetInt(c.GetColumnIndex(CommonColumns.Type));

            e.Type  = ekind.ToEmailType();
            e.Label = (ekind != EmailDataKind.Custom)
            ? ContactsContract.CommonDataKinds.Email.GetTypeLabel(resources, ekind, String.Empty)
            : c.GetString(CommonColumns.Label);

            return(e);
        }