public VCFElement() { this._Name = ""; this._Value = ""; this._Parameters = ""; this._charset = charset_types.def; this._encoding = encoding_types.def; }
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; }
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"); } }
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)); }