Beispiel #1
0
        static void Main()
        {
            try
            {
                #region 初始化全局变量
                LogEntry.Instance.WriteInfo("Application Started.");
                DocSetting.XMLSettingFullPath = Application.StartupPath + "\\YDTSetting.xml";
                DocSetting.Load();
                #endregion

                #region 全局捕获异常
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                #endregion

                #region 应用程序的主入口点
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new UCWindow.FrmMain());
                Application.ApplicationExit += (sender, e) => LogEntry.Instance.WriteInfo("Application Closed.");
                #endregion
            }
            catch (Exception ex)
            {
                LogEntry.Instance.WriteError("Exception", ex);
                MessageBox.Show(ex.Message, "System Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }
Beispiel #2
0
        private void FrmConfig_Load(object sender, EventArgs e)
        {
            DocSetting.Load();

            this.Txb_ReportTitle.Text  = DocSetting.Instance.ReportTitle;
            this.Txb_ReportHeader.Text = DocSetting.Instance.ReportHeader;
            this.Txb_ReportFooter.Text = DocSetting.Instance.ReportFooter;
            this.Txb_ReportPrefix.Text = DocSetting.Instance.ReportNamePrefix;
        }
Beispiel #3
0
 private void Btn_OK_Click(object sender, EventArgs e)
 {
     // TODO: Need to be chcek
     DocSetting.Instance.ReportTitle      = this.Txb_ReportTitle.Text;
     DocSetting.Instance.ReportHeader     = this.Txb_ReportHeader.Text;
     DocSetting.Instance.ReportFooter     = this.Txb_ReportFooter.Text;
     DocSetting.Instance.ReportNamePrefix = this.Txb_ReportPrefix.Text;
     DocSetting.Save();
     this.DialogResult = System.Windows.Forms.DialogResult.OK;
 }
Beispiel #4
0
        private void Btn_OK_Click(object sender, EventArgs e)
        {
            DocSetting.Instance.ReportHeader     = this.Txb_ReportHeader.Text;
            DocSetting.Instance.ReportFooter     = this.Txb_ReportFooter.Text;
            DocSetting.Instance.ReportTitle      = this.Txb_ReportTitle.Text;
            DocSetting.Instance.ReportNamePrefix = this.Txb_ReportPrefix.Text;
            DocSetting.Save();

            TemplateControl   = new UCControl.DocumentControl();
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }