public void LoadState(Options.Folder optFolder) { if (optFolder == null) { return; } OptionFolder = optFolder; string boolObj; bool tempPlaces = Places; if (!locked) { boolObj = optFolder.LoadStringOption("Places", tempPlaces.ToString()); tempPlaces = Convert.ToBoolean(boolObj); } if (!locked || tempPlaces) { boolObj = optFolder.LoadStringOption("Free", Free.ToString()); Free = Convert.ToBoolean(boolObj); boolObj = optFolder.LoadStringOption("Insiders", Insiders.ToString()); Insiders = Convert.ToBoolean(boolObj); unitID = optFolder.LoadIntOption("UnitID", 0); } if (!locked || !tempPlaces) { boolObj = optFolder.LoadStringOption("Guests", Guests.ToString()); Guests = Convert.ToBoolean(boolObj); companyID = optFolder.LoadIntOption("CompanyID", 0); } checkInsiders.Enabled = tempPlaces; checkFree.Enabled = tempPlaces && !freeLocked; checkGuests.Enabled = !tempPlaces; Places = tempPlaces; }
private void SelectDocUniversalDialog_Load(object sender, EventArgs e) { // загружаем настройки options = Environment.Layout.Folders.Add(Name); bool maximized = (WindowState == FormWindowState.Maximized); if (options.LoadStringOption("Maximized", maximized.ToString()) == "True") { WindowState = FormWindowState.Maximized; } else { Left = options.LoadIntOption("Left", Left); Top = options.LoadIntOption("Top", Top); Width = options.LoadIntOption("Width", Width); Height = options.LoadIntOption("Height", Height); } int width = labelInfo.Width; if (width < panelInfo.Width) { panelInfo.Width = width + SystemInformation.VerticalScrollBarWidth; buttonChange.Location = new Point(width + 16, buttonChange.Location.Y); buttonOpenDoc.Location = new Point(buttonChange.Size.Width + buttonChange.Location.X + SystemInformation.VerticalScrollBarWidth, buttonChange.Location.Y); } else if (width > panelInfo.Width) { if (stringCount < 3) { panelText.Height += SystemInformation.VerticalScrollBarWidth + 1; } buttonChange.Location = new Point(SystemInformation.VerticalScrollBarWidth + panelInfo.Width, 8); buttonOpenDoc.Location = new Point(buttonChange.Size.Width + buttonChange.Location.X + SystemInformation.VerticalScrollBarWidth, buttonChange.Location.Y); } panelInfo.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; buttonChange.BringToFront(); buttonOpenDoc.BringToFront(); panelTop.Height = options.LoadIntOption("PanelTopHeight", panelTop.Height); panelLeft.Width = options.LoadIntOption("PanelLeftWidth", panelLeft.Width); groupPersons.Height = options.LoadIntOption("GroupPersonsHeight", groupPersons.Height); // загружаем документы listPersons.Columns.Add(Environment.PersonWord.GetForm(Cases.I, true, true), listPersons.Width - SystemInformation.VerticalScrollBarWidth - 4, HorizontalAlignment.Left); groupPersons.Text = Environment.PersonWord.GetForm(Cases.I, true, true); docControl.ZoomText = options.LoadStringOption("ZoomString", Environment.StringResources.GetString("ToWidth")); docControl.ShowThumbPanel = Convert.ToBoolean(options.LoadStringOption("ShowThumb", false.ToString())); docGrid.Init(Environment.Layout); docGrid.Columns.Add(dataGridTextBoxColumnDocID); docGrid.Columns.Add(dataGridTextBoxColumnType); docGrid.Columns.Add(dataGridTextBoxColumnDate); docGrid.Columns.Add(dataGridTextBoxColumnNumber); docGrid.Columns.Add(dataGridTextBoxColumnDecr); docGrid.DoubleClick += docGrid_DoubleClick; docGrid.CurrentCellChanged += docGrid_CurrentCellChanged; BeginInvoke((MethodInvoker)(FillAll)); }