Esempio n. 1
0
 public VCFElement()
 {
     this._Name       = "";
     this._Value      = "";
     this._Parameters = "";
     this._charset    = charset_types.def;
     this._encoding   = encoding_types.def;
 }
Esempio n. 2
0
        private void ProcessValue(string value)
        {
            if (!(IsTheStringAscii(value)))
            {
                this._charset  = charset_types.utf_8;
                this._encoding = encoding_types.qp;
            }
            else
            {
                this._charset  = charset_types.def;
                this._encoding = encoding_types.def;
            }

            this._Value = value;
        }
Esempio n. 3
0
        public void UppdateInfo(string value)
        {
            if (CheckForRightness(value))
            {
                this._Name       = "";
                this._Value      = "";
                this._Parameters = "";
                this._charset    = charset_types.def;
                this._encoding   = encoding_types.def;

                value = value.Replace("\n", "");
                ProcessString(value);
            }
            else
            {
                throw new Exception("There is an no name element! This cannot be added");
            }
        }
Esempio n. 4
0
        private string CheckKeyForParameters(string value)
        {
            string[] stringList;
            string[] paramStringList;
            string   teStr;

            stringList = value.Split(';');
            if (stringList.Length > 1)
            {
                paramStringList = new string[stringList.Length - 1];
                Array.Copy(stringList, 1, paramStringList, 0, stringList.Length - 1);
                this._Parameters = string.Join(";", paramStringList);

                if (stringList[0].ToUpper().Contains("PHOTO"))
                {
                    Array.Copy(stringList, 1, paramStringList, 0, stringList.Length - 1);
                    this._Parameters = string.Join(";", paramStringList);
                    return(stringList[0]);
                }

                teStr = Array.Find(stringList, s => s.ToUpper().Contains("CHARSET"));
                if (teStr != null)
                {
                    if (teStr.ToUpper().Contains("UTF-8"))
                    {
                        this._charset = charset_types.utf_8;
                    }
                    stringList = stringList.Where(val => !(val.ToUpper().Contains("CHARSET"))).ToArray();
                }

                teStr = Array.Find(stringList, s => s.ToUpper().Contains("ENCODING"));
                if (teStr != null)
                {
                    if (teStr.ToUpper().Contains("QUOTED-PRINTABLE"))
                    {
                        this._encoding = encoding_types.qp;
                    }
                    stringList = stringList.Where(val => !(val.ToUpper().Contains("ENCODING"))).ToArray();
                }
            }
            return(string.Join(";", stringList));
        }