private void startFileRecieve(string msg) { string[] tokens = msg.Split('\"'); /*switch(tokens[6]) * { * case "0":*/ SaveFileDialog fileSelector = new SaveFileDialog(); fileSelector.Title = "Save File"; fileSelector.OverwritePrompt = true; string[] filePathTokens = tokens[4].Split('\\'); string fileName = filePathTokens[filePathTokens.Length - 1]; fileSelector.FileName = fileName; string[] fileExtTokens = fileName.Split('.'); string fileExt = fileExtTokens[fileExtTokens.Length - 1]; fileSelector.Filter = "Recieved File(*." + fileExt + ")|*." + fileExt; if (fileSelector.ShowDialog() == DialogResult.Cancel) { MessageBox.Show("Recieve Cancelled!", "Petrel File Reciever", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } swSender.WriteLine(tokens[0] + "\"5\"" + myIp + "\"1987\"" + tokens[4]); swSender.Flush(); GeoCommunication.FTReciever rec = new GeoCommunication.FTReciever(tokens[2], tokens[3], fileSelector.FileName, swSender, tokens[0], Int64.Parse(tokens[5]), this, OBJTYPE.FILE, null); Thread thread = new Thread(new ThreadStart(rec.StartServer)); thread.Start(); //break; /*case "1": * List<SeismicCollection> cols = Discuss.getAllSeismicCollections(); * List<string> names = new List<string>(); * foreach( SeismicCollection col in cols) * { * names.Add(col.Name); * } * objSelect selector = new objSelect("Select a Seismic collection to add the cube to", names); * if (selector.ShowDialog() == DialogResult.Cancel) * return; * string fileNameseis = Path.GetTempFileName(); * swSender.WriteLine(tokens[0] + "\"5\"" + myIp + "\"1987\"" + tokens[4]); * swSender.Flush(); * FTReciever seismicRec = new FTReciever(tokens[2], tokens[3], fileNameseis, swSender, tokens[0], Int64.Parse(tokens[5]), * this, OBJTYPE.SIESMIC_CUBE, cols[objSelect.SelectedIndex]); * Thread seisThread = new Thread(new ThreadStart(seismicRec.StartServer)); * seisThread.Start(); * break; * }*/ }
private void startFileRecieve(string msg) { string[] tokens = msg.Split('\"'); /*switch(tokens[6]) { case "0":*/ SaveFileDialog fileSelector = new SaveFileDialog(); fileSelector.Title = "Save File"; fileSelector.OverwritePrompt = true; string[] filePathTokens = tokens[4].Split('\\'); string fileName = filePathTokens[filePathTokens.Length - 1]; fileSelector.FileName = fileName; string[] fileExtTokens = fileName.Split('.'); string fileExt = fileExtTokens[fileExtTokens.Length - 1]; fileSelector.Filter = "Recieved File(*." + fileExt + ")|*." + fileExt; if (fileSelector.ShowDialog() == DialogResult.Cancel) { MessageBox.Show("Recieve Cancelled!", "Petrel File Reciever", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } swSender.WriteLine(tokens[0] + "\"5\"" + myIp + "\"1987\"" + tokens[4]); swSender.Flush(); GeoCommunication.FTReciever rec = new GeoCommunication.FTReciever(tokens[2], tokens[3], fileSelector.FileName, swSender, tokens[0], Int64.Parse(tokens[5]), this, OBJTYPE.FILE, null); Thread thread = new Thread(new ThreadStart(rec.StartServer)); thread.Start(); //break; /*case "1": List<SeismicCollection> cols = Discuss.getAllSeismicCollections(); List<string> names = new List<string>(); foreach( SeismicCollection col in cols) { names.Add(col.Name); } objSelect selector = new objSelect("Select a Seismic collection to add the cube to", names); if (selector.ShowDialog() == DialogResult.Cancel) return; string fileNameseis = Path.GetTempFileName(); swSender.WriteLine(tokens[0] + "\"5\"" + myIp + "\"1987\"" + tokens[4]); swSender.Flush(); FTReciever seismicRec = new FTReciever(tokens[2], tokens[3], fileNameseis, swSender, tokens[0], Int64.Parse(tokens[5]), this, OBJTYPE.SIESMIC_CUBE, cols[objSelect.SelectedIndex]); Thread seisThread = new Thread(new ThreadStart(seismicRec.StartServer)); seisThread.Start(); break; }*/ }