Пример #1
0
        //common form processing routines

        private void SetHelpFile()
        {
            string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
            string helpFileName     = AppConfig.GetStringValueFromConfigFile("HelpFileName", "InitWinFormsHelpFile.chm");
            string helpFilePath     = PFFile.FormatFilePath(executableFolder, helpFileName);

            this.appHelpProvider.HelpNamespace = helpFilePath;
            _helpFilePath = helpFilePath;
        }
Пример #2
0
        //event handlers

        private void QueryBuilderForm_Load(object sender, EventArgs e)
        {
            string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
            string helpFileName     = AppConfig.GetStringValueFromConfigFile("QBFHelpFileName", "QbfUsersGuide.chm");
            //string helpFileName = AppConfig.GetStringValueFromConfigFile("HelpFileName", "InitWinFormsHelpFile.chm");
            string helpFilePath = PFFile.FormatFilePath(executableFolder, helpFileName);

            this.qbfHelpProvider.HelpNamespace = helpFilePath;
            _helpFilePath = helpFilePath;
        }
        internal void SetHelpFileValues()
        {
            string configValue = string.Empty;

            string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
            string helpFileName     = AppConfig.GetStringValueFromConfigFile("HelpFileName", "pfFolderSize.chm");
            string helpFilePath     = PFFile.FormatFilePath(executableFolder, helpFileName);

            this.tableNamesHelpProvider.HelpNamespace = helpFilePath;
            _helpFilePath = helpFilePath;
        }
Пример #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            string configValue = string.Empty;

            try
            {
                //this.Text = AppInfo.AssemblyProduct;
                this.Text = StaticKeysSection.Settings.MainFormCaption;

                configValue = AppGlobals.AppConfig.GetConfigValue("SaveErrorMessagesToErrorLog");
                if (configValue.ToUpper() == "TRUE")
                {
                    _saveErrorMessagesToAppLog = true;
                }
                else
                {
                    _saveErrorMessagesToAppLog = false;
                }
                _appLogFileName = AppGlobals.AppConfig.GetConfigValue("AppLogFileName");

                if (_appLogFileName.Trim().Length > 0)
                {
                    AppGlobals.AppMessages.AppLogFilename = _appLogFileName;
                }

                string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
                string helpFileName     = AppConfig.GetStringValueFromConfigFile("HelpFileName", "InitWinFormsHelpFile.chm");
                string helpFilePath     = PFFile.FormatFilePath(executableFolder, helpFileName);
                this.appHelpProvider.HelpNamespace = helpFilePath;
                _helpFilePath = helpFilePath;

                this.chkEraseOutputBeforeEachTest.Checked = true;
                this.optUseXmlFiles.Checked = true;

                InitForm();


                _mfp        = new MainFormProcessor(this);
                configValue = AppGlobals.AppConfig.GetStringValueFromConfigFile("TaskDefsDbConnectionString", string.Empty);
                if (configValue.Length > 0)
                {
                    _taskDefsDbConnectionString = configValue;
                }
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                Program._messageLog.WriteLine(_msg.ToString());
                AppMessages.DisplayErrorMessage(_msg.ToString(), _saveErrorMessagesToAppLog);
            }
        }
Пример #5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            string configValue = string.Empty;

            try
            {
                this.Text = AppInfo.AssemblyProduct;

                configValue = AppGlobals.AppConfig.GetConfigValue("SaveErrorMessagesToErrorLog");
                if (configValue.ToUpper() == "TRUE")
                {
                    _saveErrorMessagesToAppLog = true;
                }
                else
                {
                    _saveErrorMessagesToAppLog = false;
                }
                _appLogFileName = AppGlobals.AppConfig.GetConfigValue("AppLogFileName");

                if (_appLogFileName.Trim().Length > 0)
                {
                    AppGlobals.AppMessages.AppLogFilename = _appLogFileName;
                }

                string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
                string helpFileName     = AppConfig.GetStringValueFromConfigFile("HelpFileName", "InitWinFormsHelpFile.chm");
                string helpFilePath     = PFFile.FormatFilePath(executableFolder, helpFileName);
                this.appHelpProvider.HelpNamespace = helpFilePath;
                _helpFilePath = helpFilePath;

                this.chkEraseOutputBeforeEachTest.Checked = true;

                _saveMruListToRegistry    = AppConfig.GetBooleanValueFromConfigFile("SaveMruListToRegistry", "True");
                _mRUListSaveFileSubFolder = AppConfig.GetStringValueFromConfigFile("MRUListSaveFileSubFolder", @"PFApps\InitWinFormsAppWithToolbar\Mru\");
                _mRUListSaveRegistryKey   = AppConfig.GetStringValueFromConfigFile("MRUListSaveRegistryKey", @"SOFTWARE\PFApps\InitWinFormsAppWithToolbar");
                _maxMruListEntries        = AppConfig.GetIntValueFromConfigFile("MaxMruListEntries", (int)4);
                _useSubMenuForMruList     = AppConfig.GetBooleanValueFromConfigFile("UseSubMenuForMruList", "true");

                if (_saveMruListToRegistry)
                {
                    if (_useSubMenuForMruList)
                    {
                        _msm = new MruStripMenu(mnuFileRecent, new MruStripMenu.ClickedHandler(OnMruFile), _mRUListSaveRegistryKey + "\\MRU", false, _maxMruListEntries);
                    }
                    else
                    {
                        //use inline
                        _msm = new MruStripMenuInline(mnuFile, mnuFileRecent, new MruStripMenu.ClickedHandler(OnMruFile), _mRUListSaveRegistryKey + "\\MRU", _maxMruListEntries);
                    }
                    _msm.LoadFromRegistry();
                }
                else
                {
                    //load from and save to the file system
                    if (_useSubMenuForMruList)
                    {
                        _msm = new MruStripMenu(mnuFileRecent, new MruStripMenu.ClickedHandler(OnMruFile), _maxMruListEntries);
                    }
                    else
                    {
                        //use inline
                        _msm = new MruStripMenuInline(mnuFile, mnuFileRecent, new MruStripMenu.ClickedHandler(OnMruFile), _maxMruListEntries);
                    }
                    _msm.FileSystemMruPath = _mRUListSaveFileSubFolder;
                    _msm.LoadFromFileSystem();
                }
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                Program._messageLog.WriteLine(_msg.ToString());
                AppMessages.DisplayErrorMessage(_msg.ToString(), _saveErrorMessagesToAppLog);
            }
        }
Пример #6
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            string configValue = string.Empty;

            try
            {
                this.Text = AppInfo.AssemblyProduct;

                configValue = AppGlobals.AppConfig.GetConfigValue("SaveErrorMessagesToErrorLog");
                if (configValue.ToUpper() == "TRUE")
                {
                    _saveErrorMessagesToAppLog = true;
                }
                else
                {
                    _saveErrorMessagesToAppLog = false;
                }
                _appLogFileName = AppGlobals.AppConfig.GetConfigValue("AppLogFileName");

                if (_appLogFileName.Trim().Length > 0)
                {
                    AppGlobals.AppMessages.AppLogFilename = _appLogFileName;
                }

                string executableFolder = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).LocalPath;
                string helpFileName     = AppConfig.GetStringValueFromConfigFile("HelpFileName", "InitWinFormsHelpFile.chm");
                string helpFilePath     = PFFile.FormatFilePath(executableFolder, helpFileName);
                this.appHelpProvider.HelpNamespace = helpFilePath;
                _helpFilePath = helpFilePath;

                this.chkEraseOutputBeforeEachTest.Checked = true;

                this.chkShowStackTraceOnError.Checked = false;
                this.chkUseIntegratedSecurity.Checked = true;
                this.chkUseAsyncProcessing.Checked    = false;
                this.chkIsStoredProcedure.Checked     = false;
                this.txtServerName.Text   = "PROFASTSV2";
                this.txtDatabaseName.Text = "AdventureWorksDW2008R2";
                //this.txtDatabaseName.Text = "Miketest";
                this.txtApplicationName.Text = "TestprogSQL";
                this.txtWorkstationId.Text   = Environment.MachineName;
                this.txtUsername.Text        = string.Empty;
                this.txtPassword.Text        = string.Empty;

                this.txtTableName.Text  = "TestTable01";
                this.txtSchemaName.Text = "dbo";

                //_str.Length = 0;
                //_str.Append("select top 25");
                //_str.Append("\r\n");
                //_str.Append("  cGroup, cNumLow, cNumHigh, cCount, cName");
                //_str.Append("\r\n");
                //_str.Append(" from Namelists.dbo.tblUS_LastNames");
                //this.txtSQLQuery.Text = _str.ToString();

                _str.Length = 0;
                _str.Append("select LocKey=g.GeographyKey\r\n");
                _str.Append("      ,g.City\r\n");
                _str.Append("      ,[State]=g.StateProvinceName\r\n");
                _str.Append("      ,Country=g.EnglishCountryRegionName\r\n");
                _str.Append("      ,g.PostalCode\r\n");
                _str.Append("      ,st.SalesTerritoryRegion\r\n");
                _str.Append("      ,st.SalesTerritoryCountry\r\n");
                _str.Append("      ,st.SalesTerritoryGroup\r\n");
                _str.Append("  from dbo.DimGeography g\r\n");
                _str.Append("       join dbo.DimSalesTerritory st\r\n");
                _str.Append("         on g.SalesTerritoryKey = st.SalesTerritoryKey\r\n");
                _str.Append(";");
                this.txtSQLQuery.Text = _str.ToString();

                LoadAppConfigItems();
            }
            catch (System.Exception ex)
            {
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                Program._messageLog.WriteLine(_msg.ToString());
                AppMessages.DisplayErrorMessage(_msg.ToString(), _saveErrorMessagesToAppLog);
            }
        }