internal static void NewConn() { Conn conn = new Conn(); try { ViewOpts viewOpts = new ViewOpts(App.SettingsFileName); conn.Run(viewOpts); } catch (FileNotFoundException) { conn.Run(); } catch (IOException) { MessageBox.Show(App.GetStr("Unable to read from the setting file!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); conn.Run(); } catch (XmlException) { MessageBox.Show(App.GetStr("The setting file is corrupted!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); conn.Run(); } catch (FormatException) { MessageBox.Show(App.GetStr("The setting file is corrupted!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); conn.Run(); } }
internal static void NewConn(string fileName) { try { ConnOpts connOpts = new ConnOpts(fileName); Conn conn = new Conn(); conn.Run(connOpts); } catch (FileNotFoundException) { MessageBox.Show(App.GetStr("Unable to open the file!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } catch (IOException) { MessageBox.Show(App.GetStr("Unable to read from the file!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } catch (XmlException) { MessageBox.Show(App.GetStr("The file is corrupted!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } catch (FormatException) { MessageBox.Show(App.GetStr("The file is corrupted!"), App.GetStr("Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); } }
//internal static void NewConn(string fileName) //{ // try // { // ConnOpts connOpts = new ConnOpts(fileName); // Conn conn = new Conn(); // conn.Run(connOpts); // } // catch (FileNotFoundException) // { // MessageBox.Show(App.GetStr("Unable to open the file!"), // App.GetStr("Error"), // MessageBoxButtons.OK, // MessageBoxIcon.Exclamation, // MessageBoxDefaultButton.Button1); // } // catch (IOException) // { // MessageBox.Show(App.GetStr("Unable to read from the file!"), // App.GetStr("Error"), // MessageBoxButtons.OK, // MessageBoxIcon.Exclamation, // MessageBoxDefaultButton.Button1); // } // catch (XmlException) // { // MessageBox.Show(App.GetStr("The file is corrupted!"), // App.GetStr("Error"), // MessageBoxButtons.OK, // MessageBoxIcon.Exclamation, // MessageBoxDefaultButton.Button1); // } // catch (FormatException) // { // MessageBox.Show(App.GetStr("The file is corrupted!"), // App.GetStr("Error"), // MessageBoxButtons.OK, // MessageBoxIcon.Exclamation, // MessageBoxDefaultButton.Button1); // } //} internal static void NewConn(string ip, string port, bool readOnly, string info) { Conn conn = new Conn(); conn.Run(ip, port, readOnly, info); }