public static void InitXmlSchema(string schemaPath) { string schema = Xmler.GetAppSettingValue("schema"); if (string.IsNullOrEmpty(schema)) { throw new XmlException("Missing schema config in App.config."); } TemplateDataSet.ReadXmlSchema(schemaPath); }
/// <summary> /// Show Pattern Config file. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnOpen_Click(object sender, EventArgs e) { string txtopener = Xmler.GetAppSettingValue("txtopener"); string replacepatterns = Xmler.GetAppSettingValue("replacepatterns"); if (!string.IsNullOrEmpty(txtopener)) { Process.Start(txtopener, replacepatterns); } else { MessageBox.Show("Txt File Editor is Missing or not Config." + "\nPlease Confirm the [txtopener] on *.exe.config "); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); string path = Path.GetDirectoryName(Application.ExecutablePath); string schemaPath = Path.Combine(path, Xmler.GetAppSettingValue("schema")); string xmlPath = Path.Combine(path, Xmler.GetAppSettingValue("rules")); string xmlPathTemplate = Path.Combine(path, Xmler.GetAppSettingValue("template")); ReplaceLoader.InitXmlSchema(schemaPath); ReplaceLoader.LoadTemplate(xmlPath); ReplaceLoader.LoadTemplateXML(xmlPathTemplate); Application.Run(new FrmMDI()); }