Esempio n. 1
0
        public ProfileService(IContainer container)
        {
            _settingsService = container.Resolve <ILauncherSettingsService>();

            _eventRegistry = container.Resolve <ApplicationEventRegistry>();
            _eventRegistry.ApplicationStartup += ApplicationStartup;
        }
 public GameController(IContainer container)
 {
     _settingsService = container.Resolve <ILauncherSettingsService>();
     _dcsWorldManager = container.Resolve <IDcsWorldManager>();
     _eventRegistry   = container.Resolve <ApplicationEventRegistry>();
     _profileService  = container.Resolve <IProfileService>();
 }
        public MainWindowViewModel(IContainer container)
        {
            _container              = container;
            _eventRegistry          = container.Resolve <ApplicationEventRegistry>();
            _navigationService      = container.Resolve <INavigationService>();
            _autoUpdateService      = container.Resolve <IAutoUpdateService>();
            _profileSettingsService = container.Resolve <IProfileSettingsService>();
            _settingsService        = container.Resolve <ISettingsService>();

            _profileSettingsService.SelectedProfileChanged += OnSelectedProfileChanged;
            _profileSettingsService.ProfilesChanged        += OnProfilesChanged;

            var pluginNavigationSite = container.Resolve <IPluginNavigationSite>();

            ShowPluginCommand.Subscribe(OnShowPlugin);

            pluginNavigationSite.PluginRegistered += OnPluginRegistered;

            var files =
                new List <string>(
                    Directory.GetFiles(ApplicationPaths.WallpaperPath)
                    .Where(s => string.IsNullOrEmpty(_supportedExtensions) || _supportedExtensions.Contains(Path.GetExtension(s))));

            if (files.Count == 0)
            {
                files.AddRange(
                    Directory.GetFiles(
                        Path.Combine(ApplicationPaths.ApplicationPath, "Resources", "Images", "Wallpaper"))
                    .Where(s => string.IsNullOrEmpty(_supportedExtensions) || _supportedExtensions.Contains(Path.GetExtension(s))));
            }

            var rand = new Random();

            while (files.Count > 0)
            {
                var index = rand.Next(files.Count);
                var file  = files[index];
                files.RemoveAt(index);
                _images.Add(file);
            }

            if (_images.Count > 0)
            {
                _slideShowTimer.Interval = TimeSpan.FromMinutes(1);
                _slideShowTimer.Tick    += _timer_Tick;
                _slideShowTimer.Start();

                NextImage();
            }

            SelectProfileCommand.Subscribe(OnSelectProfile);

            _autoUpdateCheckTimer.Interval = TimeSpan.FromMinutes(30);
            _autoUpdateCheckTimer.Tick    += _autoUpdateCheckTimer_Tick;
            _autoUpdateCheckTimer.Start();

            UpdateProfiles();
        }
Esempio n. 4
0
        public SettingsViewModel(IContainer container)
        {
            _eventRegistry          = container.Resolve <ApplicationEventRegistry>();
            _controller             = container.Resolve <SettingsController>();
            _settingsService        = container.Resolve <ILauncherSettingsService>();
            _profileSettingsService = container.Resolve <IProfileService>();

            var eventRegistry = container.Resolve <ApplicationEventRegistry>();

            eventRegistry.CurrentProfileChanged += OnSelectedProfileChanged;
        }
Esempio n. 5
0
 public PluginNavigationSite(IContainer container)
 {
     _container     = container;
     _eventRegistry = container.Resolve <ApplicationEventRegistry>();
 }