11using System ;
22using System . IO ;
3- using System . IO . Compression ;
43using System . Windows . Forms ;
54
65namespace Lain
@@ -71,22 +70,6 @@ private void Login()
7170 }
7271 }
7372
74- private void Reset ( )
75- {
76- try
77- {
78- if ( Directory . Exists ( Required . DataFolder ) )
79- {
80- Directory . Delete ( Required . DataFolder , true ) ;
81- }
82- }
83- catch { }
84- finally
85- {
86- Application . Restart ( ) ;
87- }
88- }
89-
9073 private void btnExit_Click ( object sender , EventArgs e )
9174 {
9275 switch ( _type )
@@ -107,36 +90,28 @@ private void btnOk_Click(object sender, EventArgs e)
10790 Login ( ) ;
10891 }
10992
110- private void btnReset_Click ( object sender , EventArgs e )
111- {
112- if ( MessageBox . Show ( "Do you really want to reset Lain?\n This will delete everything!" , "Reset Lain?" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) == DialogResult . Yes )
113- {
114- Reset ( ) ;
115- }
116- }
117-
11893 private void LoginForm_Load ( object sender , EventArgs e )
11994 {
12095 CheckForIllegalCrossThreadCalls = false ;
12196 switch ( _type )
12297 {
12398 case LoginType . Authorize :
12499 btnExit . Text = "Cancel" ;
125- btnReset . Visible = false ;
126- btnRestore . Visible = false ;
100+ // btnReset.Visible = false;
101+ // btnRestore.Visible = false;
127102 break ;
128103
129104 case LoginType . Remove :
130105 btnExit . Text = "Cancel" ;
131- btnReset . Visible = false ;
132- btnRestore . Visible = false ;
106+ // btnReset.Visible = false;
107+ // btnRestore.Visible = false;
133108 status . Text = "Enter your password\n to delete this account" ;
134109 break ;
135110
136111 case LoginType . RemoveAll :
137112 btnExit . Text = "Cancel" ;
138- btnReset . Visible = false ;
139- btnRestore . Visible = false ;
113+ // btnReset.Visible = false;
114+ // btnRestore.Visible = false;
140115 status . Text = "Enter your password\n to delete all your accounts" ;
141116 break ;
142117 }
@@ -159,44 +134,5 @@ private void pictureBox1_Click(object sender, EventArgs e)
159134 return ;
160135 }
161136 }
162-
163- private void RestoreBackup ( )
164- {
165- if ( MessageBox . Show ( "Do you really want restore a backup?\n This will delete your current accounts!" , "Restore backup?" , MessageBoxButtons . YesNo , MessageBoxIcon . Question ) == DialogResult . Yes )
166- {
167- OpenFileDialog dialog = new OpenFileDialog ( ) ;
168- dialog . DefaultExt = ".Lain" ;
169- dialog . Title = "Restore backup ..." ;
170- dialog . InitialDirectory = Environment . GetFolderPath ( Environment . SpecialFolder . MyComputer ) ;
171- dialog . FileName = string . Empty ;
172- dialog . Filter = "Lain files|*.Lain" ;
173-
174- if ( dialog . ShowDialog ( ) == DialogResult . OK )
175- {
176- try
177- {
178- if ( Directory . Exists ( Required . DataFolder ) )
179- {
180- Directory . Delete ( Required . DataFolder , true ) ;
181- }
182- }
183- catch { }
184- finally
185- {
186- try
187- {
188- ZipFile . ExtractToDirectory ( dialog . FileName , Required . DataFolder ) ;
189- Application . Restart ( ) ;
190- }
191- catch { }
192- }
193- }
194- }
195- }
196-
197- private void button1_Click ( object sender , EventArgs e )
198- {
199- RestoreBackup ( ) ;
200- }
201137 }
202138}
0 commit comments