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(); }
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 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); } } } }
private void buttonLBToXnYe_Click(object sender, EventArgs e) { double Ye, Xn; double L = 0; double.TryParse(this.textBoxL.Text.Trim(), out L); double B = 0; double.TryParse(this.textBoxB.Text.Trim(), out B); LonWide lw = (LonWide)int.Parse(this.comboBoxLonWide.SelectedValue.ToString()); int delno = int.Parse(this.textBoxDELNO.Text.Trim()); this.m_CoordHelper.GaussPrjCalculate(L, B, lw, delno, out Ye, out Xn); this.textBoxYe.Text = Ye.ToString(); this.textBoxXn.Text = Xn.ToString(); }
static void Main(string[] args) { string startPath = @"c:\Temp\att\"; string xmlpath = @"c:\Temp\log\"; var files = Directory.GetFiles(xmlpath, "*.*", SearchOption.AllDirectories) .Where(s => s.EndsWith(".xml")); foreach (string xml in files) { XmlDocument doc = new XmlDocument(); doc.Load(xml); XmlNodeList Xe = doc.SelectNodes("//FileDump/Message/Attachment"); var Message_ID = doc.SelectSingleNode("//FileDump/Message/MsgID").InnerXml; foreach (XmlNode Xn in Xe) { var linkNode = Xn.SelectSingleNode("FileName"); if (linkNode != null) { string link = linkNode.InnerText.Trim(); } string File_Name = Xn.SelectSingleNode("FileName").InnerXml; string File_ID = Xn.SelectSingleNode("FileID").InnerXml; //System.IO.File.Copy(curFile, msgsave, true); } try { string msgsave = @"c:\Temp\ZIP\" + doc.SelectSingleNode("//FileDump/Message/Attachment/FileName").InnerXml; string curFile = startPath + doc.SelectSingleNode("//FileDump/Message/Attachment/FileName").InnerXml; string bbgfile = xmlpath + "MR_" + Message_ID + ".xml"; string zipfilename = "MR_" + Message_ID + ".zip"; string rkzip = System.IO.Path.Combine(@"C:\Temp\log\", zipfilename); using (ZipFile zip = new ZipFile()) { string zipFileName = System.IO.Path.Combine(@"C:\Temp\log\", "MR_" + Message_ID + ".zip"); zip.AddFile(curFile, ""); zip.AddFile(bbgfile, ""); zip.Save(rkzip); } }
public bool[] XnDivGx() { return(Xn.Div(Gx)); }