Esempio n. 1
0
        // Compile() is called by a background Thread in ProgressForm so be carful

        void ICompilableHelp.Compile(IProgressReporter progressReporter) //Called by Progress form
        {
            try
            {
                HxComp hxsCompiler = new HxComp();
                hxsCompiler.Initialize();

                CompMsg compMsg = new CompMsg(progressReporter, this.logFile);
                compMsg.Log("Date: " + DateTime.Today.ToShortDateString() + ", " + DateTime.Today.ToShortTimeString());
                compMsg.Log("Log file: " + logFile);
                compMsg.Log("Project file: " + projectFile);
                compMsg.Log("");
                int cookie = hxsCompiler.AdviseCompilerMessageCallback(compMsg);

                // Compile
                //
                hxsCompiler.Compile(projectFile, hxsDir, outputFile, 0);

                hxsCompiler.UnadviseCompilerMessageCallback(cookie);   //Done - Break link with compMsg Obj
                compMsg.SaveLog();
                hxsCompiler = null;

                //Show the log file if errors
                if (compMsg.ErrorCount > 0)   //If nore Warnings
                {
                    SafeShowCompileError();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        //Called by Progress form
        // Compile() is called by a background Thread in ProgressForm so be carful
        void ICompilableHelp.Compile(IProgressReporter progressReporter)
        {
            try
            {
                HxComp hxsCompiler = new HxComp();
                hxsCompiler.Initialize();

                CompMsg compMsg = new CompMsg(progressReporter, this.logFile);
                compMsg.Log("Date: " + DateTime.Today.ToShortDateString() + ", " + DateTime.Today.ToShortTimeString());
                compMsg.Log("Log file: " + logFile);
                compMsg.Log("Project file: " + projectFile);
                compMsg.Log("");
                int cookie = hxsCompiler.AdviseCompilerMessageCallback(compMsg);

                // Compile
                //
                hxsCompiler.Compile(projectFile, hxsDir, outputFile, 0);

                hxsCompiler.UnadviseCompilerMessageCallback(cookie);   //Done - Break link with compMsg Obj
                compMsg.SaveLog();
                hxsCompiler = null;

                //Show the log file if errors
                if (compMsg.ErrorCount > 0)   //If nore Warnings
                {
                    SafeShowCompileError();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }