public virtual void KeyDown(object sender, KeyEventArgs e) { #if !PLAYER if (e.Key == System.Windows.Input.Key.Escape) { AbortAndSetDefaultTool(); e.Handled = true; } else if (e.Key == System.Windows.Input.Key.Delete) { try { Drawing.DeleteSelection(); } catch (Exception) { } } else if (e.Key == System.Windows.Input.Key.A) { Settings.Instance.AutoLabelPoints = !Settings.Instance.AutoLabelPoints; string state = (Settings.Instance.AutoLabelPoints) ? "on." : "off."; Drawing.RaiseStatusNotification("Toggling automatic labeling of points " + state); } else if (e.Key == System.Windows.Input.Key.G) { Settings.Instance.EnableSnapToGrid = !Settings.Instance.EnableSnapToGrid; string state = (Settings.Instance.EnableSnapToGrid) ? "on." : "off."; Drawing.RaiseStatusNotification("Toggling constraining to grid " + state); } #endif }
public void LoadDrawing(string drawingXml, string fileName) { XElement xml = null; try { xml = XElement.Parse(drawingXml); } catch (Exception ex) { Drawing.RaiseStatusNotification("Invalid file format: " + ex.ToString()); return; } LoadDrawing(xml, fileName); }
private void mCurrentDrawing_ConstructionStepComplete(object sender, Drawing.ConstructionStepCompleteEventArgs args) { if (args.ConstructionComplete) { ConstructionInProgress = false; UpdateUndoRedo(); Drawing.ClearStatus(); } else { Drawing.RaiseDisplayProperties(Drawing.Behavior.PropertyBag); CommandRedo.Enabled = false; Drawing.RaiseStatusNotification(Drawing.Behavior.ConstructionHintText(args)); } }
protected void PlotFunction(string function) { var result = MEFHost.Instance.CompilerService.CompileFunction(Drawing, function); Func <double, double> func = result.Function; if (func != null) { var graph = CreateFunctionGraph(); graph.Drawing = Drawing; graph.FunctionText = function; Actions.Add(Drawing, graph); Drawing.ClearStatus(); } else { Drawing.RaiseStatusNotification(result.ToString()); } }
public void ShowOperationDuration(Action code) { var duration = Utilities.ElapsedTime(code); Drawing.RaiseStatusNotification(string.Format("Processed in {0} milliseconds", duration)); }
public void ZoomOut() { UnitLength *= 1 / zoomFactor; Drawing.RaiseStatusNotification(UnitLength.ToString()); }