internal void ClearLog() { lock (this.guardMutex) { ConsoleWriter.Clear(); RaisePropertyChanged("LogText"); } }
static public void Clear() { if (cw == null) { cw = new ConsoleWriter(); //will do a clear } cw.Clear(); }
public void ClearLog() { ConsoleWriter.Clear(); RaisePropertyChanged("LogText"); }
private void UpdateLivePreview() { lvwPreviewErrors.Items.Clear(); try { if (IsLivePreviewEnabled && BackgroundCompiler.Output != null) { btnPausePreview.Checked = false; btnPausePreview.Text = "Pause"; btnPausePreview.Image = Properties.Resources.Pause; ctlCanvas.Hide(); lblPreparingPreview.Show(); _currentScale = 1; if (_sketch != null) { if (!_sketch.NoLoop()) { //BuildPreview(); //return; } } _consoleWriter.Clear(); txtConsoleOutput.Clear(); pnlCanvasContainer.Controls.Remove(ctlCanvas); ctlCanvas.Dispose(); ctlCanvas = new Windows.SketchContainer(); ctlCanvas.DesignMode = true; pnlCanvasContainer.Controls.Add(ctlCanvas); _sketch = new Sketch(); _sketch.UseDefaultConsole = false; Windows.Application.Set(_sketch); Applet applet = BackgroundCompiler.Output.CreateInstance("App") as Applet; _sketch.Start(applet, ctlCanvas); ctlCanvas_SizeChanged(null, null); lblPreparingPreview.Hide(); } else if (IsLivePreviewEnabled && _sketch != null) { //_sketch.NoLoop(); } if (BackgroundCompiler.CompilerErrors != null) { foreach (CompilerError error in BackgroundCompiler.CompilerErrors) { string line = error.Line == 0 ? "" : error.Line.ToString(); if (lvwPreviewErrors.Items.ContainsKey(line)) { lvwPreviewErrors.Items[line].SubItems[1].Text += " " + error.ErrorText + "."; } else { ListViewItem lvi = lvwPreviewErrors.Items.Add(string.IsNullOrEmpty(line) ? null : line, line, 0); lvi.SubItems.Add(error.ErrorText + "."); } } } if (BackgroundCompiler.Exception != null) { lvwPreviewErrors.Items.Add("").SubItems.Add(BackgroundCompiler.Exception.Message).Tag = BackgroundCompiler.Exception; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Live Preview", MessageBoxButtons.OK, MessageBoxIcon.Error); } }