public BanHelper(IEventAggregator eventAggregator, IPlayerRepository playerRepository, ISettingsStoreSource settingsStoreSource) { _eventAggregator = eventAggregator; _playerRepository = playerRepository; _settingsStoreSource = settingsStoreSource; _messageHelper = new MessageHelper(); }
public LobbyKicker(IEventAggregator aggregator, ISettingsStoreSource settingsStoreSource) { _aggregator = aggregator; _settingsStoreSource = settingsStoreSource; _aggregator.GetEvent <BEMessageEvent <BEItemsMessage <Player> > >() .Subscribe(PlayersUpdate); }
public Options(OptionsModel optionsModel, ISettingsStoreSource settingsStoreSource) : base(settingsStoreSource) { InitializeComponent(); _optionsModel = optionsModel; DataContext = _optionsModel; }
public OptionsModel(IEventAggregator eventAggregator, ISettingsStoreSource settingsStoreSource, MessageHelper messageHelper, IServerInfoRepository infoRepository) { _eventAggregator = eventAggregator; _settingsStoreSource = settingsStoreSource; _messageHelper = messageHelper; _infoRepository = infoRepository; Init(); }
public ChatHistory(ChatHistoryViewModel model, ISettingsStoreSource settingsStoreSource) : base(settingsStoreSource) { _model = model; InitializeComponent(); _model.PropertyChanged += _model_PropertyChanged; DataContext = _model; }
public PlayerViewWindow(PlayerViewModel model, ISettingsStoreSource settingsStoreSource) : base(settingsStoreSource) { InitializeComponent(); dgBans.ContextMenu = dgBans.Generate <Ban>(); dgHist.ContextMenu = dgHist.Generate <PlayerHistory>(); dgNotes.ContextMenu = dgNotes.Generate <Note>(); DataContext = model; }
public SteamServiceViewModel(ISettingsStoreSource settingsStoreSource) { _settingsStoreSource = settingsStoreSource; SelectFolderCommand = new DelegateCommand(SelectFolder, () => !InProgress); GenerateDataCommand = new DelegateCommand(GenerateData, () => !string.IsNullOrEmpty(Folder) && !InProgress); CancelCommand = new DelegateCommand(Cancel, () => InProgress); var settings = _settingsStoreSource.GetSettingsStore(); Folder = settings.SteamFolder; }
public BEServiceLogic(IEventAggregator aggregator, IBEService beService, ISettingsStoreSource settingsStoreSource, IBELogic beLogic) { _aggregator = aggregator; _beService = beService; _settingsStoreSource = settingsStoreSource; _beLogic = beLogic; _playersUpdater = new TimedAction(_settingsStoreSource.GetSettingsStore().PlayersUpdateSeconds, UpdatePlayers); _bansUpdater = new TimedAction(_settingsStoreSource.GetSettingsStore().BansUpdateSeconds, UpdateBans); _aggregator.GetEvent <SettingsChangedEvent>() .Subscribe(SettingsChanged); _beLogic.ServerUpdateHandler += _beLogic_ServerUpdateHandler; }
public ServerMonitorBansViewModel(ServerInfoDto serverInfo, IEventAggregator eventAggregator, IServerInfoRepository infoRepository, IBanHelper banHelper, ISettingsStoreSource settingsStoreSource) : base( new ActionCommand(() => SendCommand(eventAggregator, serverInfo.Id, CommandType.Bans)), new BanViewComparer()) { _serverInfoId = serverInfo.Id; _eventAggregator = eventAggregator; _helper = banHelper; AvailibleBans = new BanView[0]; SyncBans = new ActionCommand(() => { var bans = SelectedAvailibleBans; if (bans != null) { Task.Factory.StartNew(async() => { await _helper.BanGUIDOfflineAsync(_serverInfoId, bans.ToArray(), true); }, TaskCreationOptions.LongRunning); } }); CustomBan = new ActionCommand(() => { var w = new BanPlayerWindow(_serverInfoId, _helper, null, false, null, null, infoRepository, settingsStoreSource); w.ShowDialog(); }); RefreshAvailiableCommand = new ActionCommand(async() => { AvailibleBans = await GetAvailibleBans(); RaisePropertyChanged(nameof(AvailibleBans)); RaisePropertyChanged(nameof(AvailibleBansCount)); }); _eventAggregator.GetEvent <BEMessageEvent <BEItemsMessage <Ban> > >() .Subscribe(async e => { if (_serverInfoId == e.ServerId) { await SetDataAsync(e.Items); WaitingForEvent = false; } }); }
public ServerMonitorChatViewModel(ServerInfoDto serverInfo, IEventAggregator eventAggregator, ISettingsStoreSource settingsStoreSource, IServerInfoRepository infoRepository) { _serverId = serverInfo.Id; _eventAggregator = eventAggregator; _settingsStoreSource = settingsStoreSource; AutoScroll = true; EnableChat = true; _chatHelper = new ChatHelper(_serverId); _eventAggregator.GetEvent <BEMessageEvent <BEChatMessage> >() .Subscribe(async e => await BeServerChatMessageHandlerAsync(e), ThreadOption.UIThread); _eventAggregator.GetEvent <BEMessageEvent <BEAdminLogMessage> >() .Subscribe(_beServer_PlayerLog, ThreadOption.UIThread); _eventAggregator.GetEvent <BEMessageEvent <BEPlayerLogMessage> >() .Subscribe(_beServer_PlayerLog, ThreadOption.UIThread); _eventAggregator.GetEvent <BEMessageEvent <BEBanLogMessage> >() .Subscribe(_beServer_PlayerLog, ThreadOption.UIThread); _eventAggregator.GetEvent <BEMessageEvent <BEItemsMessage <Player> > >() .Subscribe(_beServer_PlayerHandler, ThreadOption.UIThread); var global = new Player(-1, null, 0, 0, null, "GLOBAL", Player.PlayerState.Ingame); Players = new List <Player> { global }; SelectedPlayer = global; ShowHistoryCommand = new ActionCommand(() => { var model = new ChatHistoryViewModel(_serverId, infoRepository); model.StartDate = DateTime.UtcNow.UtcToLocalFromSettings().AddHours(-5); var wnd = new ChatHistory(model); wnd.Show(); wnd.Activate(); }); SendCommandMessage = new DelegateCommand(() => SendCommand(), () => string.IsNullOrEmpty(CommandMessage) == false); }
public SteamService(ISettingsStoreSource settingsStoreSource) { var folder = settingsStoreSource.GetSettingsStore().SteamFolder; if (string.IsNullOrEmpty(folder)) { return; } var idsFIleName = Path.Combine(folder, "ids.bin"); var indexFIleName = Path.Combine(folder, "index.bin"); _isReady = File.Exists(idsFIleName) && File.Exists(indexFIleName); if (_isReady) { var md5 = new StandardHashProvider(); _idByHashSearcher = new IdByHashSearcher(idsFIleName, indexFIleName, md5, _log); } }
public OptionsModel(IEventAggregator eventAggregator, ISettingsStoreSource settingsStoreSource) { _eventAggregator = eventAggregator; _settingsStoreSource = settingsStoreSource; using (var servierInfoRepository = new ServerInfoRepository()) { Servers = servierInfoRepository.GetServerInfo().Select(x => new ServerInfoModel(x)).ToList(); } using (var dc = new ReasonRepository()) { BanReasons = dc.GetBanReasons().Select(x => new ReasonEdit() { Text = x }).ToList(); KickReasons = dc.GetKickReasons().Select(x => new ReasonEdit() { Text = x }).ToList(); BanTimes = dc.GetBanTimes().Select(x => new BanTimeEdit() { Text = x.Title, Minutes = x.TimeInMinutes }).ToList(); } var zones = TimeZoneInfo.GetSystemTimeZones().ToArray(); for (var i = 0; i < zones.Length; i++) { if (zones[i].Id == Settings.TimeZoneInfo.Id) { zones[i] = Settings.TimeZoneInfo; } } TimeZones = zones; }
public KickPlayerWindow(IBanHelper playerHelper, Guid serverId, int playerNum, string playerGuid, string playerName, ISettingsStoreSource settingsStoreSource) : base(settingsStoreSource) { _playerHelper = playerHelper; _serverId = serverId; _playerNum = playerNum; _playerGuid = playerGuid; InitializeComponent(); var model = new KickPlayerViewModel(playerName); DataContext = model; }
public BanPlayerWindow(Guid?serverId, IBanHelper banHelper, string playerGuid, bool isOnline, string playerName, string playerNum, IServerInfoRepository infoRepository, ISettingsStoreSource settingsStoreSource) : base(settingsStoreSource) { InitializeComponent(); _model = new BanPlayerViewModel(serverId, playerGuid, isOnline, banHelper, playerName, playerNum, infoRepository); tbGuid.IsEnabled = string.IsNullOrEmpty(playerGuid); DataContext = _model; }
public MainViewModel(IEventAggregator eventAggregator, IServerInfoRepository infoRepository, ISettingsStoreSource settingsStoreSource) { _infoRepository = infoRepository; ReloadAsync(); OptionsCommand = new DelegateCommand(() => { eventAggregator.GetEvent <ShowOptionsEvent>().Publish(new ShowOptionsEvent()); }); eventAggregator.GetEvent <BEServersChangedEvent>().Subscribe(async(state) => { await ReloadAsync(); }); var tm = settingsStoreSource.GetSettingsStore().TopMost; foreach (Window wnd in Application.Current.Windows) { wnd.Topmost = tm; } }
public WindowBase(ISettingsStoreSource settingsStoreSource) { this.Topmost = settingsStoreSource.GetSettingsStore().TopMost; }