Exemple #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>();
 }
Exemple #3
0
        public MainWindowViewModel(IContainer container)
        {
            _container              = container;
            _eventRegistry          = container.Resolve <ApplicationEventRegistry>();
            _navigationService      = container.Resolve <INavigationService>();
            _autoUpdateService      = container.Resolve <IAutoUpdateService>();
            _profileSettingsService = container.Resolve <IProfileService>();
            _settingsService        = container.Resolve <ILauncherSettingsService>();

            _eventRegistry.CurrentProfileChanged += OnSelectedProfileChanged;
            _eventRegistry.ProfilesChanged       += OnProfilesChanged;

            ShowPluginCommand.Subscribe(OnShowPlugin);

            _eventRegistry.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();
        }
Exemple #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;
        }
 public AboutController(IContainer container)
 {
     _settingsService = container.Resolve <ILauncherSettingsService>();
     _dcsWorldManager = container.Resolve <IDcsWorldManager>();
 }