-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram_DMForm.cs
More file actions
35 lines (32 loc) · 952 Bytes
/
Copy pathProgram_DMForm.cs
File metadata and controls
35 lines (32 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DormitoryManagment
{
public class DMForm : Form
{
protected void Navigate(ref DMForm nextForm)
{
this.Close();
Thread thread = new Thread(RunForm);
thread.Start(nextForm);
}
private void RunForm(object obj)
{
Application.Run((DMForm)obj);
}
protected override void OnFormClosing(System.Windows.Forms.FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.FormOwnerClosing)
{
if (Program.admin != null) Program.admin.LogOut();
if (Program.manager != null) Program.manager.LogOut();
if (Program.student != null) Program.student.LogOut();
}
}
}
}