/[MorrowindCustomClothingSlotCreator]/trunk/MorrowindCustomClothingSlotCreator/Form1.cs
ViewVC logotype

Contents of /trunk/MorrowindCustomClothingSlotCreator/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8 - (show annotations) (download)
Fri Jul 29 11:56:58 2011 UTC (8 years, 5 months ago) by william
File size: 2043 byte(s)
*** add support for displaying log data in a usercontrol (and not just in VS Debug console)

1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8 using libTES3FileFormat;
9
10 namespace MorrowindCustomClothingSlotCreator
11 {
12
13 public partial class Form1 : Form
14 {
15 public static MorrowindPathHelper MorrowindData = new MorrowindPathHelper();
16 public static string MorrowindPath = MorrowindData.MorrowindInstallPath;
17 public static string MorrowindDataFilesPath = MorrowindPath + "\\Data Files\\";
18
19 private TES3PluginLoader TES3PluginLoader;
20
21 public Form1()
22 {
23 InitializeComponent();
24 this.TES3PluginLoader = new TES3PluginLoader();
25 }
26
27 public bool LoadPlugin(string pluginFile)
28 {
29 bool loaded = this.TES3PluginLoader.Load();
30
31 if (loaded)
32 {
33 MessageBox.Show("Successfully Loaded Plugin: " + pluginFile, "Successfully Loaded File:", MessageBoxButtons.OK, MessageBoxIcon.Information);
34 }
35
36 return loaded;
37 }
38
39
40 private void mnuItemExit_Click(object sender, EventArgs e)
41 {
42 this.Close();
43 }
44
45 private void mnuItemOpenPlugin_Click(object sender, EventArgs e)
46 {
47 PluginLoader.InitialDirectory = MorrowindDataFilesPath;
48 DialogResult result = PluginLoader.ShowDialog();
49 string PluginFile = PluginLoader.FileName;
50 if (result != DialogResult.OK) return;
51 //MessageBox.Show("Load Plugin: " + PluginLoader.FileName);
52 this.TES3PluginLoader = new TES3PluginLoader(PluginFile, this.log);
53 if (!this.LoadPlugin(PluginFile))
54 {
55 MessageBox.Show("Failed to Load Plugin: " + PluginFile + "\n\nReason: \n\n" + this.TES3PluginLoader.PluginLoadFailureReason, "Failed to Load File:", MessageBoxButtons.OK, MessageBoxIcon.Error);
56 }
57 }
58 }
59 }

  ViewVC Help
Powered by ViewVC 1.1.22