Пример #1
0
        public static string Serialize(VCard vcard)
        {
            if (vcard.Photo == null)
            {
                return(string.Empty);
            }

            var extension = vcard.Photo.Extension.Coalesce("jpg");
            var mimeType  = ImageMimeHelper.GetMimeType(extension);

            return(Base64StringProcessor.SerializeBase64String(vcard.Photo.Contents, "PHOTO", mimeType, vcard.Version));
        }
Пример #2
0
        public static string Serialize(VCard vcard)
        {
            if (string.IsNullOrWhiteSpace(vcard.Key))
            {
                return(string.Empty);
            }

            //The property "KEY" is valid only for VCardVersion 3.0 and above.
            if (vcard.Version == VCardVersion.V2_1)
            {
                return(string.Empty);
            }

            return(Base64StringProcessor.SerializeBase64String(vcard.Key, "KEY", string.Empty, vcard.Version));
        }
Пример #3
0
        public static string Serialize(VCard vcard)
        {
            if (string.IsNullOrWhiteSpace(vcard.Sound))
            {
                return(string.Empty);
            }

            //The property "SOUND" is valid only for VCardVersion 3.0 and above.
            if (vcard.Version == VCardVersion.V2_1)
            {
                return(string.Empty);
            }

            return(Base64StringProcessor.SerializeBase64String(vcard.Sound, "SOUND", "BASIC", vcard.Version));
        }