Esempio n. 1
0
        private void StartTheEditor_Click(object sender, RoutedEventArgs e)
        {
            if (!StartTheEditor.IsEnabled)
            {
                return;
            }
            var parameters = $"-FORCEWINDOWED YES \"{LstProjects.SelectedItem.ToString()}\" ";

            if (LstMaps.SelectedItem.ToString() == "** New Map **")
            {
                parameters += $"\"{NewMap.Text}\"";
            }
            else
            {
                parameters += $"\"{LstMaps.SelectedItem.ToString()}\"";
            }
            try {
                var editor = $"{qstr.ExtractDir(MyExe)}/KthuraEdit.exe";
                //Process.Start(editor, parameters); // This will need to be done differently!
                CShell.Start(editor, parameters);
            } catch (Exception err) {
                Debug.WriteLine($"Launching the editor failed!\n{err.Message}");
                MessageBox.Show($"Launching the editor failed!\n{err.Message}");
            }
        }
Esempio n. 2
0
 public MainWindow()
 {
     InitializeComponent();
     CShell.Init(this, C_Command, C_Status, C_Output);
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     BDate.Content         = $"Build date: {BuildDate.sBuildDate}";
     if (MainConfig.WorkSpace == "")
     {
         MessageBox.Show("Workspace has not yet been set.\nPlease select a folder that I can use as Workspace (the folder where your Kthura project data will be stored)!");
         using (var dialog = new System.Windows.Forms.FolderBrowserDialog()) {
             System.Windows.Forms.DialogResult result = dialog.ShowDialog();
             if (result == System.Windows.Forms.DialogResult.OK)
             {
                 MainConfig.WorkSpace = dialog.SelectedPath;
             }
             else
             {
                 Environment.Exit(1);
             }
         }
     }
     Scan4Projects();
 }