コード例 #1
0
        public MainWindow(IViewModelEvaluator viewModelEvaluator, ICssMetricsPresenter cssMetricsPresenter, IHumanInterface ux, IInspectionPathPresenter inspectionPathPresenter, IResultsPathPresenter resultsPathPresenter, IBoolOptionPresenter boolOptionPresenter, IOutputPresenter outputPresenter, IProgressPresenter progressPresenter, IInputPresenter inputPresenter, IOptionsPresenter optionsPresenter, ISettingsClearer settingsClearer, IInteractionPermissionToggler interactionPermissionToggler, IJavaScriptMetricsPresenter javaScriptMetricsPresenter, IFolderPresenter folderPresenter, IDirectoryDescendentFilesEvaluator directoryDescendentFilesEvaluator, IGroupedCssEvaluator groupedCssEvaluator, IFoldersPerGroupEvaluator foldersPerGroupEvaluator, IChildDirectoryCountEvaluator childDirectoryCountEvaluator, IPathExistenceEvaluator pathExistenceEvaluator, IGroupedJavaScriptEvaluator groupedJavaScriptEvaluator, ISpecificGroupEvaluator specificGroupEvaluator, IHasFilesToInspectAndIsIdleEvaluator hasFilesToInspectAndIsIdleEvaluator, IFilesToInspectEvaluator filesToInspectEvaluator, IFilesToInspectStorer filesToInspectStorer, IRefactorPathPresenter refactorPathPresenter, ICssSpliter cssSpliter, IGeneratedCssPathPresenter generatedCssPathPresenter, ISolutionPathPresenter solutionPathPresenter, ImageReferencesEvaluator imageReferencesEvaluator, IJsSplitter jsSplitter, IAdvancedJsSplitter advancedJsSplitter)
        {
            AdvancedJsSplitter = advancedJsSplitter;
            JsSplitter = jsSplitter;
            ImageReferencesEvaluator = imageReferencesEvaluator;
            SolutionPathPresenter = solutionPathPresenter;
            GeneratedCssPathPresenter = generatedCssPathPresenter;
            CssSpliter = cssSpliter;
            RefactorPathPresenter = refactorPathPresenter;
            FilesToInspectStorer = filesToInspectStorer;
            FilesToInspectEvaluator = filesToInspectEvaluator;
            HasFilesToInspectAndIsIdleEvaluator = hasFilesToInspectAndIsIdleEvaluator;
            SpecificGroupEvaluator = specificGroupEvaluator;
            GroupedJavaScriptEvaluator = groupedJavaScriptEvaluator;
            PathExistenceEvaluator = pathExistenceEvaluator;
            ChildDirectoryCountEvaluator = childDirectoryCountEvaluator;
            FoldersPerGroupEvaluator = foldersPerGroupEvaluator;
            GroupedCssEvaluator = groupedCssEvaluator;
            DirectoryDescendentFilesEvaluator = directoryDescendentFilesEvaluator;
            FolderPresenter = folderPresenter;
            JavaScriptMetricsPresenter = javaScriptMetricsPresenter;
            InteractionPermissionToggler = interactionPermissionToggler;
            SettingsClearer = settingsClearer;
            OptionsPresenter = optionsPresenter;
            Ux = ux;
            InputPresenter = inputPresenter;
            OutputPresenter = outputPresenter;
            ProgressPresenter = progressPresenter;
            ViewModelEvaluator = viewModelEvaluator;
            BoolOptionPresenter = boolOptionPresenter;
            InspectionPathPresenter = inspectionPathPresenter;
            CssMetricsPresenter = cssMetricsPresenter;
            ResultsPathPresenter = resultsPathPresenter;

            InitializeComponent();

            ux.ReadEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => inputPresenter.Present(sender, e, (ViewModel)DataContext)));
            ux.WriteEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OutputPresenter.Write(sender, e, (ViewModel)DataContext)));
            ux.ProgressEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => ProgressPresenter.Present(sender, e, (ViewModel)DataContext)));
            ux.WriteLineEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OutputPresenter.WriteLine(sender, e, (ViewModel)DataContext)));
            ux.AddOptionEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.AddOption(sender, e, (ViewModel)DataContext)));
            ux.ResetProgressEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => ProgressPresenter.Reset(sender, e, (ViewModel)DataContext)));
            ux.DisplayOptionsEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.DisplayOptions(sender, e, (ViewModel)DataContext))); ;
            ux.DisplayBoolOptionEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => BoolOptionPresenter.Present(sender, e)));
            ux.AddOptionWithHeadingSpaceEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.AddOptionWithHeadingSpace(sender, e, (ViewModel)DataContext)));

            GroupedCssEvaluator.ScrollDown += ScrollDown;
            GroupedJavaScriptEvaluator.ScrollDown += ScrollDown;

            //#if DEBUG
            //            SettingsClearer.Clear();
            //#endif

            DataContext = ViewModelEvaluator.Evaluate();
        }
コード例 #2
0
        public MainWindow(IViewModelEvaluator viewModelEvaluator, ICssMetricsPresenter cssMetricsPresenter, IHumanInterface ux, IInspectionPathPresenter inspectionPathPresenter, IResultsPathPresenter resultsPathPresenter, IBoolOptionPresenter boolOptionPresenter, IOutputPresenter outputPresenter, IProgressPresenter progressPresenter, IInputPresenter inputPresenter, IOptionsPresenter optionsPresenter, ISettingsClearer settingsClearer, IInteractionPermissionToggler interactionPermissionToggler, IJavaScriptMetricsPresenter javaScriptMetricsPresenter, IFolderPresenter folderPresenter, IDirectoryDescendentFilesEvaluator directoryDescendentFilesEvaluator, IGroupedCssEvaluator groupedCssEvaluator, IFoldersPerGroupEvaluator foldersPerGroupEvaluator, IChildDirectoryCountEvaluator childDirectoryCountEvaluator, IPathExistenceEvaluator pathExistenceEvaluator, IGroupedJavaScriptEvaluator groupedJavaScriptEvaluator, ISpecificGroupEvaluator specificGroupEvaluator, IHasFilesToInspectAndIsIdleEvaluator hasFilesToInspectAndIsIdleEvaluator, IFilesToInspectEvaluator filesToInspectEvaluator, IFilesToInspectStorer filesToInspectStorer, IRefactorPathPresenter refactorPathPresenter, ICssSpliter cssSpliter, IGeneratedCssPathPresenter generatedCssPathPresenter, ISolutionPathPresenter solutionPathPresenter, ImageReferencesEvaluator imageReferencesEvaluator, IJsSplitter jsSplitter, IAdvancedJsSplitter advancedJsSplitter)
        {
            AdvancedJsSplitter                  = advancedJsSplitter;
            JsSplitter                          = jsSplitter;
            ImageReferencesEvaluator            = imageReferencesEvaluator;
            SolutionPathPresenter               = solutionPathPresenter;
            GeneratedCssPathPresenter           = generatedCssPathPresenter;
            CssSpliter                          = cssSpliter;
            RefactorPathPresenter               = refactorPathPresenter;
            FilesToInspectStorer                = filesToInspectStorer;
            FilesToInspectEvaluator             = filesToInspectEvaluator;
            HasFilesToInspectAndIsIdleEvaluator = hasFilesToInspectAndIsIdleEvaluator;
            SpecificGroupEvaluator              = specificGroupEvaluator;
            GroupedJavaScriptEvaluator          = groupedJavaScriptEvaluator;
            PathExistenceEvaluator              = pathExistenceEvaluator;
            ChildDirectoryCountEvaluator        = childDirectoryCountEvaluator;
            FoldersPerGroupEvaluator            = foldersPerGroupEvaluator;
            GroupedCssEvaluator                 = groupedCssEvaluator;
            DirectoryDescendentFilesEvaluator   = directoryDescendentFilesEvaluator;
            FolderPresenter                     = folderPresenter;
            JavaScriptMetricsPresenter          = javaScriptMetricsPresenter;
            InteractionPermissionToggler        = interactionPermissionToggler;
            SettingsClearer                     = settingsClearer;
            OptionsPresenter                    = optionsPresenter;
            Ux                      = ux;
            InputPresenter          = inputPresenter;
            OutputPresenter         = outputPresenter;
            ProgressPresenter       = progressPresenter;
            ViewModelEvaluator      = viewModelEvaluator;
            BoolOptionPresenter     = boolOptionPresenter;
            InspectionPathPresenter = inspectionPathPresenter;
            CssMetricsPresenter     = cssMetricsPresenter;
            ResultsPathPresenter    = resultsPathPresenter;

            InitializeComponent();

            ux.ReadEvent                      += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => inputPresenter.Present(sender, e, (ViewModel)DataContext)));
            ux.WriteEvent                     += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OutputPresenter.Write(sender, e, (ViewModel)DataContext)));
            ux.ProgressEvent                  += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => ProgressPresenter.Present(sender, e, (ViewModel)DataContext)));
            ux.WriteLineEvent                 += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OutputPresenter.WriteLine(sender, e, (ViewModel)DataContext)));
            ux.AddOptionEvent                 += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.AddOption(sender, e, (ViewModel)DataContext)));
            ux.ResetProgressEvent             += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => ProgressPresenter.Reset(sender, e, (ViewModel)DataContext)));
            ux.DisplayOptionsEvent            += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.DisplayOptions(sender, e, (ViewModel)DataContext)));;
            ux.DisplayBoolOptionEvent         += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => BoolOptionPresenter.Present(sender, e)));
            ux.AddOptionWithHeadingSpaceEvent += (sender, e) => Application.Current.Dispatcher.BeginInvoke(new Action(() => OptionsPresenter.AddOptionWithHeadingSpace(sender, e, (ViewModel)DataContext)));

            GroupedCssEvaluator.ScrollDown        += ScrollDown;
            GroupedJavaScriptEvaluator.ScrollDown += ScrollDown;

            //#if DEBUG
            //            SettingsClearer.Clear();
            //#endif

            DataContext = ViewModelEvaluator.Evaluate();
        }