/// <summary> /// Class constructor. /// </summary> /// <param name="tray">Main program</param> /// <param name="vboxServer">VirtualBox wrapper</param> /// <param name="configurationFile">Absolute path to configuration file</param> public ConfigurationReader(Devel79Tray tray, VirtualBoxServer vboxServer, string configurationFile) { this.tray = tray; this.vboxServer = vboxServer; this.configurationFile = configurationFile; this.servers = new Dictionary <string, Server>(); }
/// <summary> /// Initialize monitor. /// </summary> /// <param name="tray">Main program</param> /// <param name="message">Message to show</param> /// <param name="directory">Directory to watch</param> public DirectoryMonitor(Devel79Tray tray, string message, string directory) { this.tray = tray; this.directory = directory; this.message = message; this.active = false; }
/// <summary> /// Class constructor. /// </summary> /// <param name="tray">Main program</param> /// <param name="vboxServer">VirtualBox wrapper</param> /// <param name="configurationFile">Absolute path to configuration file</param> public ConfigurationReader(Devel79Tray tray, VirtualBoxServer vboxServer, string configurationFile) { this.tray = tray; this.vboxServer = vboxServer; this.configurationFile = configurationFile; this.servers = new Dictionary<string, Server>(); }
/// <summary> /// Create new server. /// </summary> public Server(Devel79Tray tray, VirtualBoxServer vboxServer) { this.tray = tray; this.vboxServer = vboxServer; this.watchingDirectories = new Dictionary <string, DirectoryMonitor>(); this.commands = new Dictionary <string, string>(); this.menuGenerated = false; this.running = false; this.status = VirtualBoxServer.Status.POWEREDOFF; }
static void Main(string[] args) { bool serverList = false; List <string> runServers = new List <string>(); string configurationFile = Application.StartupPath + "\\" + DEFAULT_CONFIGURATION_FILE; for (int i = 0; i < args.Length; i++) { if (args[i].ToLower().Equals("--run") || args[i].ToLower().Equals("-r")) { if ((args.Length <= i) || (args[i + 1].StartsWith("-"))) { ShowError("Inicialization error", "No server for --run parameter specified."); } serverList = true; } else if ((args[i].ToLower().Equals("--config") || args[i].ToLower().Equals("-c")) && (args.Length > i)) { if ((args.Length <= i) || (args[i + 1].StartsWith("-"))) { ShowError("Inicialization error", "No file for --config parameter specified."); } configurationFile = args[++i]; serverList = false; } else if (serverList) { runServers.Add(args[i]); } } Devel79Tray devel79Tray = null; try { devel79Tray = new Devel79Tray(); devel79Tray.Initialize(configurationFile, runServers.ToArray()); } catch (ProgramException e) { ShowError("Inicialization error", e.Message); return; } catch (Exception e) { ShowError("Unhandled inicialization exception", "Message: " + e.Message + "\nSource: " + e.Source + "\nStack trace: " + e.StackTrace); return; } Application.Run(devel79Tray); }
/// <summary> /// Initialize monitor. /// </summary> /// <param name="tray">Main program.</param> public EmailMonitor(Devel79Tray tray) { this.tray = tray; this.active = false; }
static void Main(string[] args) { bool runServerAtStartup = false; string configurationFile = DEFAULT_CONFIGURATION_FILE; for (int i = 0; i < args.Length; i++) { if (args[i].ToLower().Equals("--runserver") || args[i].ToLower().Equals("-r")) { runServerAtStartup = true; } else if ((args[i].ToLower().Equals("--config") || args[i].ToLower().Equals("-c")) && (args.Length > i)) { configurationFile = args[++i]; } } Devel79Tray devel79Tray = null; try { devel79Tray = new Devel79Tray(runServerAtStartup, new ConfigurationReader(Application.StartupPath + "\\" + configurationFile)); } catch (Exception e) { ShowError("Inicialization error", e.Message); return; } Application.Run(devel79Tray); }
/// <summary> /// Initialize VirtualBox server class. /// </summary> /// <param name="tray">Devel79 form.</param> /// <param name="name">Server name.</param> /// <param name="machine">VirtualBox machine name.</param> /// <param name="ip">Server IP address.</param> public VirtualBoxServer(Devel79Tray tray, String name, String machine, String ip) { this.tray = tray; this.name = name; this.machine = machine; this.ip = ip; this.status = Status.NONE; this.consoleVisible = false; this.starting = false; this.restarting = false; this.stoping = false; }
/// <summary> /// Create new server. /// </summary> public Server(Devel79Tray tray, VirtualBoxServer vboxServer) { this.tray = tray; this.vboxServer = vboxServer; this.watchingDirectories = new Dictionary<string, DirectoryMonitor>(); this.commands = new Dictionary<string, string>(); this.menuGenerated = false; this.running = false; this.status = VirtualBoxServer.Status.POWEREDOFF; }
static void Main(string[] args) { bool serverList = false; List<string> runServers = new List<string>(); string configurationFile = Application.StartupPath + "\\" + DEFAULT_CONFIGURATION_FILE; for (int i = 0; i < args.Length; i++) { if (args[i].ToLower().Equals("--run") || args[i].ToLower().Equals("-r")) { if ((args.Length <= i) || (args[i + 1].StartsWith("-"))) { ShowError("Inicialization error", "No server for --run parameter specified."); } serverList = true; } else if ((args[i].ToLower().Equals("--config") || args[i].ToLower().Equals("-c")) && (args.Length > i)) { if ((args.Length <= i) || (args[i + 1].StartsWith("-"))) { ShowError("Inicialization error", "No file for --config parameter specified."); } configurationFile = args[++i]; serverList = false; } else if (serverList) { runServers.Add(args[i]); } } Devel79Tray devel79Tray = null; try { devel79Tray = new Devel79Tray(); devel79Tray.Initialize(configurationFile, runServers.ToArray()); } catch (ProgramException e) { ShowError("Inicialization error", e.Message); return; } catch (Exception e) { ShowError("Unhandled inicialization exception", "Message: " + e.Message + "\nSource: " + e.Source + "\nStack trace: " + e.StackTrace); return; } Application.Run(devel79Tray); }