Exemple #1
0
 public static void Compile()
 {
     if (IDEProject.inst().Settings.CompilerPath == null || IDEProject.inst().Settings.CompilerPath.Trim().Length == 0)
     {
         if (ModernDialog.ShowMessage("You need to set a compile file in settings", "No princess here", System.Windows.MessageBoxButton.OKCancel) == MessageBoxResult.OK)
         {
             IDESettingsDlg dlg = new IDESettingsDlg();
             dlg.ShowDialog();
         }
         return;
     }
     IDEProject.inst().CompilerOutput = "";
     IDEProject.inst().CompileErrors.Clear();
     Activity.CompilerActivity.Compile(IDEProject.inst().Settings.CompilerPath);
     if (IDEProject.inst().CompileErrors.Count != 0)
     {
         Dlg.CompErrDlg dlg = new Dlg.CompErrDlg();
         dlg.ShowDialog();
     }
     else
     {
         Dlg.CompSuccessDlg dlg = new Dlg.CompSuccessDlg();
         dlg.ShowDialog();
     }
 }
Exemple #2
0
        public static void Compile()
        {
            if (IDEProject.inst().Settings.CompilerPath == null || IDEProject.inst().Settings.CompilerPath.Trim().Length == 0)
            {
                if (ModernDialog.ShowMessage("You need to set a compile file in settings", "No princess here", System.Windows.MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    IDESettingsDlg dlg = new IDESettingsDlg();
                    dlg.ShowDialog();
                }
                return;
            }
            IDEProject.inst().CompilerOutput = "";
            IDEProject.inst().CompileErrors.Clear();
            foreach (PluginLib.ICompilerService comp in PluginManager.inst().Compilers)
            {
                comp.CompileFile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst(), ErrorHandler.inst());
            }
            //Activity.CompilerActivity.Compile(IDEProject.inst().Settings.CompilerPath);
            if (IDEProject.inst().CompileErrors.Count != 0)
            {
                Dlg.CompErrDlg dlg = new Dlg.CompErrDlg();
                dlg.ShowDialog();
            }

            if (IDEProject.inst().CompileErrors.Count == 0)
            {
                foreach (PluginLib.ICompilerService comp in PluginManager.inst().Compilers)
                {
                    comp.PostCompile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst().Settings.SourceTree, ErrorHandler.inst());
                }
                Dlg.CompSuccessDlg dlg = new Dlg.CompSuccessDlg();
                dlg.ShowDialog();
            }
        }
        public static void Compile()
        {
            if (IDEProject.inst().Settings.CompilerPath == null || IDEProject.inst().Settings.CompilerPath.Trim().Length == 0)
            {
                if (ModernDialog.ShowMessage("You need to set a compile file in settings", "No princess here", System.Windows.MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    IDESettingsDlg dlg = new IDESettingsDlg();
                    dlg.ShowDialog();
                }
                return;
            }
            IDEProject.inst().CompilerOutput = "";
            IDEProject.inst().CompileErrors.Clear();
            PluginLib.ICompilerService comp = null;

            if (IDEProject.inst().Settings.Compiler != null && IDEProject.inst().Settings.Compiler.Length > 0)
            {
                comp = PluginManager.inst().Compilers.FirstOrDefault(c => c.Name.Equals(IDEProject.inst().Settings.Compiler));
                if (comp == null)
                {
                    ModernDialog.ShowMessage(String.Format("Unable to find compiler: \"{0}\"", IDEProject.inst().Settings.Compiler), "Error", MessageBoxButton.OK);
                    return;
                }
            }
            else
            {
                comp = PluginManager.inst().Compilers.FirstOrDefault();
                if (comp == null)
                {
                    ModernDialog.ShowMessage("No compiler plugins are installed", "Error", MessageBoxButton.OK);
                    return;
                }
            }


            Parago.Windows.ProgressDialogResult result = Parago.Windows.ProgressDialog.Execute(null, "Compiling...", (a, b) => {
                comp.CompileFile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst(), ErrorHandler.inst());

                MainWindow.inst().Dispatcher.Invoke(delegate() {
                    if (IDEProject.inst().CompileErrors.Count != 0)
                    {
                        Dlg.CompErrDlg dlg = new Dlg.CompErrDlg();
                        dlg.ShowDialog();
                    }

                    if (IDEProject.inst().CompileErrors.Count == 0)
                    {
                        foreach (PluginLib.ICompilerService c in PluginManager.inst().Compilers)
                        {
                            c.PostCompile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst().Settings.SourceTree, ErrorHandler.inst());
                        }
                        Dlg.CompSuccessDlg dlg = new Dlg.CompSuccessDlg();
                        dlg.ShowDialog();
                    }
                });
            });
        }
        public static void Compile()
        {
            if (IDEProject.inst().Settings.CompilerPath == null || IDEProject.inst().Settings.CompilerPath.Trim().Length == 0) {
                if (ModernDialog.ShowMessage("You need to set a compile file in settings", "No princess here", System.Windows.MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
                    IDESettingsDlg dlg = new IDESettingsDlg();
                    dlg.ShowDialog();
                }
                return;
            }
            IDEProject.inst().CompilerOutput = "";
            IDEProject.inst().CompileErrors.Clear();
            PluginLib.ICompilerService comp = null;

            if (IDEProject.inst().Settings.Compiler != null && IDEProject.inst().Settings.Compiler.Length > 0)
            {
                comp = PluginManager.inst().Compilers.FirstOrDefault(c => c.Name.Equals(IDEProject.inst().Settings.Compiler));
                if (comp == null) {
                    ModernDialog.ShowMessage(String.Format("Unable to find compiler: \"{0}\"", IDEProject.inst().Settings.Compiler), "Error", MessageBoxButton.OK);
                    return;
                }
            }
            else
            {
                comp = PluginManager.inst().Compilers.FirstOrDefault();
                if (comp == null)
                {
                    ModernDialog.ShowMessage("No compiler plugins are installed", "Error", MessageBoxButton.OK);
                    return;
                }
            }

            Parago.Windows.ProgressDialogResult result = Parago.Windows.ProgressDialog.Execute(null, "Compiling...", (a,b) => {
                comp.CompileFile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst(), ErrorHandler.inst());

                MainWindow.inst().Dispatcher.Invoke(delegate() {
                    if (IDEProject.inst().CompileErrors.Count != 0)
                    {
                        Dlg.CompErrDlg dlg = new Dlg.CompErrDlg();
                        dlg.ShowDialog();
                    }

                    if (IDEProject.inst().CompileErrors.Count == 0)
                    {
                        foreach (PluginLib.ICompilerService c in PluginManager.inst().Compilers)
                            c.PostCompile(IDEProject.inst().Settings.CompilerPath, IDEProject.inst().Settings.SourceTree, ErrorHandler.inst());
                        Dlg.CompSuccessDlg dlg = new Dlg.CompSuccessDlg();
                        dlg.ShowDialog();
                    }
                });
            });
        }