Inheritance: DocumentController
Example #1
0
        public ModuleController(IEnvironmentService environmentService, IPresentationService presentationService, ShellService shellService,
                                Lazy <FileController> fileController, Lazy <RichTextDocumentController> richTextDocumentController, Lazy <PrintController> printController,
                                Lazy <ShellViewModel> shellViewModel, Lazy <MainViewModel> mainViewModel, Lazy <StartViewModel> startViewModel)
        {
            // Upgrade the settings from a previous version when the new version starts the first time.
            if (Settings.Default.IsUpgradeNeeded)
            {
                Settings.Default.Upgrade();
                Settings.Default.IsUpgradeNeeded = false;
            }

            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            InitializeCultures();
            presentationService.InitializeCultures();

            this.environmentService         = environmentService;
            this.fileController             = fileController.Value;
            this.richTextDocumentController = richTextDocumentController.Value;
            this.printController            = printController.Value;
            this.shellViewModel             = shellViewModel.Value;
            this.mainViewModel  = mainViewModel.Value;
            this.startViewModel = startViewModel.Value;

            shellService.ShellView       = this.shellViewModel.View;
            this.shellViewModel.Closing += ShellViewModelClosing;
            exitCommand = new DelegateCommand(Close);
        }
        public ApplicationController(IEnvironmentService environmentService, IPresentationService presentationService, ShellService shellService,
            Lazy<FileController> fileController, Lazy<RichTextDocumentController> richTextDocumentController, Lazy<PrintController> printController,
            Lazy<ShellViewModel> shellViewModel, Lazy<MainViewModel> mainViewModel, Lazy<StartViewModel> startViewModel)
        {
            // Upgrade the settings from a previous version when the new version starts the first time.
            if (Settings.Default.IsUpgradeNeeded)
            {
                Settings.Default.Upgrade();
                Settings.Default.IsUpgradeNeeded = false;
            }

            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            InitializeCultures();
            presentationService.InitializeCultures();

            this.environmentService = environmentService;
            this.fileController = fileController.Value;
            this.richTextDocumentController = richTextDocumentController.Value;
            this.printController = printController.Value;
            this.shellViewModel = shellViewModel.Value;
            this.mainViewModel = mainViewModel.Value;
            this.startViewModel = startViewModel.Value;

            shellService.ShellView = this.shellViewModel.View;
            this.shellViewModel.Closing += ShellViewModelClosing;
            this.exitCommand = new DelegateCommand(Close);
        }
Example #3
0
 public void TestInitialize()
 {
     richTextDocumentController = Container.GetExportedValue<RichTextDocumentController>();
     Container.GetExportedValue<FileController>().Initialize();
     
     OnTestInitialize();
 }
Example #4
0
        public void TestInitialize()
        {
            AggregateCatalog catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(MockMessageService).Assembly));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(ApplicationController).Assembly));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(TestClassBase).Assembly));

            container = new CompositionContainer(catalog, CompositionOptions.DisableSilentRejection);
            CompositionBatch batch = new CompositionBatch();
            batch.AddExportedValue(container);
            container.Compose(batch);

            richTextDocumentController = Container.GetExportedValue<RichTextDocumentController>();
            Container.GetExportedValue<FileController>().Initialize();

            OnTestInitialize();
        }
Example #5
0
        public ModuleController(IEnvironmentService environmentService, ISettingsService settingsService, IPresentationService presentationService,
                                ShellService shellService, Lazy <FileController> fileController, Lazy <RichTextDocumentController> richTextDocumentController,
                                Lazy <PrintController> printController, Lazy <ShellViewModel> shellViewModel, Lazy <MainViewModel> mainViewModel,
                                Lazy <StartViewModel> startViewModel)
        {
            // Initializing the cultures must be done first. Therefore, we inject the Controllers and ViewModels lazy.
            settingsService.ErrorOccurred += (sender, e) => Log.Default.Error(e.Error, "Error in SettingsService");
            InitializeCultures(settingsService.Get <AppSettings>());
            presentationService.InitializeCultures();

            this.environmentService         = environmentService;
            this.fileController             = fileController.Value;
            this.richTextDocumentController = richTextDocumentController.Value;
            this.printController            = printController.Value;
            this.shellViewModel             = shellViewModel.Value;
            this.mainViewModel  = mainViewModel.Value;
            this.startViewModel = startViewModel.Value;

            shellService.ShellView       = this.shellViewModel.View;
            this.shellViewModel.Closing += ShellViewModelClosing;
            exitCommand = new DelegateCommand(Close);
        }