示例#1
0
        private static void LoadAppSettingsItems()
        {
            // Use both operations now
            var selectedOperations = new List <string>
            {
                AppSettingsConstants.OperationTypeConvertPdf,
                AppSettingsConstants.OperationTypePageCount
            };

            AppSettingsItems = new Dictionary <string, object>
            {
                { AppSettingsConstants.Source, AppSettingsConstants.InputSource.Directory },
                { AppSettingsConstants.SelectedOperations, selectedOperations },
                { AppSettingsConstants.FileTypeForConvertToPdf, InfoConstants.DocImageBoth },

                { AppSettingsConstants.InputPath, AppConfigReader.GetInputPath() },
                { AppSettingsConstants.RootOutputPath, AppConfigReader.GetRootOutputPath() },
                { AppSettingsConstants.RootLogPath, AppConfigReader.GetRootLogPath() },
                { AppSettingsConstants.OutputPath, "" },
                { AppSettingsConstants.LogPath, "" },

                { AppSettingsConstants.EnableCombinedLogAndReport, AppConfigReader.EnableCombinedLogAndReport() },
                { AppSettingsConstants.CombinedOutputPath, AppConfigReader.GetCombinedOutputPath() },
                { AppSettingsConstants.CombinedSummaryLogPath, AppConfigReader.GetCombinedSummaryLogPath() },
                { AppSettingsConstants.CombinedErrorLogPath, AppConfigReader.GetCombinedErrorLogPath() },

                { AppSettingsConstants.LogUpdateTimeInSec, AppConfigReader.GetLogUpdateTime() }
            };
        }
示例#2
0
        private static void LoadAppSettingsItems()
        {
            var inputSource          = string.Empty;
            var selectedOperations   = new List <string>();
            var fileTypeToConvertPdf = string.Empty;

            AppWindow.Dispatcher?.Invoke(() =>
            {
                fileTypeToConvertPdf = InfoConstants.AllButPdf;
                inputSource          = AppWindow.ComboBoxInputSource.SelectedValue.ToString();
                selectedOperations   = FormControlHelper.ConvertToList(AppWindow.ListBoxRight.Items.SourceCollection,
                                                                       AppSettingsConstants.OperationTypesExecutionSequence);
            });

            AppSettingsItems = new Dictionary <string, object>
            {
                { AppSettingsConstants.Source, inputSource },
                { AppSettingsConstants.SelectedOperations, selectedOperations },
                { AppSettingsConstants.FileTypeForConvertToPdf, fileTypeToConvertPdf },

                { AppSettingsConstants.InputPath, AppConfigReader.GetInputPath() },
                { AppSettingsConstants.RootOutputPath, AppConfigReader.GetRootOutputPath() },
                { AppSettingsConstants.RootLogPath, AppConfigReader.GetRootLogPath() },
                { AppSettingsConstants.OutputPath, "" },
                { AppSettingsConstants.LogPath, "" },

                { AppSettingsConstants.EnableCombinedLogAndReport, AppConfigReader.EnableCombinedLogAndReport() },
                { AppSettingsConstants.CombinedOutputPath, AppConfigReader.GetCombinedOutputPath() },
                { AppSettingsConstants.CombinedSummaryLogPath, AppConfigReader.GetCombinedSummaryLogPath() },
                { AppSettingsConstants.CombinedErrorLogPath, AppConfigReader.GetCombinedErrorLogPath() },

                { AppSettingsConstants.LogUpdateTimeInSec, AppConfigReader.GetLogUpdateTime() }
            };
        }
        private void LoadDefaultLogSettings()
        {
            OperationExecutor.AppWindow = this;
            ListBoxLeft.ItemsSource     = _dataList = FormControlHelper.LoadListBoxData();

            // Load Combobox by input sources
            var inputSources = Enum.GetValues(typeof(AppSettingsConstants.InputSource)).Cast <AppSettingsConstants.InputSource>();
            var enumerable   = inputSources as AppSettingsConstants.InputSource[] ?? inputSources.ToArray();

            ComboBoxInputSource.ItemsSource = enumerable.Reverse().Skip(1); // Remove the single file input support

            // Setup from config
            TextBoxOutputPath.Text = AppConfigReader.GetRootOutputPath();
            TextBoxLogPath.Text    = AppConfigReader.GetRootLogPath();
            CheckBoxEnableCombinedLogAndReport.IsChecked = AppConfigReader.EnableCombinedLogAndReport();
            TextBoxCombinedOutputPath.Text     = AppConfigReader.GetCombinedOutputPath();
            TextBoxCombinedErrorLogPath.Text   = AppConfigReader.GetCombinedErrorLogPath();
            TextBoxCombinedSummaryLogPath.Text = AppConfigReader.GetCombinedSummaryLogPath();
            var updateTimeInSec = AppConfigReader.GetLogUpdateTime() / 1000;

            TextBoxLogUpdateTimeInSec.Text = updateTimeInSec.ToString();
        }