private void loadProject(object sender, LinkLabelLinkClickedEventArgs e) { LinkLabel lnb = sender as LinkLabel; _LoadingDialog ld = new _LoadingDialog(AppMessages.messages["project_loading"]); try { Task.Factory.StartNew(() => { ld.ShowDialog(); }); //Application.DoEvents(); string proPath = Path.Combine(ProjectConfig.projectBase, lnb.Text); string tempPath = Path.Combine(ProjectConfig.projectBase, "~temp_" + lnb.Text.Replace(ProjectConfig.projectExtension, "")); ProjectLoader.load(proPath, tempPath); MainWindow mf = new MainWindow(); mf.Show(); t = 1; } catch (Exception ex) { MessageBox.Show("Exception: " + ex.Message); } finally { Invoke(new MethodInvoker(() => { ld.Close(); })); this.Close(); } }
private void LinkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { OpenFileDialog opnfd = new OpenFileDialog(); opnfd.Filter = "BUPX Files (*.bupx;)|*.bupx;"; //string dPath = ProjectConfig.projectPath.Replace("temp_", "") + ProjectConfig.projectExtension; if (opnfd.ShowDialog() == DialogResult.OK) { _LoadingDialog ld = new _LoadingDialog(AppMessages.messages["project_loading"]); try { Task.Factory.StartNew(() => { ld.ShowDialog(); }); string proPath = opnfd.FileName; string tempPath = Path.Combine(Path.GetDirectoryName(opnfd.FileName), "~temp_" + opnfd.SafeFileName.Replace(ProjectConfig.projectExtension, "")); ProjectLoader.load(proPath, tempPath); MainWindow mf = new MainWindow(); mf.Show(); t = 1; } catch (Exception ex) { MessageBox.Show("Exception: " + ex.Message); } finally { Invoke(new MethodInvoker(() => { ld.Close(); })); this.Close(); } } }