| | |
| | | { |
| | | public partial class FrmTree : Form |
| | | { |
| | | public SGWorld74 SG = null; |
| | | |
| | | public static string StartupPath |
| | | { |
| | | get |
| | | { |
| | | return System.Windows.Forms.Application.StartupPath; |
| | | } |
| | | } |
| | | |
| | | |
| | | public FrmTree() |
| | | { |
| | | InitializeComponent(); |
| | | this.Load += FrmWeb_Load; |
| | | this.FormClosed += FrmWin_FormClosed; |
| | | } |
| | | |
| | | void FrmWeb_Load(object sender, EventArgs e) |
| | | { |
| | | try |
| | | { |
| | | LogOut.Info("开始运行.."); |
| | | |
| | | string fly = Path.Combine(StartupPath, "Resources\\sample.fly"); |
| | | if (!File.Exists(fly)) |
| | | { |
| | | LogOut.Error("Fly文件不存在:" + fly); |
| | | return; |
| | | } |
| | | |
| | | SG = new SGWorld74(); |
| | | SG.OnLoadFinished += SG_OnLoadFinished; |
| | | SG.Open(fly); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); |
| | | } |
| | | } |
| | | |
| | | void SG_OnLoadFinished(bool bSuccess) |
| | | { |
| | | // |
| | | } |
| | | |
| | | void FrmWin_FormClosed(object sender, FormClosedEventArgs e) |
| | | { |
| | | LogOut.Info("关闭程序."); |
| | | } |
| | | } |
| | | } |