/// <summary> /// 注册一个服务器状态监控模块 /// </summary> public static void Register(IServerState module) { var oldModule = s_modules.FirstOrDefault(o => o.ModuleId == module.ModuleId); if (oldModule != null) s_modules.Remove(oldModule); s_modules.Add(module); }
public ChatTweetListViewModel(IRegionManager regionManager, IChatServerService chatServer, IServerState serverState, IResolvePicIndexToUrl resolve) : base(regionManager) { _Resolve = resolve; _ChatServer = chatServer; _ServerState = serverState; Tweets = new ReactiveCollection <TweetData>(); ServerName = new ReactiveProperty <string>(); }
/// <summary> /// Initializes a new instance of the <see cref="ObservableServerEntry" /> class. /// </summary> /// <param name="serverState">The state object for the displayed server.</param> public ObservableServerEntry(IServerState serverState) { if (serverState == null) { throw new ArgumentNullException(nameof(serverState)); } this.ServerState = serverState; this.UpdateFromState(); }
/// <summary> /// 注册一个服务器状态监控模块 /// </summary> public static void Register(IServerState module) { var oldModule = s_modules.FirstOrDefault(o => o.ModuleId == module.ModuleId); if (oldModule != null) { s_modules.Remove(oldModule); } s_modules.Add(module); }
/// <summary> /// Removes a server from the <see cref="IServerWatcher" />. /// </summary> /// <param name="server">The server state object that describes the server that should be removed.</param> public void RemoveServer(IServerState server) { if (server == null) { throw new ArgumentNullException(nameof(server)); } lock (this.instanceLock) { ServerState state = server as ServerState; if (state != null && this.watchedServers.Contains(state)) { this.watchedServers.Remove(state); } } }
public ServerStatusViewModel(IRegionManager regionManager, IServerState state) : base(regionManager) { var list = state.GetAllServerState(); Status = new ReactiveCollection <Server>(); Status.AddRange(list.ToList()); AllServerConnections = new ReactiveProperty <long> { Value = list.Sum(x => x.OnlineNums) }; Observable.Interval(TimeSpan.FromSeconds(10)) .Subscribe(_ => { var list = state.GetAllServerState(); Status.ClearOnScheduler(); Status.AddRangeOnScheduler(list.ToList()); AllServerConnections.Value = list.Sum(x => x.OnlineNums); }); }
public static bool IsAddressValid(this IServerState serverState) { return(IsValidAddress(serverState.Address)); }
public GameHub(IServerState serverState, IGameLogic gameLogic, IGameAI gameAI) { this.serverState = serverState; this.gameLogic = gameLogic; this.gameAI = gameAI; }
/// <summary> /// Initializes a new instance of the <see cref="ServerStatusChangedEventArgs" />. /// </summary> /// <param name="changedStatus">The <see cref="IServerState" /> that has changed.</param> public ServerStatusChangedEventArgs(IServerState changedStatus) { this.ChangedStatus = changedStatus; }
public ResolvePicIndexToUrl(IServerState serverState) { BASE_URL = serverState.GetServerState(1).ResourceUrl.ToString(); }