Ejemplo n.º 1
0
 /// <summary>
 /// Close the singleton StupidServer if it exists.
 /// </summary>
 public static void CloseStupidServer()
 {
     if (server != null)
     {
         server.Close();
         server = null;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Start a singleton StupidServer if not already started.
 /// </summary>
 /// <returns>Started instance of StupidServer, or null if a server has already been started</returns>
 public static StupidServer StartNewServer()
 {
     if (server == null)
     {
         server = new StupidServer();
         server.Start();
         return(server);
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="outputbox"></param>
 /// <returns></returns>
 public static StupidServer StartNewServer(System.Windows.Forms.TextBox outputbox)
 {
     return(server ?? (server = new StupidServer().BindOutputToMultiLineTextBox(outputbox).Start()));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Start a quasi-singleton StupidServer if not already started.
 /// </summary>
 /// <returns>Started instance of StupidServer, or null if a server has already been started</returns>
 public static StupidServer StartNewServer()
 {
     return(server ?? (server = new StupidServer().Start()));
 }