public HomeViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService)
        {
            _demosService  = demosService;
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;

            if (IsInDesignModeStatic)
            {
                DispatcherHelper.Initialize();
            }

            NotificationMessage = "Loading...";
            IsBusy          = true;
            HasNotification = true;

            Demos                   = new ObservableCollection <Demo>();
            SelectedDemos           = new ObservableCollection <Demo>();
            DataGridDemosCollection = CollectionViewSource.GetDefaultView(Demos);
            DataGridDemosCollection.SortDescriptions.Add(new SortDescription("Date", ListSortDirection.Descending));
            DataGridDemosCollection.Filter = Filter;

            Messenger.Default.Register <MainWindowLoadedMessage>(this, HandleMainWindowLoadedMessage);
            Messenger.Default.Register <RefreshDemosMessage>(this, HandleRefreshDemosMessage);
            Messenger.Default.Register <SelectedAccountChangedMessage>(this, HandleSelectedAccountChangedMessage);
        }
        public SuspectsViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService)
        {
            _steamService  = steamService;
            _cacheService  = cacheService;
            _dialogService = dialogService;
            _demosService  = demosService;

            if (IsInDesignMode)
            {
                DispatcherHelper.Initialize();
                IsAnalyzing = true;
            }

            Suspects                          = new ObservableCollection <Suspect>();
            SelectedSuspects                  = new ObservableCollection <Suspect>();
            DataGridSuspectsCollection        = CollectionViewSource.GetDefaultView(Suspects);
            DataGridSuspectsCollection.Filter = Filter;

            Application.Current.Dispatcher.Invoke(async() =>
            {
                IsRefreshing        = true;
                NotificationMessage = "Refreshing...";
                await LoadSuspects();
                if (!IsInDesignMode)
                {
                    IsRefreshing = false;
                }
                CommandManager.InvalidateRequerySuggested();
            });
        }
Example #3
0
 public HomeController(ILogger <HomeController> logger, IPlayerService playerService, ISteamService steamService, IEnvironmentVariablesService environmentVariablesService)
 {
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     _playerService = playerService ?? throw new ArgumentNullException(nameof(playerService));
     _steamService  = steamService ?? throw new ArgumentNullException(nameof(steamService));
     _environmentVariablesService = environmentVariablesService ?? throw new ArgumentNullException(nameof(environmentVariablesService));
 }
        public DemoDetailsViewModel(
            IDemosService demosService, IDialogService dialogService, ISteamService steamService,
            ICacheService cacheService, ExcelService excelService, IRoundService roundService)
        {
            _demosService  = demosService;
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;
            _excelService  = excelService;
            _roundService  = roundService;

            Sources = Source.Sources;

            if (IsInDesignMode)
            {
                DispatcherHelper.CheckBeginInvokeOnUI(async() =>
                {
                    Demo = await _cacheService.GetDemoDataFromCache(string.Empty);
                    PlayersTeam1Collection = CollectionViewSource.GetDefaultView(Demo.TeamCT.Players);
                    PlayersTeam2Collection = CollectionViewSource.GetDefaultView(Demo.TeamT.Players);
                    RoundsCollection       = CollectionViewSource.GetDefaultView(Demo.Rounds);
                });
            }

            Messenger.Default.Register <LoadDemoFromAppArgument>(this, HandleLoadFromArgumentMessage);
        }
Example #5
0
 public AdminController
 (
     ISteamService steamService,
     IPricingServiceFactory pricingServiceFactory,
     ISettingsService settingsService,
     ILevelService levelService,
     IRepoServiceFactory repoServiceFactory,
     IStaffService staffService,
     IChatService chatService,
     ITicketService ticketService,
     IGrpcService grpcService,
     IItemTransferService itemTransferService,
     IUserService userService
 )
 {
     _steamService          = steamService;
     _pricingServiceFactory = pricingServiceFactory;
     _settingsService       = settingsService;
     _levelService          = levelService;
     _repoServiceFactory    = repoServiceFactory;
     _staffService          = staffService;
     _chatService           = chatService;
     _ticketService         = ticketService;
     _grpcService           = grpcService;
     _itemTransferService   = itemTransferService;
     _userService           = userService;
 }
Example #6
0
 public SyncMatchesCommandHandler(ServerStatsDbContext serverStatsDbContext, StatisticsDbContext statsDbContext,
                                  ISteamService steamService, IHubContext <StatisticsHub> hubContext)
 {
     _serverStatsDbContext = serverStatsDbContext;
     _statsDbContext       = statsDbContext;
     _steamService         = steamService;
     _hubContext           = hubContext;
 }
Example #7
0
        public PlayerHelper(Guid serverId, IBanHelper banHelper, IPlayerRepository playerRepository, ReasonRepository reasonRepository, ISteamService steamService)
        {
            _serverId         = serverId;
            _banHelper        = banHelper;
            _playerRepository = playerRepository;
            _steamService     = steamService;

            Init(reasonRepository);
        }
Example #8
0
        public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService)
        {
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;
            _demosService  = demosService;

            Suspects         = new ObservableCollection <Suspect>();
            SelectedSuspects = new ObservableCollection <Suspect>();
        }
Example #9
0
 public ProfilesUserEventHandler(IESClientFactory clientFactory,
                                 IEnvironment environment,
                                 ISteamService steam,
                                 IProfileService profiles)
 {
     _client    = clientFactory;
     _steam     = steam;
     _profiles  = profiles;
     _indexName = (string)(environment.Configuration.index);
 }
Example #10
0
        public PlayerListViewModel()
        {
            sevendayService = Container.Resolve <ISevendayService>();
            steamService    = Container.Resolve <ISteamService>();
            cache           = Container.Resolve <ICacheService>();
            logger          = Container.Resolve <ILogger>();

            Players     = new ObservableCollection <PlayerViewModel>();
            CanLoadMore = true;
        }
Example #11
0
 public SteamController
 (
     ISteamService steamService,
     IBetOrWithdrawQueueManager betOrWithdrawQueueManager,
     IRepoServiceFactory repoServiceFactory
 )
 {
     _steamService = steamService;
     _betOrWithdrawQueueManager = betOrWithdrawQueueManager;
     _repoServiceFactory        = repoServiceFactory;
 }
 public TeamsController(ISteamService steamService,
                        INotificationService notificationService,
                        UserManager <ApplicationUser> userManager,
                        RoleManager <IdentityRole> roleManager,
                        SignInManager <ApplicationUser> signInManager,
                        IEmailSender sender,
                        BellumGensDbContext context,
                        ILogger <TeamsController> logger) : base(userManager, roleManager, signInManager, sender, context, logger)
 {
     _steamService        = steamService;
     _notificationService = notificationService;
 }
Example #13
0
        public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService)
        {
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;
            _demosService  = demosService;

            Suspects                 = new ObservableCollection <Suspect>();
            SelectedSuspects         = new ObservableCollection <Suspect>();
            DataGridPlayerCollection = CollectionViewSource.GetDefaultView(Suspects);
            DataGridPlayerCollection.SortDescriptions.Add(new SortDescription("Nickname", ListSortDirection.Ascending));
            DataGridPlayerCollection.Filter = Filter;
        }
Example #14
0
        public SteamDiscoveryViewModel(IPlayerRepository playerRepository, ISteamService steamService)
        {
            _playerRepository = playerRepository;
            _steamService     = steamService;
            PlayersFound      = new ObservableCollection <Tuple <string, string> >();
            StartCommand      = new ActionCommand(async() => await StartAsync());
            StopCommand       = new ActionCommand(Stop);

            Max = 8274000000L;
            Min = 7959000000L;

            Current = Min;
        }
Example #15
0
        public Session()
        {
            ISteamService service = Services.GetService <ISteamService>();

            if (service.IsSteamRunning)
            {
                this.SteamIDUser = service.SteamUser.SteamID;
            }
            else
            {
                this.SteamIDUser = new Steamworks.SteamID();
            }
        }
		public SettingsViewModel(
			IDialogService dialogService, ICacheService chacheService, IDemosService demosService,
			ISteamService steamService, IAccountStatsService accountStatsService)
		{
			_dialogService = dialogService;
			_cacheService = chacheService;
			_demosService = demosService;
			_steamService = steamService;
			_accountStatsService = accountStatsService;

			Themes = new List<ComboboxSelector>
			{
				new ComboboxSelector("Dark", Properties.Resources.Dark),
				new ComboboxSelector("Light", Properties.Resources.Light)
			};

			if (IsInDesignMode)
			{
				_dateStatsTo = DateTime.Today.AddDays(30);
				_selectedTheme = new ComboboxSelector("Dark", Properties.Resources.Dark);
			}
			else
			{
				SelectedTheme = Themes.First(t => t.Id == Settings.Default.Theme);
			}

			Languages = new List<ComboboxSelector>();
			foreach (Language language in AppSettings.LANGUAGES.Where(l => l.IsEnabled))
			{
				ComboboxSelector newLanguage = new ComboboxSelector(language.Key, language.Name);
				if (language.Key == Settings.Default.Language) SelectedLanguage = newLanguage;
				Languages.Add(newLanguage);
			}

			Application.Current.Dispatcher.Invoke(async () =>
			{
				List<Account> accounts = await _cacheService.GetAccountListAsync();
				Accounts = new ObservableCollection<Account>(accounts);
				StatusList = new List<DemoStatus>(AppSettings.DefaultStatus);
				SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString());
				DownloadFolderPath = Settings.Default.DownloadFolder;
				IgnoreLaterBan = Settings.Default.IgnoreLaterBan;
				CacheSize = await _cacheService.GetCacheSizeAsync();
				_cacheService.Filter.From = Settings.Default.DateStatsFrom;
				_cacheService.Filter.To = Settings.Default.DateStatsTo;
				_cacheService.Filter.Folder = Settings.Default.LimitStatsFolder ? Settings.Default.LastFolder : null;
			});

			Messenger.Default.Register<SettingsFlyoutOpenedMessage>(this, HandleSettingsFlyoutOpenedMessage);
		}
        public SettingsViewModel(DialogService dialogService, ICacheService chacheService, IDemosService demosService, ISteamService steamService)
        {
            _dialogService = dialogService;
            _cacheService  = chacheService;
            _demosService  = demosService;
            _steamService  = steamService;

            System.Windows.Application.Current.Dispatcher.Invoke(async() =>
            {
                List <Account> accounts = await _cacheService.GetAccountListAsync();
                Accounts             = new ObservableCollection <Account>(accounts);
                SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString());
            });
        }
Example #18
0
        static async Task Main()
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(onClose);

            steamService = OperatingSystem.IsWindows() ? new SteamServiceWindows() : new SteamServiceLinux();
            string redirectUrl = @"http://localhost:8888/";

            keySender    = new InputSenderWindows();
            keyFormatter = new KeyFormatterWindows();
            pathResolver = new PathResolver();

            requestsManager = new SpotifyRequestsManager("7633771350404368ac3e05c9cf73d187",
                                                         "29bd9ec2676c4bf593f3cc2858099838", redirectUrl);

            process = new GameProcess();
            process.Start();

            steamContext = steamService.GetSteamContext();
            var accounts = steamContext.GetAccounts();

            Console.WriteLine("Awaiting user authorization...");
            var server = new AuthServer(redirectUrl);

            string authUrl = requestsManager.GetAuthUrl().Replace("&", "^&");

            Process.Start(new ProcessStartInfo("cmd", $"/c start {authUrl}")
            {
                CreateNoWindow = true
            });
            string code = await server.GetAuthCode();

            await requestsManager.StartTokenRequests(code);

            int accSteamId3 = accounts.FirstOrDefault((x) => x.Name == steamContext.LastAccount).SteamId3;

            string writePath = pathResolver.GetWritePath(process.CurrentProcess, steamContext.UserdataPath, accSteamId3.ToString());

            configWriter = new ConfigWriter(writePath);

            Console.WriteLine("Press the bind key");
            var consoleInput = Console.ReadKey(true);

            currentKeyVirtual = (ushort)consoleInput.Key;
            currentKey        = keyFormatter.GetSourceKey(currentKeyVirtual);

            trackInfoUpdater = new SpotifyTrackUpdater(requestsManager);
            trackInfoUpdater.OnPlaybackStateUpdate += onPlaybackStateUpdate;
            trackInfoUpdater.StartPlaybackUpdate();
        }
 public MatchmakingResolver(
     ILogger logger,
     IUserSessions sessions,
     IUserService users,
     RulesService rulesService,
     ISteamService steamService,
     ManagementClientAccessor management)
 {
     _logger       = logger;
     _sessions     = sessions;
     _users        = users;
     _rulesService = rulesService;
     _steamService = steamService;
     _management   = management;
 }
Example #20
0
        private void ApplyConfig(IEnvironment environment, ISceneHost scene)
        {
            var steamConfig = environment.Configuration.steam;

            _steamService = scene.DependencyResolver.Resolve <ISteamService>();
            if (steamConfig?.usemockup != null && (bool)(steamConfig.usemockup))
            {
                _authenticator = new SteamUserTicketAuthenticatorMockup();
            }
            else
            {
                _authenticator =

                    new SteamUserTicketAuthenticator(_steamService);
            }
            _vacEnabled = steamConfig?.vac != null && (bool)steamConfig.vac;
        }
        public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService,
                                ICacheService cacheService, ExcelService excelService)
        {
            _demosService  = demosService;
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;
            _excelService  = excelService;

            if (IsInDesignModeStatic)
            {
                Application.Current.Dispatcher.Invoke(async() =>
                {
                    CurrentDemo = await _demosService.AnalyzeDemo(new Demo(), CancellationToken.None);
                });
            }

            Messenger.Default.Register <SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage);
        }
        public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService)
        {
            _demosService  = demosService;
            _dialogService = dialogService;
            _steamService  = steamService;
            _cacheService  = cacheService;
            _excelService  = excelService;

            if (IsInDesignModeStatic)
            {
                var demo = _demosService.AnalyzeDemo(new Demo());
                CurrentDemo         = demo.Result;
                IsAnalyzing         = true;
                HasNotification     = true;
                NotificationMessage = "Loading...";
            }

            Messenger.Default.Register <SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage);
        }
Example #23
0
        public SuspectListViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService)
        {
            _steamService  = steamService;
            _cacheService  = cacheService;
            _dialogService = dialogService;
            _demosService  = demosService;

            if (IsInDesignMode)
            {
                DispatcherHelper.Initialize();
                IsAnalyzing = true;
            }

            Suspects                   = new ObservableCollection <Suspect>();
            SelectedSuspects           = new ObservableCollection <Suspect>();
            DataGridSuspectsCollection = CollectionViewSource.GetDefaultView(Suspects);
            DataGridSuspectsCollection.SortDescriptions.Add(new SortDescription("DaySinceLastBanCount", ListSortDirection.Ascending));
            DataGridSuspectsCollection.Filter = Filter;
            Messenger.Default.Register <LoadSuspectListMessage>(this, HandleLoadSuspectListMessage);
        }
Example #24
0
    protected override void ELCPSendServerMessage(int type, string command)
    {
        if (this.GameClient == null)
        {
            return;
        }
        type = Mathf.Clamp(type, 0, 4);
        if (command.StartsWith("%"))
        {
            command = AgeLocalizer.Instance.LocalizeString(command);
        }
        ISteamService service  = Services.GetService <ISteamService>();
        IGameService  service2 = Services.GetService <IGameService>();
        string        text     = string.Empty;

        if (service2 != null)
        {
            IPlayerControllerRepositoryService service3 = service2.Game.Services.GetService <IPlayerControllerRepositoryService>();
            if (service3 != null)
            {
                global::PlayerController activePlayerController = service3.ActivePlayerController;
                if (activePlayerController != null)
                {
                    text = (activePlayerController.Empire as global::Empire).Color.GetAgeCompatibleColorCode(true);
                    if (service != null && service.IsSteamRunning)
                    {
                        text += Steamworks.SteamAPI.SteamFriends.GetFriendPersonaName(service.SteamUser.SteamID);
                    }
                    else
                    {
                        text += (activePlayerController.Empire as global::Empire).LocalizedName;
                    }
                    text += "#REVERT#: ";
                    text  = AgeLocalizer.Instance.LocalizeString(text);
                }
            }
        }
        Message message = new GameClientChatMessage((ChatMessageType)type, text + command);

        this.GameClient.SendMessageToServer(ref message);
    }
Example #25
0
        public MainWindow()
        {
            InitializeComponent();

            HeaderBlock.CloseButton.MouseLeftButtonDown +=
                new MouseButtonEventHandler((o, s) => Application.Current.Shutdown());
            HeaderBlock.CollapseButton.MouseLeftButtonDown       +=
                new MouseButtonEventHandler((o, s) => WindowState = WindowState.Minimized);

            _spotify = new SpotifyRequestsManager("7633771350404368ac3e05c9cf73d187",
                                                  "29bd9ec2676c4bf593f3cc2858099838", @"http://localhost:8888/");
            _steamService    = new SteamServiceWindows();
            _pathResolver    = new PathResolver();
            _keySender       = new InputSenderWindows();
            _appConfigWorker = new UserSettingsWorker();
            _appConfig       = _appConfigWorker.ReadConfigFile();
            _userContext     = _steamService.GetSteamContext();

            _accounts = _userContext.GetAccounts();

            _gameProcess = new GameProcess();
            _gameProcess.Start();

            int    steamid3  = _accounts.FirstOrDefault((x) => x.Name == _userContext.LastAccount).SteamId3;
            string writePath = _pathResolver.GetWritePath(_gameProcess.CurrentProcess, _userContext.UserdataPath, steamid3.ToString());

            _configWriter = new ConfigWriter(writePath, _appConfig.CfgText);

            _playbackStateUpdater = new SpotifyTrackUpdater(_spotify);
            _playbackStateUpdater.OnPlaybackStateUpdate += UpdateTrackInfo;

            UserSettingsBlock.CurrentAccountText.Text = _userContext.LastAccount;
            UserSettingsBlock.UpdateKey(_appConfig.LastUsedKey);

            if (_appConfig.IsAutoSendEnabled)
            {
                UserSettingsBlock.AutosendCheck.Toggle();
            }
        }
Example #26
0
        public ServerMonitorPlayerViewModel(ServerInfoDto serverInfo,
                                            IBanHelper banHelper, IEventAggregator eventAggregator, IPlayerRepository playerRepository,
                                            ReasonRepository reasonRepository,
                                            ISteamService steamService)
            : base(
                new ActionCommand(() => SendCommand(eventAggregator, serverInfo.Id, CommandType.Players)),
                new PlayerViewComparer())
        {
            _serverInfo      = serverInfo;
            _eventAggregator = eventAggregator;
            _playerHelper    = new PlayerHelper(serverInfo.Id, banHelper, playerRepository, reasonRepository, steamService);

            KickUserCommand   = new DelegateCommand(ShowKickDialog, CanShowDialog);
            BanUserCommand    = new DelegateCommand(ShowBanDialog, CanShowDialog);
            PlayerInfoCommand = new DelegateCommand(PlayerInfoDialog, CanShowDialog);


            PropertyChanged += ServerMonitorPlayerViewModel_PropertyChanged;

            _eventAggregator.GetEvent <BEMessageEvent <BEItemsMessage <Player> > >().Subscribe(async e =>
            {
                if (e.ServerId == serverInfo.Id)
                {
                    await SetDataAsync(e.Items);
                    WaitingForEvent = false;
                }
            });

            _eventAggregator.GetEvent <BEMessageEvent <BEItemsMessage <Admin> > >().Subscribe(e =>
            {
                if (e.ServerId == serverInfo.Id)
                {
                    _admins = e.Items ?? new Admin[0];
                }
            });
        }
Example #27
0
 public GetPlayerSteamStatusQueryHandler(ISteamService steamService, StatisticsDbContext statisticsDbContext)
 {
     _steamService        = steamService;
     _statisticsDbContext = statisticsDbContext;
 }
		public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService)
		{
			_demosService = demosService;
			_dialogService = dialogService;
			_steamService = steamService;
			_cacheService = cacheService;
			_excelService = excelService;

			if (IsInDesignModeStatic)
			{
				var demo = _demosService.AnalyzeDemo(new Demo());
				CurrentDemo = demo.Result;
				IsAnalyzing = true;
				HasNotification = true;
				NotificationMessage = "Loading...";
			}

			Messenger.Default.Register<SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage);
		}
Example #29
0
 public BeatSaberService(ISteamService steamService)
 {
     this.steamService = steamService;
 }
		public WhitelistViewModel(DialogService dialogService, ICacheService cacheService, ISteamService steamService, IDemosService demosService)
		{
			_dialogService = dialogService;
			_steamService = steamService;
			_cacheService = cacheService;
			_demosService = demosService;

			Suspects = new ObservableCollection<Suspect>();
			SelectedSuspects = new ObservableCollection<Suspect>();
		}
		public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService, ExcelService excelService)
		{
			_demosService = demosService;
			_dialogService = dialogService;
			_steamService = steamService;
			_cacheService = cacheService;
			_excelService = excelService;

			if (IsInDesignModeStatic)
			{
				var demo = _demosService.AnalyzeDemo(new Demo());
				CurrentDemo = demo.Result;
			}
		}
		public DetailsViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService,
			ICacheService cacheService, ExcelService excelService)
		{
			_demosService = demosService;
			_dialogService = dialogService;
			_steamService = steamService;
			_cacheService = cacheService;
			_excelService = excelService;

			if (IsInDesignModeStatic)
			{
				Application.Current.Dispatcher.Invoke(async () =>
				{
					CurrentDemo = await _demosService.AnalyzeDemo(new Demo(), CancellationToken.None);
				});
			}

			Messenger.Default.Register<SelectedPlayerChangedMessage>(this, HandleSelectedPlayerChangedMessage);
		}
 public SteamUserTicketAuthenticator(ISteamService steamService)
 {
     _steamService = steamService;
 }
		public SuspectsViewModel(ISteamService steamService, ICacheService cacheService, DialogService dialogService, IDemosService demosService)
		{
			_steamService = steamService;
			_cacheService = cacheService;
			_dialogService = dialogService;
			_demosService = demosService;

			if (IsInDesignModeStatic)
			{
				DispatcherHelper.Initialize();
			}

			Suspects = new ObservableCollection<Suspect>();
			SelectedSuspects = new ObservableCollection<Suspect>();
			DataGridSuspectsCollection = CollectionViewSource.GetDefaultView(Suspects);

			DispatcherHelper.CheckBeginInvokeOnUI(
			async () =>
			{
				IsRefreshing = true;
				NotificationMessage = "Refreshing...";
				await LoadSuspects();
				IsRefreshing = false;
				CommandManager.InvalidateRequerySuggested();
			});
		}
		public HomeViewModel(IDemosService demosService, DialogService dialogService, ISteamService steamService, ICacheService cacheService)
		{
			_demosService = demosService;
			_dialogService = dialogService;
			_steamService = steamService;
			_cacheService = cacheService;

			if (IsInDesignModeStatic)
			{
				DispatcherHelper.Initialize();
			}

			NotificationMessage = "Loading...";
			IsBusy = true;
			HasNotification = true;

			Demos = new ObservableCollection<Demo>();
			SelectedDemos = new ObservableCollection<Demo>();
			DataGridDemosCollection = CollectionViewSource.GetDefaultView(Demos);
			DataGridDemosCollection.SortDescriptions.Add(new SortDescription("Date", ListSortDirection.Descending));
			DataGridDemosCollection.Filter = Filter;

			Messenger.Default.Register<MainWindowLoadedMessage>(this, HandleMainWindowLoadedMessage);
			Messenger.Default.Register<RefreshDemosMessage>(this, HandleRefreshDemosMessage);
		}
 public SteamPageFactory(ISteamService steamService, ILogger <SteamPageFactory> logger)
 {
     this.steamService = steamService ?? throw new ArgumentNullException(nameof(steamService));
     this.logger       = logger ?? throw new ArgumentNullException(nameof(logger));
 }
		public SettingsViewModel(DialogService dialogService, ICacheService chacheService, IDemosService demosService, ISteamService steamService)
		{
			_dialogService = dialogService;
			_cacheService = chacheService;
			_demosService = demosService;
			_steamService = steamService;

			System.Windows.Application.Current.Dispatcher.Invoke(async () =>
			{
				List<Account> accounts = await _cacheService.GetAccountListAsync();
				Accounts = new ObservableCollection<Account>(accounts);
				SelectedStatsAccount = Accounts.FirstOrDefault(a => a.SteamId == Settings.Default.SelectedStatsAccountSteamID.ToString());
			});
		}
Example #38
0
		public DemosService(ISteamService steamService)
		{
			_steamService = steamService;
		}