public Rebase_meta(string file) { InitializeComponent(); XmlDocument xd = new XmlDocument(); xd.Load(file); compile_list = new List <injectRefs>(); directory = DATA_READ.ReadDirectory_from_file_location(file); int new_index = 0x3BA4;//new datum_indexes starting from 0x3BA4 foreach (XmlNode Xn in xd.SelectNodes("config/tag")) { injectRefs temp = new injectRefs(); temp.old_datum = int.Parse(Xn.SelectSingleNode("datum").InnerText, NumberStyles.HexNumber); temp.new_datum = new_index++; temp.file_name = Xn.SelectSingleNode("name").InnerText; temp.type = DATA_READ.ReadTAG_TYPE_form_name(temp.file_name); //lets add the tag to the list compile_list.Add(temp); } }
List <UnisonRefs> type_ref_list;//they are used to universally reference a tag depending on the type of tagRef /// <summary> /// constructor to intialize stuff /// </summary> /// <param name="file"></param> /// <param name="type"></param> public Resyncer(string file, string type) { directory = DATA_READ.ReadDirectory_from_file_location(file); resync_type = type; XmlDocument xd = new XmlDocument(); xd.Load(file); compile_list = new List <injectRefs>(); scneario_list = new List <string>(); type_ref_list = new List <UnisonRefs>(); foreach (XmlNode Xn in xd.SelectNodes("config/tag")) { injectRefs temp = new injectRefs(); temp.old_datum = int.Parse(Xn.SelectSingleNode("datum").InnerText, NumberStyles.HexNumber); temp.new_datum = -1; temp.file_name = Xn.SelectSingleNode("name").InnerText; temp.type = DATA_READ.ReadTAG_TYPE_form_name(temp.file_name); scneario_list.Add(Xn.SelectSingleNode("scenario").InnerText); //lets add the tag to the list compile_list.Add(temp); } sync(); }
List <UnisonRefs> type_ref_list;//they are used to universally reference a tag depending on the type of tagRef public Rebase_meta(string file) { InitializeComponent(); XmlDocument xd = new XmlDocument(); xd.Load(file); compile_list = new List <injectRefs>(); tag_scenarios = new List <string>(); type_ref_list = new List <UnisonRefs>(); directory = DATA_READ.ReadDirectory_from_file_location(file); int new_index = 0x3BA4;//new datum_indexes starting from 0x3BA4 foreach (XmlNode Xn in xd.SelectNodes("config/tag")) { injectRefs temp = new injectRefs(); temp.old_datum = int.Parse(Xn.SelectSingleNode("datum").InnerText, NumberStyles.HexNumber); temp.new_datum = new_index++; temp.file_name = Xn.SelectSingleNode("name").InnerText; temp.type = DATA_READ.ReadTAG_TYPE_form_name(temp.file_name); tag_scenarios.Add(Xn.SelectSingleNode("scenario").InnerText); //lets add the tag to the list compile_list.Add(temp); } //now lets fill the unison List List <string> blacklisted_type = new List <string>(); foreach (injectRefs inj_temp in compile_list) { if (!blacklisted_type.Contains(inj_temp.type)) { bool any_occurence = false; for (int i = 0; i < type_ref_list.Count(); i++) { UnisonRefs uni_temp = type_ref_list[i]; if (uni_temp.type == inj_temp.type) { any_occurence = true; blacklisted_type.Add(inj_temp.type); type_ref_list.Remove(uni_temp); } } if (!any_occurence) { UnisonRefs my_temp_ref = new UnisonRefs(); my_temp_ref.type = inj_temp.type; my_temp_ref.new_datum = inj_temp.new_datum; my_temp_ref.file_name = inj_temp.file_name; type_ref_list.Add(my_temp_ref); } } } }