예제 #1
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);
        }
예제 #2
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";
        }
        public WatchesViewModel(IEventAggregator eventAggregator)
        {
            Watches = new BindableCollection <WatchViewModel>();
            eventAggregator.Subscribe(this);
            messages = new Dictionary <string, object>();

            ThreadPool.QueueUserWorkItem(x =>
            {
                while (true)
                {
                    if (clearWatches)
                    {
                        clearWatches = false;
                        Watches.Clear();
                    }
                    foreach (var message in messages)
                    {
                        AddWatch(message.Key, message.Value);
                    }
                    Thread.Sleep(20);
                }
            });

            Title    = "Watch";
            IconName = "watch-16.png";
        }
예제 #4
0
        public ErrorsViewModel(IEventAggregator eventAggregator)
        {
            eventAggregator.Subscribe(this);

            Errors   = new BindableCollection <ErrorViewModel>();
            Title    = "Error";
            IconName = "error-16.png";
        }
예제 #5
0
 public TrayIconViewModel(IResultFactory resultFactory,
                          IEventAggregator eventAggregator,
                          MainShellViewModel shellViewModel,
                          ISettingsManager settingsManager
                          )
 {
     this.resultFactory   = resultFactory;
     this.shellViewModel  = shellViewModel;
     this.settingsManager = settingsManager;
     this.eventAggregator = eventAggregator;
     this.eventAggregator.Subscribe(this);
 }
예제 #6
0
        public MainMenuViewModel(IResultFactory resultFactory,
                                 IEventAggregator eventAggregator,
                                 Func <IScriptEngine> scriptEngineFactory,
                                 IFileSystem fileSystem)
        {
            eventAggregator.Subscribe(this);

            this.resultFactory       = resultFactory;
            this.eventAggregator     = eventAggregator;
            this.scriptEngineFactory = scriptEngineFactory;
            this.fileSystem          = fileSystem;
        }
예제 #7
0
        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;
        }
예제 #8
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());
        }
예제 #9
0
 public ErrorViewModel(IEventAggregator eventAggregator)
 {
     this.eventAggregator = eventAggregator;
     eventAggregator.Subscribe(this);
 }
예제 #10
0
 public CurveViewModel(IEventAggregator eventAggregator)
 {
     this.eventAggregator = eventAggregator;
 }
예제 #11
0
 public CurveViewModel(IEventAggregator eventAggregator, IResultFactory resultFactory)
 {
     this.eventAggregator = eventAggregator;
     this.resultFactory   = resultFactory;
 }
예제 #12
0
 public CurveSettingsViewModel(IResultFactory resultFactory, ISettingsManager settingsManager, Func <CurveViewModel> curveModelFactory, IEventAggregator eventAggregator) : base(resultFactory)
 {
     this.settingsManager   = settingsManager;
     this.curveModelFactory = curveModelFactory;
     DisplayName            = "Curve settings";
     CreateCurvesModel();
     eventAggregator.Subscribe(this);
 }
예제 #13
0
 public CurveViewModel(IEventAggregator eventAggregator, IResultFactory resultFactory)
 {
     this.eventAggregator = eventAggregator;
     this.resultFactory = resultFactory;
 }
예제 #14
0
 public CurveViewModel(IEventAggregator eventAggregator)
 {
     this.eventAggregator = eventAggregator;
 }
예제 #15
0
 public SystemHelper(IThreadTimingFactory threadTimingFactory, IEventAggregator eventAggregator)
 {
     this.threadTimingFactory = threadTimingFactory;
     this.eventAggregator     = eventAggregator;
 }