Esempio n. 1
0
        public MainShellViewModel(IResultFactory resultFactory,
                                  IEventAggregator eventAggregator,
                                  IPersistanceManager persistanceManager,
                                  ISettingsManager settingsManager,
                                  MainMenuViewModel mainMenuViewModel,
                                  ConsoleViewModel consoleViewModel,
                                  ErrorViewModel errorViewModel,
                                  WatchesViewModel watchesViewModel,
                                  IFileSystem fileSystem,
                                  ScriptDialogStrategy scriptDialogStrategy,
                                  IPaths paths
                                  )
            : base(resultFactory)
        {
            this.eventAggregator = eventAggregator;
            eventAggregator.Subscribe(this);
            this.persistanceManager   = persistanceManager;
            this.fileSystem           = fileSystem;
            this.scriptDialogStrategy = scriptDialogStrategy;
            this.paths = paths;

            Scripts = new BindableCollection <ScriptEditorViewModel>();
            Tools   = new BindableCollection <PanelViewModel> {
                consoleViewModel, errorViewModel, watchesViewModel
            };

            Menu         = mainMenuViewModel;
            Menu.Plugins =
                settingsManager.ListConfigurablePluginSettings().Select(ps => new PluginSettingsMenuViewModel(ps));
            Menu.HelpFiles =
                settingsManager.ListPluginSettingsWithHelpFile().Select(ps => new PluginHelpFileViewModel(ps)).ToList();
            Menu.Views = Tools;

            DisplayName = "FreePIE - Programmable Input Emulator";
        }
Esempio n. 2
0
        public MainShellViewModel(IResultFactory resultFactory,
                                  IEventAggregator eventAggregator,
                                  IPersistanceManager persistanceManager,
                                  ISettingsManager settingsManager,
                                  MainMenuViewModel mainMenuViewModel,
                                  IEnumerable <PanelViewModel> panels,
                                  IFileSystem fileSystem,
                                  ScriptDialogStrategy scriptDialogStrategy,
                                  IPaths paths,
                                  IParser parser,
                                  IPortable portable
                                  )
            : base(resultFactory)
        {
            this.eventAggregator = eventAggregator;
            eventAggregator.Subscribe(this);
            this.persistanceManager   = persistanceManager;
            this.settingsManager      = settingsManager;
            this.fileSystem           = fileSystem;
            this.scriptDialogStrategy = scriptDialogStrategy;
            this.paths  = paths;
            this.parser = parser;

            Scripts = new BindableCollection <ScriptEditorViewModel>();
            Tools   = new BindableCollection <PanelViewModel>(panels);

            Menu         = mainMenuViewModel;
            Menu.Plugins =
                settingsManager.ListConfigurablePluginSettings().Select(ps => new PluginSettingsMenuViewModel(ps));
            Menu.HelpFiles =
                settingsManager.ListPluginSettingsWithHelpFile().Select(ps => new PluginHelpFileViewModel(ps)).ToList();
            Menu.Views = Tools;

            DisplayName = string.Format("FreePIE - Programmable Input Emulator{0}", portable.IsPortable ? " (Portable mode)" : null);
        }
        public MainMenuViewModel(IResultFactory resultFactory,
                                 IEventAggregator eventAggregator,
                                 Func <IScriptEngine> scriptEngineFactory,
                                 Func <ScriptEditorViewModel> scriptEditorFactory,
                                 IFileSystem fileSystem,
                                 ScriptDialogStrategy scriptDialogStrategy)
        {
            eventAggregator.Subscribe(this);

            this.resultFactory        = resultFactory;
            this.eventAggregator      = eventAggregator;
            this.scriptEngineFactory  = scriptEngineFactory;
            this.scriptEditorFactory  = scriptEditorFactory;
            this.fileSystem           = fileSystem;
            this.scriptDialogStrategy = scriptDialogStrategy;
        }
Esempio n. 4
0
        public MainMenuViewModel(IResultFactory resultFactory,
                                 IEventAggregator eventAggregator,
                                 Func <IScriptEngine> scriptEngineFactory,
                                 Func <ScriptEditorViewModel> scriptEditorFactory,
                                 IFileSystem fileSystem,
                                 ScriptDialogStrategy scriptDialogStrategy,
                                 ISettingsManager settings)
        {
            eventAggregator.Subscribe(this);

            this.resultFactory        = resultFactory;
            this.eventAggregator      = eventAggregator;
            this.scriptEngineFactory  = scriptEngineFactory;
            this.scriptEditorFactory  = scriptEditorFactory;
            this.fileSystem           = fileSystem;
            this.scriptDialogStrategy = scriptDialogStrategy;
            this.settingsManager      = settings;

            RecentScripts = new BindableCollection <RecentFileViewModel>(ListRecentFiles());
        }