예제 #1
0
 public static void AddWorkSessionServers(List <WorkSessionServerInfo> servers)
 {
     foreach (WorkSessionServerInfo server in servers)
     {
         All.AddOrUpdate(server.RoleInstanceId, server, (k, s) => server);
     }
 }
예제 #2
0
        public static void Add(IDataProviderSetting settings)
        {
            // All
            All.AddOrUpdate(
                settings.Name,
                settings,
                (xKey, xValue) => settings
                );

            // Default
            if (settings.Name.EqualsX(Constants.Default))
            {
                Default = settings;
            }
        }
예제 #3
0
 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();
         }
     }
 }