示例#1
0
        //Func<Bitmap, T> BmpConverter;
        //public TikzDisplayModel(ITikzDisplayView View, Func<Bitmap, T> BmpConverter)
        public TikzDisplayModel(ITikzDisplayView View, IPdfToBmp <T> PdfBmpConverter)
        {
            this.View = View;
            //this.BmpConverter = BmpConverter;

            //myPdfBmpDoc = new PdfToBmp();
            myPdfBmpDoc = PdfBmpConverter; //new PdfToBmpExtWinForms();
            AsyncBmpGenerator.DoWork             += new DoWorkEventHandler(AsyncBmpGenerator_DoWork);
            AsyncBmpGenerator.RunWorkerCompleted += new RunWorkerCompletedEventHandler(AsyncBmpGenerator_RunWorkerCompleted);
        }
示例#2
0
        public TexCompiler()
        {
            if (CompilerSettings.Instance.UseExternalRenderer)
                mypdfDoc = new PdfToBmpExtWinForms();
            else
                mypdfDoc = new PdfToBmp();

            //texProcess.EnableRaisingEvents = true;
            //texProcess.StartInfo.Arguments = "-quiet -halt-on-error " + Consts.cTempFile + ".tex";
            texProcess.StartInfo.FileName = CompilerSettings.Instance.Path_pdflatex;//"pdflatex";
            texProcess.StartInfo.CreateNoWindow = true;
            texProcess.StartInfo.UseShellExecute = false;

            //      texProcess.StartInfo.UseShellExecute = true;
            texProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            texProcess.StartInfo.RedirectStandardOutput = true;
            texProcess.StartInfo.RedirectStandardError = true;
            // texProcess.SynchronizingObject = (System.ComponentModel.ISynchronizeInvoke) this;
            //texProcess.Exited += new EventHandler(texProcess_Exited);
            //texProcess.OutputDataReceived += new DataReceivedEventHandler(texProcess_OutputDataReceived);
            //texProcess.ErrorDataReceived += new DataReceivedEventHandler(texProcess_OutputDataReceived);
            timer.Tick += new EventHandler(timer_Tick);

            AsyncReaderWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(AsyncReaderWorker_DoWork);
            AsyncReaderWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(AsyncReaderWorker_RunWorkerCompleted);

            //myPdflatexOutputParser.OnTexError += new TexOutputParser.TexErrorHandler(myPdflatexOutputParser_OnTexError);
            //myPdflatexOutputParser.addProblem +=new PdflatexOutputParser.addProblemEventHandler(myPdflatexOutputParser_addProblem);
            //texProcess.ErrorDataReceived += new DataReceivedEventHandler(texProcess_ErrorDataReceived);
        }