private void SetEditorWindowSizeFromRegistry()
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(AGSEditor.AGS_REGISTRY_KEY);
if (key != null)
{
try
{
int x = Convert.ToInt32(key.GetValue("MainWinX", _mainForm.Left));
int y = Convert.ToInt32(key.GetValue("MainWinY", _mainForm.Top));
_mainForm.SetDesktopLocation(x, y);
int formWidth = Convert.ToInt32(key.GetValue("MainWinWidth", _mainForm.Width));
int formHeight = Convert.ToInt32(key.GetValue("MainWinHeight", _mainForm.Height));
_mainForm.Width = Math.Max(formWidth, 300);
_mainForm.Height = Math.Max(formHeight, 300);
_mainForm.WindowState = (key.GetValue("MainWinMaximize", "0").ToString() == "1") ? FormWindowState.Maximized : FormWindowState.Normal;
/*int splitterX = Convert.ToInt32(key.GetValue("MainWinSplitter1", 0));
int splitterY = Convert.ToInt32(key.GetValue("MainWinSplitter2", 0));
if ((splitterX > 0) && (splitterY > 0))
{
_mainForm.SetSplitterPositions(splitterX, splitterY);
}*/
}
catch (Exception ex)
{
this.ShowMessage("There was an error reading your settings from the registry:" + Environment.NewLine + ex.Message + Environment.NewLine + Environment.NewLine +
"The AGS registry entries may have been corrupted. You may need to reset your preferences.", MessageBoxIcon.Warning);
}
key.Close();
}
}