public static void Attach(IWorkbench workbench) { WorkbenchSingleton.workbench = workbench; Form form = workbench as Form; form.Location = new Point((int)RegistryUtility.GetValue("X", 100), (int)RegistryUtility.GetValue("Y", 100)); form.Size = new Size((int)RegistryUtility.GetValue("Width", 800), (int)RegistryUtility.GetValue("Height", 600)); form.WindowState = GetWindowState((string)RegistryUtility.GetValue("WindowState", "Normal")); form.Closed += delegate { RegistryUtility.SetValue("X", form.Location.X); RegistryUtility.SetValue("Y", form.Location.Y); RegistryUtility.SetValue("Width", form.Size.Width); RegistryUtility.SetValue("Height", form.Size.Height); RegistryUtility.SetValue("WindowState", form.WindowState); }; }
public void TestMethod() { RegistryUtility.SetValue("X", 250); Console.WriteLine(RegistryUtility.GetValue("X", 100)); }