public static void AddWorkSessionServers(List <WorkSessionServerInfo> servers) { foreach (WorkSessionServerInfo server in servers) { All.AddOrUpdate(server.RoleInstanceId, server, (k, s) => server); } }
public static void Add(IDataProviderSetting settings) { // All All.AddOrUpdate( settings.Name, settings, (xKey, xValue) => settings ); // Default if (settings.Name.EqualsX(Constants.Default)) { Default = settings; } }
static void AddWorkSessionServer(WorkSessionServerInfo server) { lock (locker) { BeginUpdate(); try { WorkSessionServerInfo serverWithoutWorkSessions = new WorkSessionServerInfo(server); All.AddOrUpdate(server.RoleInstanceId, serverWithoutWorkSessions, (k, s) => { s.HostServerIP = serverWithoutWorkSessions.HostServerIP; s.HostServerName = serverWithoutWorkSessions.HostServerName; s.LastUpdateTime = DateTime.Now; s.RemainingMemory = serverWithoutWorkSessions.RemainingMemory; s.SetStatus(serverWithoutWorkSessions.Status); return(s); }); } finally { EndUpdate(); } } }