/// <summary> /// Close the singleton StupidServer if it exists. /// </summary> public static void CloseStupidServer() { if (server != null) { server.Close(); server = null; } }
/// <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); } }
/// <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())); }
/// <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())); }