Beispiel #1
0
 /// <summary>
 /// Replace a server object. The object is matched using the id of the replacement.
 /// </summary>
 internal void Replace(Server.Server newServer)
 {
     for (var i = 0; i < Servers.Count; i++)
     {
         var server = Servers [i];
         if (server.Id == newServer.Id)
         {
             if (server.Running)
             {
                 server.Stop();
             }
             Servers [i] = newServer;
             Configure(newServer);
             Logger.WriteLine("Updated server '" + server.Name + " to '" + newServer.Name);
             return;
         }
     }
     throw new KeyNotFoundException(newServer.Id.ToString());
 }
Beispiel #2
0
 /// <summary>
 /// Add a server to the core.
 /// </summary>
 internal void Add(Server.Server server)
 {
     Servers.Add(server);
     Configure(server);
     Logger.WriteLine("Added server '" + server.Name + "'");
 }
Beispiel #3
0
 /// <summary>
 /// Add a server to the core.
 /// </summary>
 internal void Add(Server.Server server)
 {
     servers.Add(server);
 }