Changeset 9 for trunk/MacFaceFloat/MainForm.cs
- Timestamp:
- Nov 10, 2004, 8:24:03 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/MainForm.cs
r8 r9 119 119 return SelectFaceDefine(Application.StartupPath); 120 120 } 121 121 122 public bool SelectFaceDefine(string defaultPath) 122 123 { 123 124 String facePath; 124 Hashtable property;125 125 126 126 // XVð~ßéB … … 140 140 { 141 141 facePath = folderBrowser.SelectedPath; 142 if (File.Exists(Path.Combine(facePath, "faceDef.plist"))) 142 143 if (LoadFaceDefine(facePath)) 143 144 { 144 break; 145 } 146 else 147 { 148 // t@CªÈ¢ 149 if (MessageBox.Show( 150 String.Format("wè³ê½tH_Éçp^[è`XMLt@C \"faceDef.plist\" ª¶ÝµÜ¹ñB\n\ntH_:\n{0}", facePath), 151 "MacFace for Windows", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) 152 == DialogResult.Cancel) 153 { 154 return false; 155 } 145 return true; 156 146 } 157 147 } … … 162 152 } 163 153 164 // ÇÝÝ 154 } 155 156 157 bool LoadFaceDefine(string path) 158 { 159 string plistPath = Path.Combine(path, "faceDef.plist"); 160 161 if (!File.Exists(plistPath)) 162 { 163 System.Windows.Forms.MessageBox.Show( 164 String.Format("wè³ê½tH_Éçp^[è`XMLt@C \"faceDef.plist\" ª¶ÝµÜ¹ñB\n\ntH_:\n{0}", path), 165 "MacFace for Windows", MessageBoxButtons.OK, MessageBoxIcon.Error); 166 return false; 167 } 168 169 Hashtable property; 165 170 try 166 171 { 167 property = PropertyList.Load( Path.Combine(facePath, "faceDef.plist"));172 property = PropertyList.Load(plistPath); 168 173 } 169 174 catch (System.IO.IOException ie) … … 184 189 } 185 190 191 // çp^[·µÖ¦ÍXVð~ßĨ 192 if (_updateTimer != null) _updateTimer.Stop(); 193 186 194 _property = property; 187 _facePath = facePath;195 _facePath = path; 188 196 _parts = (ArrayList)_property["parts"]; 189 190 // XVJn 197 prevUsage = -10; 198 199 // XVÄJ 191 200 if (_updateTimer != null) _updateTimer.Start(); 192 201 193 202 return true; 194 203 } 195 196 197 204 198 205 public void CountProcessorUsage(object sender, EventArgs e) … … 234 241 public void MainForm_Load(object sender, System.EventArgs e) 235 242 { 236 if (!SelectFaceDefine(Path.Combine(Application.StartupPath, "default.mcface"))) 237 { 238 Application.Exit(); 239 return; 240 } 241 243 string faceDefPath = Path.Combine(Application.StartupPath, "default.mcface"); 244 bool result = false; 245 246 if (Directory.Exists(faceDefPath)) 247 { 248 result = LoadFaceDefine(faceDefPath); 249 } 250 251 if (!result) 252 { 253 if (!SelectFaceDefine(Application.StartupPath)) 254 { 255 Application.Exit(); 256 return; 257 } 258 259 } 242 260 } 243 261
Note: See TracChangeset
for help on using the changeset viewer.