/// <summary> /// Модификация от 10 июня 2015 года /// Заложен от 10 июня 2015 года /// </summary> /// <param name="pp"></param> /// <returns></returns> private string GetAttro(gmAttro pp) { string reto = string.Empty; if (null != datro) { if (datro.ContainsKey(pp)) { reto = datro[pp]; } } return(reto); }
/// <summary> /// Модификация от 29 сентября 2015 года /// Заложен 29 сентября 2015 года /// </summary> /// <param name="pp"></param> /// <param name="valo"></param> private void SetAttro(gmAttro pp, string valo) { if (null != datro) { if (datro.ContainsKey(pp)) { datro[pp] = valo; } else { datro.Add(pp, valo); } } }
static public Dictionary <gmAttro, string> CreateDictoAttribute(List <string> aa) { Dictionary <gmAttro, string> reto = null; if (aa != null) { string vnutr = @"\[(.*)\s""(.*)""\]"; reto = new Dictionary <gmAttro, string>(); foreach (string bb in aa) { Match m1 = Regex.Match(bb, vnutr); if (m1.Groups.Count > 2) { string b1 = m1.Groups[1].Value; string b2 = m1.Groups[2].Value; gmAttro tatr = (gmAttro)Enum.Parse(typeof(gmAttro), b1); reto.Add(tatr, b2); } } } return(reto); }
/// <summary> /// Модификация от 29 сентября 2015 года /// Заложен 29 сентября 2015 года /// </summary> /// <param name="pcommon">Словарь с предустановленными фиксированными значениями</param> /// <returns>Истина - если всё чисто</returns> public bool FillDictoAttribute(Dictionary <gmAttro, string> pcommon) { bool reto = true; if (pgatr != null) { string vnutr = @"\[(.*)\s""(.*)""\]"; intellectoattr = gmKorrAtr.AllOK; datro = new Dictionary <gmAttro, string>(); foreach (string bb in pgatr) { Match m1 = Regex.Match(bb, vnutr); if (m1.Groups.Count > 2) { string b1 = m1.Groups[1].Value; string b2 = m1.Groups[2].Value; gmAttro tatr = (gmAttro)Enum.Parse(typeof(gmAttro), b1); if (pcommon.Keys.Contains(tatr)) { b2 = pcommon[tatr]; } //Попытка разрешить известные проблемы if (b2.Contains("?")) { if (tatr == gmAttro.EventDate) //Будем брать дату по партиям их этого тура { intellectoattr = gmKorrAtr.EventDateHasAnswer; reto = false; } } datro.Add(tatr, b2); } } } return(reto); }
/// <summary> /// Модификация от 10 июня 2015 года /// Заложен от 10 июня 2015 года /// </summary> /// <param name="pp"></param> /// <returns></returns> private string GetAttro( gmAttro pp ) { string reto = string.Empty; if (null != datro) { if (datro.ContainsKey(pp)) { reto = datro[pp]; } } return reto; }