public static void _LINK(List <Group> Groups, ref int i, ref string line) { string temp = Additional_functions.ClearLine(ref i, line); try { string[] links = temp.Split('&'); int k = 0; Link L = new Link(); foreach (var l in links) { L.Add( Additional_functions.Trim(l, ref k, '{', '}'), Additional_functions.Trim(l, ref k, '{', '}'), Convert.ToInt32(Additional_functions.Trim(l, ref k, '[', ']')) ); k = 0; } Groups[Groups.Count - 1].Links.Add(L); } catch { Stored_Exceptions.Add(new Exception("Error: Link exception, in Group " + Groups.Count)); } }
public static void _SCALE(List <Scale> _Scales, ref int i, ref string line) { try{ string temp = ""; for (; i < line.Length && line[i] != ']'; i++) { temp += line[i]; } for (; i < line.Length && line[i] != '<'; i++) { temp += line[i]; } temp = temp.Trim(); int k = 0; Scale scale = new Scale( Additional_functions.Trim(temp, ref k, '[', ']').Replace('\n', ' ').Replace('\r', ' ').Replace(" ", ""), Additional_functions.Trim(temp, ref k, '(', ')'), Additional_functions.ClearLine(ref i, line) ); _Scales.Add(scale); } catch { Stored_Exceptions.Add(new Exception("Error: _Scales exception, Scale number " + _Scales.Count + 1)); } }
public static void _FUZZY_SETS(List <Fuzzy_sets> _Fuzzy_sets, ref int i, ref string line) { Fuzzy_sets F_s = new Fuzzy_sets { Name = (Additional_functions.Trim(line, ref i, '(', ')')).Trim() }; string temp = Additional_functions.ClearLine(ref i, line).Replace('\n', ' ').Replace('\r', ' ').Replace(" ", ""); try{ string[] Functions = temp.Split(','); int k = 0; foreach (var f in Functions) { F_s.Functions.Add(new Trapeze( Additional_functions.ToLine(Additional_functions.Trim(f, ref k, '[', ']'), Additional_functions.Trim(f, ref k, '[', ']')), Additional_functions.ToLine(Additional_functions.Trim(f, ref k, '[', ']'), Additional_functions.Trim(f, ref k, '[', ']')) )); k = 0; } _Fuzzy_sets.Add(F_s); } catch { Stored_Exceptions.Add(new Exception("Error: _Fuzzy_sets exception, fuzzy sets number " + _Fuzzy_sets.Count + 1)); } }
public static void Loading_settings() { StreamReader sr; using (sr = new StreamReader(@"Resources\\setting.txt")) { string line; while ((line = sr.ReadLine()) != null) { int i; string key = ""; for (i = 0; i < line.Length && line[i] != ' '; i++) { key += line[i]; } switch (key) { case _location_tests: { key = Additional_functions.ClearLine(ref i, line); tests_path = $"..\\..\\{key}"; break; } case _database: { key = Additional_functions.ClearLine(ref i, line); database_path = $"..\\..\\{key}"; break; } case _design: { key = Additional_functions.ClearLine(ref i, line); design_path = $"..\\..\\{key}"; break; } case _personal_characteristics: { key = Additional_functions.ClearLine(ref i, line); characteristics_path = $"..\\..\\{key}"; break; } case _theme: { key = Additional_functions.ClearLine(ref i, line); theme = key; break; } default: { break; } } } } }
public static void _VERIFIER(Header _Header, ref int i, ref string line) { Enum.TryParse(Additional_functions.ClearLine(ref i, line), out VerificationDescriptors Descriptor); switch (Descriptor) { case VerificationDescriptors._ONLY_ONE: { _Header.Verifier = VerificationDescriptors._ONLY_ONE; break; } case VerificationDescriptors._AT_LEAST_ONE: { _Header.Verifier = VerificationDescriptors._AT_LEAST_ONE; break; } case VerificationDescriptors._NO_LIMITS: { _Header.Verifier = VerificationDescriptors._NO_LIMITS; break; } } }
public static void _KEY(List <Key> _Keys, ref int i, ref string line) { string temp = Additional_functions.ClearLine(ref i, line); temp = temp.Replace('\n', ' ').Replace('\r', ' ').Replace(" ", ""); try{ Key key = new Key(); string[] rows = temp.Split('+'); foreach (var row in rows) { int k = 0; key.Add(new Element( Convert.ToInt32(Additional_functions.Trim(row, ref k, '[', ']')), Convert.ToInt32(Additional_functions.Trim(row, ref k, '(', ')')), Convert.ToSingle(Additional_functions.Trim(row, ref k, '=', '*').Replace('.', ',')) )); } _Keys.Add(key); } catch { Stored_Exceptions.Add(new Exception("Error: _Keys exception, key number " + _Keys.Count + 1)); } }
public static void _ANSWER(List <Question> _Questions, ref int i, ref string line) { _Questions[_Questions.Count - 1]._Answer.Add(Additional_functions.ClearLine(ref i, line)); }
public static void _QUESTION(List <Question> _Questions, ref int i, ref string line) { _Questions.Add(new Question()); _Questions[_Questions.Count - 1]._Question = Additional_functions.ClearLine(ref i, line); }
public static void _DESCRIPTION(Header _Header, ref int i, ref string line) => _Header.Description = Additional_functions.ClearLine(ref i, line);
public static void _NAME(Header _Header, ref int i, ref string line) => _Header.Name = Additional_functions.ClearLine(ref i, line);
public static void _GET_RESULT(ref int i, string line, out string result) { result = Additional_functions.ClearLine(ref i, line); }
public static void _GROUP(List <Group> Groups, ref int i, ref string line) { Groups.Add(new Group()); Groups[Groups.Count - 1].Manifestation = Additional_functions.ClearLine(ref i, line, '<', '>', false); }