コード例 #1
0
        public ServerMonitorSteamQueryViewModel(ServerInfo serverInfo, IIpService ipService)
        {
            _ipService = ipService;
            Host       = serverInfo.Host;
            Port       = serverInfo.SteamPort;

            OnPropertyChanged(nameof(Host));
            OnPropertyChanged(nameof(Port));

            ExcecuteCommand = new ActionCommand(() => Task.Run(() =>
            {
                try
                {
                    IsBisy = true;
                    GetStat();
                }
                finally
                {
                    IsBisy = false;
                }
            }),
                                                () =>
            {
                var iphost = Host;

                if (string.IsNullOrEmpty(iphost))
                {
                    return(false);
                }
                return(true);
            });
        }
コード例 #2
0
ファイル: HmaCliService.cs プロジェクト: c0d3m0nky/mty
 public HmaCliService(IIpService ipService, IEnumerable<string> ipExclusions, string hmaExePath, Logger log)
 {
     _ipService = ipService;
     _ipExclusions = ipExclusions;
     _hmaExePath = hmaExePath;
     _log = log;
 }
コード例 #3
0
        public BEService(IUnityContainer container, IIpService ipService, IEventAggregator eventAggregator)
        {
            _container       = container;
            _ipService       = ipService;
            _eventAggregator = eventAggregator;

            _eventAggregator.GetEvent <RunServerEvent>().Subscribe(CheckServer, ThreadOption.BackgroundThread);
            _eventAggregator.GetEvent <CloseServerEvent>().Subscribe(CloseServer, ThreadOption.BackgroundThread);
        }
コード例 #4
0
ファイル: HmaService.cs プロジェクト: c0d3m0nky/mty
 public HmaService(IIpService ipService)
 {
     this.ipService = ipService;
     hmaEnabled = AppConfigHelper.GetAppSetting("HMA/Enabled", true);
     hmaOpenVpnServiceName = AppConfigHelper.GetAppSetting("HMA/OpenVpnServiceName");
     hmaAppFullPath = AppConfigHelper.GetAppSetting("HMA/AppFullPath");
     hmaAppProcessName = AppConfigHelper.GetAppSetting("HMA/AppProcessName");
     stopIps = AppConfigHelper.GetAppSetting("StopIPs").Split(new char[]{','}).Select(x=>x.Trim()).ToList();
 }
コード例 #5
0
        public PlayerViewModel(string userGuid, IIpService ipService, IPlayerRepository playerRepository)
        {
            _userGuid         = userGuid;
            _ipService        = ipService;
            _playerRepository = playerRepository;

            SaveComment      = new ActionCommand(SaveUserComment);
            GoToSteamCommand = new ActionCommand(GoToSteam);
        }
コード例 #6
0
        public PlayerViewModel(string userGuid, IIpService ipService, IPlayerRepository playerRepository, IEventAggregator eventAggregator)
        {
            _userGuid         = userGuid;
            _ipService        = ipService;
            _playerRepository = playerRepository;
            _eventAggregator  = eventAggregator;

            SaveComment      = new ActionCommand(SaveUserComment);
            GoToSteamCommand = new ActionCommand(GoToSteam);
            BanCommand       = new DelegateCommand <string>(BanPlayerView);
        }
コード例 #7
0
        public ServerMonitorManageServerViewModel(ServerInfoDto serverInfo, IEventAggregator eventAggregator,
                                                  IIpService ipService)
        {
            _serverId        = serverInfo.Id;
            _eventAggregator = eventAggregator;
            _ipService       = ipService;

            _eventAggregator.GetEvent <BEMessageEvent <BEItemsMessage <Mission> > >().Subscribe(e =>
            {
                if (e.ServerId == _serverId)
                {
                    Missions = e.Items;
                }
            });

            SetMissionCommand = new ActionCommand(() =>
            {
                var m = SelectedMission;
                if (m != null && ConfirmNotSupported(CommandType.Mission))
                {
                    var mn = m.Name;
                    SendCommand(CommandType.Mission, mn);
                }
            },
                                                  () => SelectedMission != null);

            RefreshCommand = new ActionCommand(() => SendCommand(CommandType.Missions));

            InitCommand     = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Init); });
            ShutdownCommand = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Shutdown); });
            ReassignCommand = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Reassign); });
            RestartCommand  = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Restart); });

            RestartServerCommand = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.RestartServer); });

            LockCommand   = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Lock); });
            UnlockCommand = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.Unlock); });

            LoadBansCommand    = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.LoadBans); });
            LoadScriptsCommand = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.LoadScripts); });
            LoadEventsCommand  = new ActionCommand(() => { SendCommandWithConfirmation(CommandType.LoadEvents); });

            ShowWarning = false;
            Task.Run(() => CheckServer(serverInfo));
        }
コード例 #8
0
 public IpAddressController(IIpService ipService)
 {
     _ipService = ipService;
 }
コード例 #9
0
        public PlayerView()
        {
            _ipService = OnlinePlayersModuleInit.Current.Resolve <IIpService>();

            _geoInfo = new Lazy <GeoInfo>(() => _ipService.GetGeoInfoLocal(IP));
        }
コード例 #10
0
 public CertService(IIpService ipService, IIpSettingsModel ipSettings, IApplicationSettingsModel applicationSettingsModel)
 {
     _ipService  = ipService;
     _ipSettings = ipSettings;
     _applicationSettingsModel = applicationSettingsModel;
 }
コード例 #11
0
 public TaterController(IOptionsMonitor <AppSettings> appSettings, ILogger <TaterController> logger, IIpService ipService)
 {
     _appSettings = appSettings.CurrentValue;
     _logger      = logger;
     _ipService   = ipService;
 }
コード例 #12
0
 public ClientIpFilter(ILogger <ClientIpFilter> logger, IIpService ipService, IConfiguration configuration)
 {
     _logger    = logger;
     _ipService = ipService;
     _safeList  = configuration["AdminSafeList"];
 }
コード例 #13
0
ファイル: IpController.cs プロジェクト: polischuk/IpLookup
 public IpController(IIpService service)
 {
     _service = service;
 }
コード例 #14
0
 public IpTest()
 {
     _ipService = ServiceProvider.GetRequiredService <IIpService>();
 }
コード例 #15
0
 public HttpService(IIpService ipService)
 {
     _ipService = ipService;
 }
コード例 #16
0
 public IpController(IIpService ipService)
 {
     _ipService = ipService;
 }
コード例 #17
0
 public RequestOriginService(IIpService ipService)
 {
     _ipService = ipService;
 }