/// <summary> /// override method of BaseAction.<br></br> /// </summary> /// <param name="context">input parameter</param> /// <returns>if successful,return the result.</returns> public override BaseActionResult Execute(Context context) { DataSetActionResult result = new DataSetActionResult(); ConfigDic obj = new ConfigDic(); DsConfigDic ds = obj.Load(1); result.Result = true; result.DataSetData = ds; return(result); }
static void Main(string[] args) { Properties.Settings.Default.Reload(); if (!Directory.Exists(ResourceFolderPath)) { Directory.CreateDirectory(ResourceFolderPath); } if (!Directory.Exists(RootPath + "Backup")) { Directory.CreateDirectory(RootPath + "Backup"); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { string ezPath = ""; ConfigDic config = new ConfigDic(); config.Load(ConfigFilePath); if (!config.TryGetValue("ezTransXP_Path", out ezPath)) { FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.ShowNewFolderButton = true; dialog.Description = "ezTrans XP가 설치된 경로를 선택해 주세요"; dialog.ShowDialog(); ezPath = dialog.SelectedPath; config.SetValue("ezTransXP_Path", ezPath); dialog.Dispose(); } int result = TranslateXP.Initialize(ezPath); if (result != 0) { MessageBox.Show("EZTransXP 로드에 실패하였습니다.\nCode: " + result); return; } Application.Run(new MainForm(config)); config.Save(ConfigFilePath); TranslateXP.Terminate(); } catch (Exception e) { FileStream fs = new FileStream(LogFilePath, FileMode.Create); new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter().Serialize(fs, e); fs.Flush(); fs.Dispose(); Trace.Assert(false, e.Message); } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); #if !DEBUG try { #endif var config = new ConfigDic(); config.Load(new FileStream(ConfigFilePath, FileMode.OpenOrCreate)); if (!config.TryGetValue("ezTransXP_Path", out string ezPath)) { var dialog = new FolderBrowserDialog() { ShowNewFolderButton = true, Description = "ezTrans XP가 설치된 경로를 선택해 주세요" }; dialog.ShowDialog(); ezPath = dialog.SelectedPath; config.SetValue("ezTransXP_Path", ezPath); dialog.Dispose(); } int result = TranslateXP.Initialize(ezPath); if (result != 0) { MessageBox.Show("EZTransXP 로드에 실패하였습니다.\nCode: " + result); return; } Application.Run(new MainForm(config)); config.Save(new FileStream(ConfigFilePath, FileMode.Create)); TranslateXP.Terminate(); #if !DEBUG } catch (Exception e) { var fs = new FileStream(LogFilePath, FileMode.Create); new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter().Serialize(fs, e); fs.Flush(); fs.Dispose(); MessageBox.Show(e.Message + "\r\n\r\n\r\n" + e.StackTrace, "에러발생!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } #endif }
private ConfigDicMgr() { this.m_szCfgFilePath = System.Configuration.ConfigurationManager.AppSettings["ConfigDicFilePath"]; this.m_dsConfigDic = new DsConfigDic(); ConfigDic obj = new ConfigDic(); DsConfigDic ds = obj.Load(2); this.m_dsConfigDic.Merge(ds); DsConfigDic ds1 = new DsConfigDic(); try { ds1.ReadXml(this.m_szCfgFilePath); this.m_dsConfigDic.Merge(ds1, false); } catch { } }