예제 #1
0
        public MenuViewModel(IApplicationState state, IPluginManager pluginManager, IApplicationConfig config, IPresetsManager presetManager)
        {
            _pluginManager = pluginManager;
            _state = state;
            _config = config;
            _presetsManager = presetManager;

            //Commands
            _openCommand = new DelegateCommand(Open);
            _openFileCommand = new DelegateCommand(OpenFile);
            _openStreamCommand = new DelegateCommand(OpenStream);
            _openDiscCommand = new DelegateCommand(OpenDisc);
            _openDeviceCommand = new DelegateCommand(OpenDevice);
            _openProcessCommand = new DelegateCommand(OpenProcess);
            _browseSamplesCommand = new DelegateCommand(BrowseSamples);
            _exitCommand = new DelegateCommand(Exit);
            _changeFormatCommand = new DelegateCommand(SetStereoInput);
            _changeProjectionCommand = new DelegateCommand(SetProjection);
            _changeEffectCommand = new DelegateCommand(SetEffect);
            _changeLayoutCommand = new DelegateCommand(SetStereoOutput);
            _changeDistortionCommand = new DelegateCommand(SetDistortion);
            _changeTrackerCommand = new DelegateCommand(SetTracker);
            _saveMediaPresetCommand = new DelegateCommand(SaveMediaPreset);
            _saveDevicePresetCommand = new DelegateCommand(SaveDevicePreset);
            _saveAllPresetCommand = new DelegateCommand(SaveAllPreset);
            _loadMediaPresetCommand = new DelegateCommand(LoadMediaPreset);
            _resetPresetCommand = new DelegateCommand(ResetPreset);
            _settingsCommand = new DelegateCommand(ShowSettings);
            _launchWebBrowserCommand = new DelegateCommand(LaunchWebBrowser);
            _aboutCommand = new DelegateCommand(ShowAbout);
        }
예제 #2
0
        public MenuViewModel(IApplicationState state, IPluginManager pluginManager, IApplicationConfig config, IPresetsManager presetManager)
        {
            _pluginManager  = pluginManager;
            _state          = state;
            _config         = config;
            _presetsManager = presetManager;

            //Commands
            _openCommand             = new DelegateCommand(Open);
            _openFileCommand         = new DelegateCommand(OpenFile);
            _openStreamCommand       = new DelegateCommand(OpenStream);
            _openDiscCommand         = new DelegateCommand(OpenDisc);
            _openDeviceCommand       = new DelegateCommand(OpenDevice);
            _openProcessCommand      = new DelegateCommand(OpenProcess);
            _browseSamplesCommand    = new DelegateCommand(BrowseSamples);
            _exitCommand             = new DelegateCommand(Exit);
            _changeFormatCommand     = new DelegateCommand(SetStereoInput);
            _changeProjectionCommand = new DelegateCommand(SetProjection);
            _changeEffectCommand     = new DelegateCommand(SetEffect);
            _changeLayoutCommand     = new DelegateCommand(SetStereoOutput);
            _changeDistortionCommand = new DelegateCommand(SetDistortion);
            _changeTrackerCommand    = new DelegateCommand(SetTracker);
            _saveMediaPresetCommand  = new DelegateCommand(SaveMediaPreset);
            _saveDevicePresetCommand = new DelegateCommand(SaveDevicePreset);
            _saveAllPresetCommand    = new DelegateCommand(SaveAllPreset);
            _loadMediaPresetCommand  = new DelegateCommand(LoadMediaPreset);
            _resetPresetCommand      = new DelegateCommand(ResetPreset);
            _settingsCommand         = new DelegateCommand(ShowSettings);
            _launchWebBrowserCommand = new DelegateCommand(LaunchWebBrowser);
            _aboutCommand            = new DelegateCommand(ShowAbout);
        }
예제 #3
0
 public ViewModelFactory(IApplicationConfig config, IPluginManager pluginManager, IApplicationState state, IPresetsManager presetsManager, IMediaService mediaService)
 {
     _config         = config;
     _pluginManager  = pluginManager;
     _state          = state;
     _presetsManager = presetsManager;
     _mediaService   = mediaService;
 }
예제 #4
0
 public ViewModelFactory(IApplicationConfig config, IPluginManager pluginManager, IApplicationState state, IPresetsManager presetsManager, IMediaService mediaService)
 {
     _config = config;
     _pluginManager = pluginManager;
     _state = state;
     _presetsManager = presetsManager;
     _mediaService = mediaService;
 }
예제 #5
0
        public App()
        {
            try
            {
                var      applicationPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath;
                string[] pluginFolders   = { "Medias", "Effects", "Distortions", "Trackers", "Projections", "Stabilizers" };

                //Init services and inject dependancies
                _appConfig       = new AppSettingsApplicationConfig();
                _pluginManager   = new DynamicPluginManager(applicationPath, pluginFolders);
                _appState        = new DefaultApplicationState(_appConfig, _pluginManager);
                _settingsManager = new SettingsManager(_appState, _pluginManager, _appConfig, Settings.Default);
                _presetsManager  = new PresetsManager(_appConfig, _appState, _pluginManager);
                _mediaService    = new MediaService(_appState, _pluginManager, _presetsManager);

                ViewModelFactory = new ViewModelFactory(_appConfig, _pluginManager, _appState, _presetsManager,
                                                        _mediaService);

                //Проверка лицензии ассинхронно, чтобы не задерживать движения - на коленке сделано
                //Task.Factory.StartNew(() =>
                //{
                //    try
                //    {
                //        if (File.Exists("Vr.lic") == false)
                //        {

                //            throw new VrLicenseException("Файл лицензии не найден!");
                //        }

                //        using (StreamReader sr = new StreamReader("Vr.lic"))
                //        {
                //            LicenseProvider licenseProvider = new LicenseProvider();
                //            var licese = licenseProvider.GetLicenseValue();
                //            String line = sr.ReadToEnd();
                //            if (licese.Equals(line) == false)
                //            {
                //                throw new VrLicenseException("Неверный файл лицензии!");
                //            }
                //        }
                //    }
                //    catch (Exception e)
                //    {

                //        Logger.Instance.Error("Error while initializing application.", e);
                //        Environment.Exit(1);
                //    }
                //});
            }
            //catch (Exception le)
            //{
            //    MessageBox.Show(le.Message);
            //    Application.Current.Shutdown(-1);
            //}
            catch (Exception exc)
            {
                Logger.Instance.Error("Error while initializing application.", exc);
            }
        }
예제 #6
0
        private App()
        {
            try
            {
                var      applicationPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath;
                string[] pluginFolders   = { "Medias", "Effects", "Distortions", "Trackers", "Projections", "Stabilizers" };

                //Init services and inject dependancies
                _appConfig       = new AppSettingsApplicationConfig();
                _pluginManager   = new DynamicPluginManager(applicationPath, pluginFolders);
                _appState        = new DefaultApplicationState(_appConfig, _pluginManager);
                _settingsManager = new SettingsManager(_appState, _pluginManager, _appConfig, Settings.Default);
                _presetsManager  = new PresetsManager(_appConfig, _appState, _pluginManager);
                _mediaService    = new MediaService(_appState, _pluginManager, _presetsManager);

                ViewModelFactory = new ViewModelFactory(_appConfig, _pluginManager, _appState, _presetsManager, _mediaService);
            }
            catch (Exception exc)
            {
                Logger.Instance.Error("Error while initializing application.", exc);
            }
        }
예제 #7
0
 private App()
 {
     try
     {
         var applicationPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath;
         string[] pluginFolders = { "Medias", "Effects", "Distortions", "Trackers", "Projections", "Stabilizers" };
     
         //Init services and inject dependancies
         _appConfig = new AppSettingsApplicationConfig();
         _pluginManager = new DynamicPluginManager(applicationPath, pluginFolders);
         _appState = new DefaultApplicationState(_appConfig, _pluginManager);
         _settingsManager = new SettingsManager(_appState, _pluginManager, _appConfig, Settings.Default);
         _mediaService = new MediaService(_appState, _pluginManager);
         _presetsManager = new PresetsManager(_appConfig, _appState, _pluginManager);
         
         ViewModelFactory = new ViewModelFactory(_appConfig, _pluginManager, _appState, _presetsManager, _mediaService);
     }
     catch (Exception exc)
     {
         Logger.Instance.Error("Error while initializing application.", exc);
     }
 }
예제 #8
0
 public MediaService(IApplicationState state, IPluginManager pluginManager, IPresetsManager presetsManager)
 {
     _state          = state;
     _pluginManager  = pluginManager;
     _presetsManager = presetsManager;
 }