static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); EditorEnvironment.Initialise(); MainForm initalWindow = new MainForm(true); EditorEnvironment.RegisterWindow("Window001", initalWindow); Application.Run(initalWindow); }
/// <summary> /// Creates a window in this environment. /// </summary> /// <param name="windowName">The name of the window to add.</param> /// <returns>Whether the window was successfully added or not.</returns> public static bool CreateWindow(string windowName) { if (!Windows.ContainsKey(windowName)) { MainForm window = new MainForm(false); window.Name = windowName; window.Show(); Windows.Add(windowName, window); return true; } return false; }
/// <summary> /// Registers a window into this environment. /// </summary> /// <param name="windowName">The name of the window to register.</param> /// <param name="window">The window instance to register.</param> /// <returns>Whether the window was successfully registered or not.</returns> public static bool RegisterWindow(string windowName, MainForm window) { if (!Windows.ContainsKey(windowName)) { window.Name = windowName; Windows.Add(windowName, window); return true; } return false; }