C# Класс Smrf.AppLib.FormSettings

Saves a form's window state and rectangle in the user's settings.
This can be used as a base class for storing user settings in a Windows Forms application. This class automatically saves the window state, location, and optionally size (if the form is resizable) of a specified form when the form closes, and restores them when the form is loaded.

Derive a class from this one, add any form-specific user setting properties to the derived class, instantiate the dervied class in the form's constructor, and save the instantiated object in a member field.

It is not necessary to call ApplicationSettingsBase.Save when the form is closing. This class does that automatically.

This is for .NET 2.0 and later applications only.

Наследование: System.Configuration.ApplicationSettingsBase
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
m_bFormIsFixedSize System.Boolean

Private Properties

Свойство Тип Описание
AssertValid void

Открытые методы

Метод Описание
FormSettings ( Form form, System.Boolean formIsFixedSize ) : System

Initializes a new instance of the FormSettings class.

Защищенные методы

Метод Описание
Form_FormClosing ( object sender, FormClosingEventArgs e ) : void
Form_Load ( object sender, EventArgs e ) : void
RestoreFormWindow ( Form oForm ) : void
SaveFormWindow ( Form oForm ) : void

Приватные методы

Метод Описание
AssertValid ( ) : void

Описание методов

FormSettings() публичный Метод

Initializes a new instance of the FormSettings class.
public FormSettings ( Form form, System.Boolean formIsFixedSize ) : System
form System.Windows.Forms.Form /// The form to save settings for. ///
formIsFixedSize System.Boolean /// true if is of fixed size, false if it is /// resizable. If false, the form's size is restored along with the form's /// window state and location. ///
Результат System

Form_FormClosing() защищенный Метод

protected Form_FormClosing ( object sender, FormClosingEventArgs e ) : void
sender object
e System.Windows.Forms.FormClosingEventArgs
Результат void

Form_Load() защищенный Метод

protected Form_Load ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

RestoreFormWindow() защищенный Метод

protected RestoreFormWindow ( Form oForm ) : void
oForm System.Windows.Forms.Form
Результат void

SaveFormWindow() защищенный Метод

protected SaveFormWindow ( Form oForm ) : void
oForm System.Windows.Forms.Form
Результат void

Описание свойств

m_bFormIsFixedSize защищенное свойство

protected Boolean,System m_bFormIsFixedSize
Результат System.Boolean