public clsProfile(clsJSON block) { foreach (string[] strArray in block.data) { strArray[0] = strArray[0].ToLower(); if (strArray[0].CompareTo("profile_id") == 0) this.id = this.StringToInt64(strArray[1]); if (strArray[0].CompareTo("url") == 0) this.url = strArray[1]; if (strArray[0].CompareTo("url_private_message") == 0) this.url_private_message = strArray[1]; if (strArray[0].CompareTo("avatar") == 0) this.url_avatar = strArray[1]; if (strArray[0].CompareTo("is_freelancer") == 0) this.is_freelancer = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_employer") == 0) this.is_employer = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("login") == 0) this.login = strArray[1]; if (strArray[0].CompareTo("fname") == 0) this.fname = strArray[1]; if (strArray[0].CompareTo("sname") == 0) this.sname = strArray[1]; if (strArray[0].CompareTo("birth_date") == 0) this.birth_date = clsTimeConvert.dtFrom8061(strArray[1]); if (strArray[0].CompareTo("rating") == 0) this.rating = this.StringToInt64(strArray[1]); if (strArray[0].CompareTo("rating_position") == 0) this.rating_position = this.StringToInt64(strArray[1]); if (strArray[0].CompareTo("country_name_ru") == 0) this.country_name_ru = strArray[1]; if (strArray[0].CompareTo("city_name_ru") == 0) this.city_name_ru = strArray[1]; if (strArray[0].CompareTo("creation_date") == 0) this.creation_date = clsTimeConvert.dtFrom8061(strArray[1]); if (strArray[0].CompareTo("positive_reviews") == 0) this.positive_reviews = this.StringToInt(strArray[1]); if (strArray[0].CompareTo("negative_reviews") == 0) this.negative_reviews = this.StringToInt(strArray[1]); if (strArray[0].CompareTo("is_phone_verified") == 0) this.is_phone_verifie = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_fname_verified") == 0) this.is_fname_verified = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_birth_date_verified") == 0) this.is_birth_date_verified = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_wmid_verified") == 0) this.is_wmid_verified = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_okpay_verified") == 0) this.is_okpay_verified = this.StringToBool(strArray[1]); if (strArray[0].CompareTo("is_email_verified") == 0) this.is_email_verified = this.StringToBool(strArray[1]); } }
public clsMessDialog(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; string[] strTo = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; have_attach = false; url_Attachments = new List <string>(); #region обработка данных класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("message_html") == 0) { this.message_html = line[1]; } if (line[0].ToLower().CompareTo("message_text") == 0) { this.message_text = line[1]; } if (line[0].ToLower().CompareTo("post_time") == 0) { this.post_time = DateTime.Parse(line[1]);//clsTimeConvert.dtFrom8061(line[1]); } if (line[0].ToLower().CompareTo("attachments") == 0) { have_attach = true; } if (line[0].ToLower().CompareTo("url") == 0) { if (have_attach) { string turl = line[1]; string s = "//content.freelancehunt.com/message/"; if (turl.Remove(s.Length) == s) { turl = "https:" + turl; url_Attachments.Add(turl); } } else { this.url = line[1]; } } } #endregion #region приложения /* * if (json.block.attachments != null) * { * clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("attachments") == 0); * * if (block != null) * { * this.url_Attachments = new List<string>(); * foreach (string[] param in block.data) * { * if (param[0].ToLower().CompareTo("url") == 0) { this.url_Attachments.Add("https:" + param[1]); } * } * } * } */ #endregion #region от кого if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) { strFrom[0] = line[1]; } if (line[0].ToLower().CompareTo("login") == 0) { strFrom[1] = line[1]; } if (line[0].ToLower().CompareTo("url") == 0) { strFrom[2] = line[1]; } if (line[0].ToLower().CompareTo("avatar") == 0) { strFrom[3] = line[1]; } if (line[0].ToLower().CompareTo("fname") == 0) { strFrom[4] = line[1]; } if (line[0].ToLower().CompareTo("sname") == 0) { strFrom[5] = line[1]; } } } } this.from = new clsFrom(strFrom); #endregion #region кому if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("to") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) { strTo[0] = line[1]; } if (line[0].ToLower().CompareTo("login") == 0) { strTo[1] = line[1]; } if (line[0].ToLower().CompareTo("url") == 0) { strTo[2] = line[1]; } if (line[0].ToLower().CompareTo("avatar") == 0) { strTo[3] = line[1]; } if (line[0].ToLower().CompareTo("fname") == 0) { strFrom[4] = line[1]; } if (line[0].ToLower().CompareTo("sname") == 0) { strFrom[5] = line[1]; } } } } this.to = new clsFrom(strTo); #endregion }
public clsMessage(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; #region данные класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("url") == 0) { this.url = line[1]; } if (line[0].ToLower().CompareTo("url_api") == 0) { this.url_api = line[1]; } if (line[0].ToLower().CompareTo("subject") == 0) { this.subject = line[1]; } if (line[0].ToLower().CompareTo("has_attach") == 0) { int _i = 0; if (int.TryParse(line[1], out _i)) { this.attachCount = _i; } } if (line[0].ToLower().CompareTo("last_post_time") == 0) { this.last_post_time = DateTime.Parse(line[1]); //clsTimeConvert.dtFrom8061(line[1]); } if (line[0].ToLower().CompareTo("post_time") == 0) { this.post_time = DateTime.Parse(line[1]);//clsTimeConvert.dtFrom8061(line[1]); } if (line[0].ToLower().CompareTo("unread_count") == 0) { int _i = 0; if (int.TryParse(line[1], out _i)) { this.unread_count = _i; } } if (line[0].ToLower().CompareTo("is_unread") == 0) { string cs = "true"; if (line[1].Equals(cs)) { is_unread = true; } else { is_unread = false; } } } #endregion #region от кого if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) { strFrom[0] = line[1]; } if (line[0].ToLower().CompareTo("login") == 0) { strFrom[1] = line[1]; } if (line[0].ToLower().CompareTo("url") == 0) { strFrom[2] = line[1]; } if (line[0].ToLower().CompareTo("avatar") == 0) { strFrom[3] = line[1]; } if (line[0].ToLower().CompareTo("fname") == 0) { strFrom[4] = line[1]; } if (line[0].ToLower().CompareTo("sname") == 0) { strFrom[5] = line[1]; } } } } this.from = new clsFrom(strFrom); #endregion }
public clsProject(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; #region обработка данных для этого класса foreach (string[] param in json.data) { if (param[0].ToLower().CompareTo("project_id") == 0) { Int64 _i = 0; if (Int64.TryParse(param[1], out _i)) { this.id = _i; } } if (param[0].ToLower().CompareTo("name") == 0) { this.name = param[1]; } if (param[0].ToLower().CompareTo("url") == 0) { this.url = param[1]; } if (param[0].ToLower().CompareTo("url_api") == 0) { this.url_api = param[1]; } if (param[0].ToLower().CompareTo("description") == 0) { //this.description = param[1].Replace("rn", "\r\n"); this.description = param[1].Replace("\r\n", "\n"); string n = "null"; if (this.description.Trim().Equals(n)) { this.description = ""; } } if (param[0].ToLower().CompareTo("description_html") == 0) { this.description_html = param[1].Replace("\r\n", "\n"); string n = "null"; if (this.description_html.Trim().Equals(n)) { this.description_html = ""; } } if (param[0].ToLower().CompareTo("description_text") == 0) { //this.description_text = param[1].Replace("rn", "\r\n"); this.description_text = param[1].Replace("\r\n", "\n"); string n = "null"; if (this.description_text.Trim().Equals(n)) { this.description_text = ""; } } if (param[0].ToLower().CompareTo("budget_amount") == 0) { this.budget_amount = param[1]; } if (param[0].ToLower().CompareTo("budget_currency_code") == 0) { this.budget_currency_code = param[1]; } if (param[0].ToLower().CompareTo("status_id") == 0) { int _i = 0; if (int.TryParse(param[1], out _i)) { this.status_id = _i; } } if (param[0].ToLower().CompareTo("status_name") == 0) { this.status_name = param[1]; } if (param[0].ToLower().CompareTo("bid_count") == 0) { int _i = 0; if (int.TryParse(param[1], out _i)) { this.bid_count = _i; } } if (param[0].ToLower().CompareTo("start_time") == 0) { this.start_time = param[1]; } if (param[0].ToLower().CompareTo("publication_time") == 0) { this.publication_time = param[1]; } if (param[0].ToLower().CompareTo("expire_time") == 0) { this.expire_time = param[1]; } if (param[0].ToLower().CompareTo("is_job") == 0) { this.is_job = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } if (param[0].ToLower().CompareTo("is_featured") == 0) { this.is_featured = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } if (param[0].ToLower().CompareTo("is_identity_verified") == 0) { this.is_identity_verified = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } if (param[0].ToLower().CompareTo("is_safe_project") == 0) { this.is_safe_project = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } if (param[0].ToLower().CompareTo("is_bid_added") == 0) { this.is_bid_added = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } } #endregion #region skills if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("skills") == 0); if (block != null) { this.skills = new Dictionary <int, string>(); foreach (string[] param in block.data) { int _i = 0; if (!int.TryParse(param[0], out _i)) { continue; } this.skills.Add(_i, param[1]); } } } #endregion #region from if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] param in block.data) { if (param[0].ToLower().CompareTo("profile_id") == 0) { strFrom[0] = param[1]; } if (param[0].ToLower().CompareTo("login") == 0) { strFrom[1] = param[1]; } if (param[0].ToLower().CompareTo("url") == 0) { strFrom[2] = param[1]; } if (param[0].ToLower().CompareTo("avatar") == 0) { strFrom[3] = param[1]; } if (param[0].ToLower().CompareTo("fname") == 0) { strFrom[4] = param[1]; } if (param[0].ToLower().CompareTo("sname") == 0) { strFrom[5] = param[1]; } } } } #endregion this.from = new clsFrom(strFrom); }
public clsProfile(clsJSON block) { foreach (string[] strArray in block.data) { strArray[0] = strArray[0].ToLower(); if (strArray[0].CompareTo("profile_id") == 0) { this.id = this.StringToInt64(strArray[1]); } if (strArray[0].CompareTo("url") == 0) { this.url = strArray[1]; } if (strArray[0].CompareTo("url_private_message") == 0) { this.url_private_message = strArray[1]; } if (strArray[0].CompareTo("avatar") == 0) { this.url_avatar = strArray[1]; } if (strArray[0].CompareTo("is_freelancer") == 0) { this.is_freelancer = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_employer") == 0) { this.is_employer = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("login") == 0) { this.login = strArray[1]; } if (strArray[0].CompareTo("fname") == 0) { this.fname = strArray[1]; } if (strArray[0].CompareTo("sname") == 0) { this.sname = strArray[1]; } if (strArray[0].CompareTo("birth_date") == 0) { this.birth_date = clsTimeConvert.dtFrom8061(strArray[1]); } if (strArray[0].CompareTo("rating") == 0) { this.rating = this.StringToInt64(strArray[1]); } if (strArray[0].CompareTo("rating_position") == 0) { this.rating_position = this.StringToInt64(strArray[1]); } if (strArray[0].CompareTo("country_name_ru") == 0) { this.country_name_ru = strArray[1]; } if (strArray[0].CompareTo("city_name_ru") == 0) { this.city_name_ru = strArray[1]; } if (strArray[0].CompareTo("creation_date") == 0) { this.creation_date = clsTimeConvert.dtFrom8061(strArray[1]); } if (strArray[0].CompareTo("positive_reviews") == 0) { this.positive_reviews = this.StringToInt(strArray[1]); } if (strArray[0].CompareTo("negative_reviews") == 0) { this.negative_reviews = this.StringToInt(strArray[1]); } if (strArray[0].CompareTo("is_phone_verified") == 0) { this.is_phone_verifie = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_fname_verified") == 0) { this.is_fname_verified = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_birth_date_verified") == 0) { this.is_birth_date_verified = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_wmid_verified") == 0) { this.is_wmid_verified = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_okpay_verified") == 0) { this.is_okpay_verified = this.StringToBool(strArray[1]); } if (strArray[0].CompareTo("is_email_verified") == 0) { this.is_email_verified = this.StringToBool(strArray[1]); } } }
public clsMessage(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; #region данные класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("url") == 0) this.url = line[1]; if (line[0].ToLower().CompareTo("url_api") == 0) this.url_api = line[1]; if (line[0].ToLower().CompareTo("subject") == 0) this.subject = line[1]; if (line[0].ToLower().CompareTo("has_attach") == 0) { int _i = 0; if (int.TryParse(line[1], out _i)) this.attachCount = _i; } if (line[0].ToLower().CompareTo("last_post_time") == 0) this.last_post_time = DateTime.Parse(line[1]); //clsTimeConvert.dtFrom8061(line[1]); if (line[0].ToLower().CompareTo("post_time") == 0) this.post_time = DateTime.Parse(line[1]);//clsTimeConvert.dtFrom8061(line[1]); if (line[0].ToLower().CompareTo("unread_count") == 0) { int _i = 0; if (int.TryParse(line[1], out _i)) this.unread_count = _i; } if (line[0].ToLower().CompareTo("is_unread") == 0) { string cs = "true"; if (line[1].Equals(cs)) { is_unread = true; } else { is_unread = false; } } } #endregion #region от кого if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) strFrom[0] = line[1]; if (line[0].ToLower().CompareTo("login") == 0) strFrom[1] = line[1]; if (line[0].ToLower().CompareTo("url") == 0) strFrom[2] = line[1]; if (line[0].ToLower().CompareTo("avatar") == 0) strFrom[3] = line[1]; if (line[0].ToLower().CompareTo("fname") == 0) strFrom[4] = line[1]; if (line[0].ToLower().CompareTo("sname") == 0) strFrom[5] = line[1]; } } } this.from = new clsFrom(strFrom); #endregion }
public clsFeed(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; #region обработка данных для этого класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("time") == 0) { this.date = clsTimeConvert.dtFrom8061(line[1]); } if (line[0].ToLower().CompareTo("message") == 0) { this.message = line[1]; mesDivider(this.message); } if (line[0].ToLower().CompareTo("is_new") == 0) { this.is_new = line[1].ToLower().CompareTo("true") == 0; } if (line[0].ToLower().CompareTo("time_millis") == 0) { if (!line[1].Contains("message")) { Int64 date = 0; if (Int64.TryParse(line[1], out date)) { time_millis = date; } } else { Int64 date = 0; if (Int64.TryParse(line[1].Split('m')[0], out date)) { time_millis = date; } String ms = line[1].Split(':')[1]; if (String.IsNullOrEmpty(this.message)) { this.message = ms; mesDivider(this.message); } } } } #endregion #region от кого clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) { strFrom[0] = line[1]; } if (line[0].ToLower().CompareTo("login") == 0) { strFrom[1] = line[1]; } if (line[0].ToLower().CompareTo("url") == 0) { strFrom[2] = line[1]; } if (line[0].ToLower().CompareTo("avatar") == 0) { strFrom[3] = line[1]; } if (line[0].ToLower().CompareTo("fname") == 0) { strFrom[4] = line[1]; } if (line[0].ToLower().CompareTo("sname") == 0) { strFrom[5] = line[1]; } } } this.from = new clsFrom(strFrom); #endregion }
public clsProject(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty }; #region обработка данных для этого класса foreach (string[] param in json.data) { if (param[0].ToLower().CompareTo("project_id") == 0) { Int64 _i = 0; if (Int64.TryParse(param[1], out _i)) this.id = _i; } if (param[0].ToLower().CompareTo("name") == 0) this.name = param[1]; if (param[0].ToLower().CompareTo("url") == 0) this.url = param[1]; if (param[0].ToLower().CompareTo("url_api") == 0) this.url_api = param[1]; if (param[0].ToLower().CompareTo("description") == 0) { //this.description = param[1].Replace("rn", "\r\n"); this.description = param[1].Replace("\r\n","\n"); string n = "null"; if (this.description.Trim().Equals(n)) { this.description = ""; } } if (param[0].ToLower().CompareTo("description_html") == 0) { this.description_html = param[1].Replace("\r\n", "\n"); string n = "null"; if (this.description_html.Trim().Equals(n)) { this.description_html = ""; } } if (param[0].ToLower().CompareTo("description_text") == 0) { //this.description_text = param[1].Replace("rn", "\r\n"); this.description_text = param[1].Replace("\r\n", "\n"); string n = "null"; if (this.description_text.Trim().Equals(n)) { this.description_text = ""; } } if (param[0].ToLower().CompareTo("budget_amount") == 0) this.budget_amount = param[1]; if (param[0].ToLower().CompareTo("budget_currency_code") == 0) this.budget_currency_code = param[1]; if (param[0].ToLower().CompareTo("status_id") == 0) { int _i = 0; if (int.TryParse(param[1], out _i)) this.status_id = _i; } if (param[0].ToLower().CompareTo("status_name") == 0) this.status_name = param[1]; if (param[0].ToLower().CompareTo("bid_count") == 0) { int _i = 0; if (int.TryParse(param[1], out _i)) this.bid_count = _i; } if (param[0].ToLower().CompareTo("start_time") == 0) this.start_time = param[1]; if (param[0].ToLower().CompareTo("publication_time") == 0) this.publication_time = param[1]; if (param[0].ToLower().CompareTo("expire_time") == 0) this.expire_time = param[1]; if (param[0].ToLower().CompareTo("is_job") == 0) this.is_job = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; if (param[0].ToLower().CompareTo("is_featured") == 0) this.is_featured = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; if (param[0].ToLower().CompareTo("is_identity_verified") == 0) this.is_identity_verified = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; if (param[0].ToLower().CompareTo("is_safe_project") == 0) this.is_safe_project = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; if (param[0].ToLower().CompareTo("is_bid_added") == 0) this.is_bid_added = param[1].CompareTo("1") == 0 || param[1].ToLower().CompareTo("true") == 0; } #endregion #region skills if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("skills") == 0); if (block != null) { this.skills = new Dictionary<int, string>(); foreach (string[] param in block.data) { int _i = 0; if (!int.TryParse(param[0], out _i)) continue; this.skills.Add(_i, param[1]); } } } #endregion #region from if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] param in block.data) { if (param[0].ToLower().CompareTo("profile_id") == 0) strFrom[0] = param[1]; if (param[0].ToLower().CompareTo("login") == 0) strFrom[1] = param[1]; if (param[0].ToLower().CompareTo("url") == 0) strFrom[2] = param[1]; if (param[0].ToLower().CompareTo("avatar") == 0) strFrom[3] = param[1]; if (param[0].ToLower().CompareTo("fname") == 0) strFrom[4] = param[1]; if (param[0].ToLower().CompareTo("sname") == 0) strFrom[5] = param[1]; } } } #endregion this.from = new clsFrom(strFrom); }
public clsFeed(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; #region обработка данных для этого класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("time") == 0) this.date = clsTimeConvert.dtFrom8061(line[1]); if (line[0].ToLower().CompareTo("message") == 0) { this.message = line[1]; mesDivider(this.message); } if (line[0].ToLower().CompareTo("is_new") == 0) this.is_new = line[1].ToLower().CompareTo("true") == 0; if (line[0].ToLower().CompareTo("time_millis") == 0) { if (!line[1].Contains("message")) { Int64 date = 0; if (Int64.TryParse(line[1], out date)) { time_millis = date; } } else { Int64 date = 0; if (Int64.TryParse(line[1].Split('m')[0], out date)) { time_millis = date; } String ms = line[1].Split(':')[1]; if (String.IsNullOrEmpty(this.message)) { this.message = ms; mesDivider(this.message); } } } } #endregion #region от кого clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) strFrom[0] = line[1]; if (line[0].ToLower().CompareTo("login") == 0) strFrom[1] = line[1]; if (line[0].ToLower().CompareTo("url") == 0) strFrom[2] = line[1]; if (line[0].ToLower().CompareTo("avatar") == 0) strFrom[3] = line[1]; if (line[0].ToLower().CompareTo("fname") == 0) strFrom[4] = line[1]; if (line[0].ToLower().CompareTo("sname") == 0) strFrom[5] = line[1]; } } this.from = new clsFrom(strFrom); #endregion }
public clsMessDialog(clsJSON json) { string[] strFrom = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; string[] strTo = new string[] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, }; have_attach = false; url_Attachments = new List<string>(); #region обработка данных класса foreach (string[] line in json.data) { if (line[0].ToLower().CompareTo("message_html") == 0) this.message_html = line[1]; if (line[0].ToLower().CompareTo("message_text") == 0) this.message_text = line[1]; if (line[0].ToLower().CompareTo("post_time") == 0) this.post_time = DateTime.Parse(line[1]);//clsTimeConvert.dtFrom8061(line[1]); if (line[0].ToLower().CompareTo("attachments") == 0) have_attach = true; if (line[0].ToLower().CompareTo("url") == 0) if (have_attach) { string turl = line[1]; string s = "//content.freelancehunt.com/message/"; if (turl.Remove(s.Length) == s) { turl = "https:" + turl; url_Attachments.Add(turl); } } else { this.url = line[1]; } } #endregion #region приложения /* if (json.block.attachments != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("attachments") == 0); if (block != null) { this.url_Attachments = new List<string>(); foreach (string[] param in block.data) { if (param[0].ToLower().CompareTo("url") == 0) { this.url_Attachments.Add("https:" + param[1]); } } } } */ #endregion #region от кого if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("from") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) strFrom[0] = line[1]; if (line[0].ToLower().CompareTo("login") == 0) strFrom[1] = line[1]; if (line[0].ToLower().CompareTo("url") == 0) strFrom[2] = line[1]; if (line[0].ToLower().CompareTo("avatar") == 0) strFrom[3] = line[1]; if (line[0].ToLower().CompareTo("fname") == 0) strFrom[4] = line[1]; if (line[0].ToLower().CompareTo("sname") == 0) strFrom[5] = line[1]; } } } this.from = new clsFrom(strFrom); #endregion #region кому if (json.bloks != null) { clsJSON_block block = json.bloks.FirstOrDefault(b => b.name.ToLower().CompareTo("to") == 0); if (block != null) { foreach (string[] line in block.data) { if (line[0].ToLower().CompareTo("profile_id") == 0) strTo[0] = line[1]; if (line[0].ToLower().CompareTo("login") == 0) strTo[1] = line[1]; if (line[0].ToLower().CompareTo("url") == 0) strTo[2] = line[1]; if (line[0].ToLower().CompareTo("avatar") == 0) strTo[3] = line[1]; if (line[0].ToLower().CompareTo("fname") == 0) strFrom[4] = line[1]; if (line[0].ToLower().CompareTo("sname") == 0) strFrom[5] = line[1]; } } } this.to = new clsFrom(strTo); #endregion }