//
// удалитьToolStripMenuItem
// . удалитьToolStripMenuItem. Name = "удалитьToolStripMenuItem";. удалитьToolStripMenuItem. Size = new System. Drawing. Size (171, 22);. удалитьToolStripMenuItem. Text = "Удалить";. удалитьToolStripMenuItem. Click += new System. EventHandler (this. delete_Click);
//
// openFileDialog
// . openFileDialog. FileName = "openFileDialog";
//
// userType
// . userType. AutoSizeMode = System. Windows. Forms. DataGridViewAutoSizeColumnMode. None;. userType. FillWeight = 125.8883F;. userType. Frozen = true;. userType. HeaderText = "Тип пользователя";. userType. Name = "userType";. userType. ReadOnly = true;. userType. Resizable = System. Windows. Forms. DataGridViewTriState. False;. userType. Width = 158;
//
// ColumnName
// . ColumnName. AutoSizeMode = System. Windows. Forms. DataGridViewAutoSizeColumnMode. None;. ColumnName. FillWeight = 91.37055F;. ColumnName. Frozen = true;. ColumnName. HeaderText = "Имя";. ColumnName. Name = "ColumnName";. ColumnName. ReadOnly = true;. ColumnName. Resizable = System. Windows. Forms. DataGridViewTriState. False;. ColumnName. Width = 115;
//
// ColumnPassword
// . ColumnPassword. AutoSizeMode = System. Windows. Forms. DataGridViewAutoSizeColumnMode. None;. ColumnPassword. FillWeight = 91.37055F;. ColumnPassword. Frozen = true;. ColumnPassword. HeaderText = "Пароль";. ColumnPassword. Name = "ColumnPassword";. ColumnPassword. ReadOnly = true;. ColumnPassword. Resizable = System. Windows. Forms. DataGridViewTriState. False;. ColumnPassword. Width = 114;
//
// ColumnRights
// . ColumnRights. AutoSizeMode = System. Windows. Forms. DataGridViewAutoSizeColumnMode. None;. ColumnRights. FillWeight = 91.37055F;. ColumnRights. Frozen = true;. ColumnRights. HeaderText = "Права доступа";. ColumnRights. Name = "ColumnRights";. ColumnRights. ReadOnly = true;. ColumnRights. Resizable = System. Windows. Forms. DataGridViewTriState. False;. ColumnRights. Width = 115;
//
// Form1
// . AutoScaleDimensions = new System. Drawing. SizeF (6F, 13F);. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;. ClientSize = new System. Drawing. Size (651, 331);. Controls. Add (this. dataGridView1);. Controls. Add (this. menuStrip1);. KeyPreview = true;. MainMenuStrip = this. menuStrip1;. Name = "Form1";. Text = "Пользователи";. FormClosing += new System. Windows. Forms. FormClosingEventHandler (this. FormClosing_Form1);. menuStrip1. ResumeLayout (false);. menuStrip1. PerformLayout ();
( (System.componentModel. ISupportInitialize) (this. dataGridView1)). EndInit ();. contextMenuStrip. ResumeLayout (false);. ResumeLayout (false);. PerformLayout ();
}
#endregionSystem. Windows. Forms. MenuStrip menuStrip1;System. Windows. Forms. ToolStripMenuItem файлToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem createToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem exitToolStripMenuItem;System. Windows. Forms. DataGridView dataGridView1;System. Windows. Forms. ToolStripMenuItem openToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem saveToolStripMenuItem;System. Windows. Forms. ContextMenuStrip contextMenuStrip;System. Windows. Forms. ToolStripMenuItem добавитьДоToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem добавитьПослеToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem удалитьToolStripMenuItem;System. Windows. Forms. OpenFileDialog openFileDialog;System. Windows. Forms. ToolStripMenuItem saveAsToolStripMenuItem;System. Windows. Forms. ToolStripMenuItem closeToolStripMenuItem;System. Windows. Forms. SaveFileDialog saveFileDialog;System. Windows. Forms. ToolStripMenuItem справкаToolStripMenuItem;System. Windows. Forms. DataGridViewTextBoxColumn userType;System. Windows. Forms. DataGridViewTextBoxColumn ColumnName;System. Windows. Forms. DataGridViewTextBoxColumn ColumnPassword;System. Windows. Forms. DataGridViewTextBoxColumn ColumnRights;
}
}
userForm. Designer. cs
namespace курсовая_2курс
{class userForm
{
// / <summary>
// / Required designer variable.
// / </summary>System.componentModel. IContainer components = null;
// / <summary>
// / Clean up any resources being used.
// / </summary>
// / <param name="disposing">true if managed resources should be disposed; otherwise, false. </param>override void Dispose (bool disposing)
{(disposing && (components! = null))
{. Dispose ();
}. Dispose (disposing);
}
#region Windows Form Designer generated code
// / <summary>
// / Required method for Designer support - do not modify
// / the contents of this method with the code editor.
// / </summary>void InitializeComponent ()
{. userLabel = new System. Windows. Forms. Label ();. userTypeLabel = new System. Windows. Forms. Label ();. userTypeComboBox = new System. Windows. Forms.comboBox ();. userRightsLabel = new System. Windows. Forms. Label ();. userRightsComboBox = new System. Windows. Forms.comboBox ();. userPasswordLabel = new System. Windows. Forms. Label ();. userPasswordTextBox = new System. Windows. Forms. TextBox ();. userButton = new System. Windows. Forms. Button ();. userNameLabel = new System. Windows. Forms. Label ();. userNameTextBox = new System. Windows. Forms. TextBox ();. SuspendLayout ();
//
// userLabel
// . userLabel. Font = new System. Drawing. Font ("Microsoft Sans Serif", 14F, System. Drawing. FontStyle. Underline, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));. userLabel. Location = new System. Drawing. Point (60,9);. userLabel. Name = "userLabel";. userLabel. Size = new System. Drawing. Size (154, 24);. userLabel. TabIndex = 0;. userLabel. Text = "Пользователь";
//
// userTypeLabel
// . userTypeLabel. Font = new System. Drawing. Font ("Microsoft Sans Serif", 10F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));. userTypeLabel. Location = new System. Drawing. Point (12, 69);. userTypeLabel. Name = "userTypeLabel";. userTypeLabel. Size = new System. Drawing. Size (137, 23);. userTypeLabel. TabIndex = 3;. userTypeLabel. Text = "Тип пользователя: ";. userTypeLabel. TextAlign = System. Drawing. ContentAlignment. MiddleLeft;
//
// userTypeComboBox
// . userTypeComboBox. FormattingEnabled = true;. userTypeComboBox. Items. AddRange (new object [] {
"Гость",
"Пользователь",
"Администратор"});. userTypeComboBox. Location = new System. Drawing. Point (155, 71);. userTypeComboBox. Name = "userTypeComboBox";. userTypeComboBox. Size = new System. Drawing. Size (121, 21);. userTypeComboBox. TabIndex = 2;. userTypeComboBox. SelectedIndexChanged += new System. EventHandler (this. userType_SelectedIndexChanged);. userTypeComboBox. TextUpdate += new System. EventHandler (this. userType_TextUpdate);. userTypeComboBox. KeyPress += new System. Windows. Forms. KeyPressEventHandler (this. onKeyPress_ComboBox);
//
// userRightsLabel
// . userRightsLabel. Font = new System. Drawing. Font ("Microsoft Sans Serif", 10F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));. userRightsLabel. Location = new System. Drawing. Point (12, 95);. userRightsLabel. Name = "userRightsLabel";. userRightsLabel. Size = new System. Drawing. Size (137, 23);. userRightsLabel. TabIndex = 5;. userRightsLabel. Text = "Права доступа: ";. userRightsLabel. TextAlign = System. Drawing. ContentAlignment. MiddleLeft;
//
// userRightsComboBox
// . userRightsComboBox. FormattingEnabled = true;. userRightsComboBox. Items. AddRange (new object [] {
"Чтение",
"Чтение/Запись",
"Чтение/Запись/Редактирование"});
this. userRightsComboBox. Location = new System. Drawing. Point (155, 97);. userRightsComboBox. Name = "userRightsComboBox";. userRightsComboBox. Size = new System. Drawing. Size (121, 21);. userRightsComboBox. TabIndex = 3;. userRightsComboBox. SelectedIndexChanged += new System. EventHandler (this. userRights_TextUpdate);. userRightsComboBox. TextUpdate += new System. EventHandler (this. userRights_TextUpdate);. userRightsComboBox. KeyPress += new System. Windows. Forms. KeyPressEventHandler (this. onKeyPress_ComboBox);
//
// userPasswordLabel
// . userPasswordLabel. Font = new System. Drawing. Font ("Microsoft Sans Serif", 10F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));. userPasswordLabel. Location = new System. Drawing. Point (12, 121);. userPasswordLabel. Name = "userPasswordLabel";. userPasswordLabel. Size = new System. Drawing. Size (137, 23);. userPasswordLabel. TabIndex = 8;. userPasswordLabel. Text = "Пароль: ";. userPasswordLabel. TextAlign = System. Drawing. ContentAlignment. MiddleLeft;. userPasswordLabel. Visible = false;
//
// . userPasswordTextBox. Location = new System. Drawing. Point (155, 124);. userPasswordTextBox. Name = "userPasswordTextBox";. userPasswordTextBox. Size = new System. Drawing. Size (121, 20);. userPasswordTextBox. TabIndex = 4;. userPasswordTextBox. Visible = false;. userPasswordTextBox. KeyPress += new System. Windows. Forms. KeyPressEventHandler (this. onKeyPress_passwordField);
//
// userButton
// . userButton. Location = new System. Drawing. Point (155, 159);. userButton. Name = "userButton";. userButton. Size = new System. Drawing. Size (121, 23);. userButton. TabIndex = 5;. userButton. Text = "Создать";. userButton. UseVisualStyleBackColor = true;. userButton. Visible = false;. userButton. Click += new System. EventHandler (this. onCreateButton_Click);
//
// userNameLabel
// . userNameLabel. Font = new System. Drawing. Font ("Microsoft Sans Serif", 10F, System. Drawing. FontStyle. Regular, System. Drawing. GraphicsUnit. Point, ( (byte) (204)));. userNameLabel. Location = new System. Drawing. Point (12, 43);. userNameLabel. Name = "userNameLabel";. userNameLabel. Size = new System. Drawing. Size (137, 23);. userNameLabel. TabIndex = 1;. userNameLabel. Text = "Имя пользователя: ";. userNameLabel. TextAlign = System. Drawing. ContentAlignment. MiddleLeft;
//
// userNameTextBox
// . userNameTextBox. Location = new System. Drawing. Point (155, 46);. userNameTextBox. Name = "userNameTextBox";. userNameTextBox. Size = new System. Drawing. Size (121, 20);. userNameTextBox. TabIndex = 1;. userNameTextBox. TextChanged += new System. EventHandler (this. userName_TextChanged);
//
// userForm
// . AutoScaleDimensions = new System. Drawing. SizeF (6F, 13F);. AutoScaleMode = System. Windows. Forms. AutoScaleMode. Font;. ClientSize = new System. Drawing. Size (295, 194);. Controls. Add (this. userNameTextBox);. Controls. Add (this. userNameLabel);. Controls. Add (this. userButton);. Controls. Add (this. userPasswordTextBox);. Controls. Add (this. userPasswordLabel);. Controls. Add (this. userRightsComboBox);. Controls. Add (this. userRightsLabel);. Controls. Add (this. userTypeComboBox);. Controls. Add (this. userTypeLabel);. Controls. Add (this. userLabel);. FormBorderStyle = System. Windows. Forms. FormBorderStyle. FixedDialog;. MaximizeBox = false;. MinimizeBox = false;
this. Name = "userForm";. Text = "Добавление пользователя";
this. ResumeLayout (false);. PerformLayout ();
}
#endregionSystem. Windows. Forms. Label userLabel;System. Windows. Forms. Label userTypeLabel;System. Windows. Forms.comboBox userTypeComboBox;System. Windows. Forms. Label userRightsLabel;System. Windows. Forms.comboBox userRightsComboBox;System. Windows. Forms. Label userPasswordLabel;System. Windows. Forms. TextBox userPasswordTextBox;System. Windows. Forms. Button userButton;System. Windows. Forms. Label userNameLabel;System. Windows. Forms. TextBox userNameTextBox;
}
}
Объектно-ориентированное программи́рование (ООП) - парадигма программирования, в которой основными концепциями являются понятия объектов и классов (либо, в менее известном варианте языков с прототипированием, - прототипов). Класс - это тип, описывающий устройство объектов. Понятие "класс" подразумевает некоторое поведение и способ представления. Понятие "объект" подразумевает нечто, что обладает определённым поведением и способом представления. Говорят, что объект - это экземпляр класса. Класс можно сравнить с чертежом, согласно которому создаются объекты. Обычно классы разрабатывают таким образом, чтобы их объекты соответствовали объектам предметной области.
Класс является описываемой на языке терминологии
(пространства имён) исходного кода моделью ещё не существующей сущности, т. н.
объекта. Объект - сущность в адресном пространстве вычислительной системы,
появляющаяся при создании экземпляра класса (например, после запуска
результатов компиляции (и линковки) исходного кода на выполнение).
1. А.Н. Козин "Структуры и алгоритмы обработки данных" учебно-методическое пособие, 2010.
2. Эндрю Троелсон "С# и платформа.net", 2009.