Exemple #1
0
        public DiffClient(Task task, DiffClientOptions options, object exportLockObject)
        {
            task.LoadConfig(options.DefaultOutputFilePath, options.QueryParameters);

            ExportLockObject = exportLockObject;

            var leftDataSourceSetting  = task.Sources[0];
            var rightDataSourceSetting = task.Sources[1];

            ReaderOfLeftDataSource  = new SqlServerDataReader();
            ReaderOfRightDataSource = new SqlServerDataReader();

            ReadOptionsOfLeftSource = new SqlServerReaderOptions(leftDataSourceSetting.Name, task.Columns.PrimaryColumns,
                                                                 leftDataSourceSetting.ConnectionString, leftDataSourceSetting.QueryString, leftDataSourceSetting.QueryParameters, options.DefaultTimeout);
            ReadOptionsOfRightSource = new SqlServerReaderOptions(rightDataSourceSetting.Name, task.Columns.PrimaryColumns,
                                                                  rightDataSourceSetting.ConnectionString, rightDataSourceSetting.QueryString, rightDataSourceSetting.QueryParameters, options.DefaultTimeout);

            MergeOptions = new MergeOptions(leftDataSourceSetting.Name, rightDataSourceSetting.Name,
                                            task.Columns.CompareColumns, task.GapMapping);

            ColumnNameBuilder = new ExcelColumnNameBuilder(options.SuffixOfGapColumn, options.SuffixOfCompareResultColumn);

            ExcelHighlighter = new ExcelHighlighter(ColumnNameBuilder);

            DataExporter = new ExcelExporter();
            var highlightOptions = new HighlightOptions(leftDataSourceSetting.Name, rightDataSourceSetting.Name);

            ExportOptions = new ExcelExportOptions(task.Name, task.Report.Path, highlightOptions);
        }
Exemple #2
0
        private static void ProcessTask(string path, DiffClientOptions diffOptions, object exportLockObject)
        {
            var tasks = Task.LoadFromXml(path);

            Parallel.ForEach(tasks, new ParallelOptions {
                MaxDegreeOfParallelism = 5
            },
                             task =>
            {
                var differ = new DiffClient(task, diffOptions, exportLockObject);
                differ.Diff();
            });
        }