private void Form1_Load(object sender, System.EventArgs e) { bf = new BinaryFormatter(); AppDir = Path.GetDirectoryName(Application.ExecutablePath); xs = new XmlSettings(Path.GetFileNameWithoutExtension(Application.ExecutablePath)); xs.LoadSettings(Path.Combine(AppDir, "settings.xml")); SetPosAndSize(); turPath = xs.ReadSetting(Setting.LastFile, String.Empty); RestoreTurnir(turPath); tabControl1.SelectedIndex = xs.ReadSetting(Setting.LastTab, 0); var ti = xs.ReadSetting(Setting.TableIndex, 0); cbTable.SelectedIndex = ti < cbTable.Items.Count ? ti : 0; }
private void SetPosAndSize() { if (xs.ReadSetting(Setting.Maximized, false)) { WindowState = FormWindowState.Maximized; } else { Visible = false; WindowState = FormWindowState.Normal; Left = xs.ReadSetting(Setting.Left, 0); Top = xs.ReadSetting(Setting.Top, 0); Width = xs.ReadSetting(Setting.Width, Width); Height = xs.ReadSetting(Setting.Height, Height); Visible = true; } }