/// <summary> /// Handles the copy code event. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param> private static void HandleCopyCode(IPlotView view, OxyInputEventArgs args) { args.Handled = true; var code = view.ActualModel.ToCode(); view.SetClipboardText(code); }
/// <summary> /// Handles the copy text report event. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs"/> instance containing the event data.</param> private static void HandleCopyTextReport(IPlotView view, OxyInputEventArgs args) { args.Handled = true; var text = view.ActualModel.CreateTextReport(); view.SetClipboardText(text); }
/// <summary> /// Zooms the view by the key in the specified factor. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param> private static void HandleZoomCenter(IPlotView view, OxyInputEventArgs args, double delta) { args.Handled = true; view.ActualModel.ZoomAllAxes(1 + (delta * 0.12)); view.InvalidatePlot(false); mw.onUpdate(); }
/// <summary> /// Handles the reset event. /// </summary> /// <param name="view">The view to reset.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> private static void HandleReset(IPlotView view, OxyInputEventArgs args) { args.Handled = true; view.ActualModel.ResetAllAxes(); view.InvalidatePlot(false); mw.onUpdate(); }
/// <summary> /// Pans the view by the key in the specified vector. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <param name="dx">The horizontal delta (percentage of plot area width).</param> /// <param name="dy">The vertical delta (percentage of plot area height).</param> private static void HandlePan(IPlotView view, OxyInputEventArgs args, double dx, double dy) { args.Handled = true; dx *= view.ActualModel.PlotArea.Width; dy *= view.ActualModel.PlotArea.Height; view.ActualModel.PanAllAxes(dx, dy); view.InvalidatePlot(false); }
public void Execute(IView view, IController controller, OxyInputEventArgs args) { foreach (var cmd in commands) { cmd.Execute(view, controller, args); if (args.Handled) { break; } } }
/// <summary> /// Performs the copy operation. /// </summary> private void DoCopy(IPlotView view, OxyInputEventArgs args) { var exporter = new PngExporter { Width = this.ClientRectangle.Width, Height = this.ClientRectangle.Height, }; var bitmap = exporter.ExportToBitmap(this.ActualModel); Clipboard.SetImage(bitmap); }
/// <summary> /// Performs the copy operation. /// </summary> private void DoCopy(IPlotView view, OxyInputEventArgs args) { var background = this.ActualModel.Background.IsVisible() ? this.ActualModel.Background : this.ActualModel.Background; if (background.IsInvisible()) { background = OxyColors.White; } var exporter = new PngExporter { Width = this.ClientRectangle.Width, Height = this.ClientRectangle.Height, Background = background }; var bitmap = exporter.ExportToBitmap(this.ActualModel); Clipboard.SetImage(bitmap); }
private void PlotEventHandler(int chartIndex, OxyInputEventArgs e) { PlotModels[chartIndex].InvalidatePlot(false); e.Handled = true; }
/// <summary> /// Zooms the view by the key in the specified factor. /// </summary> /// <param name="view">The view.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> /// <param name="delta">The zoom factor (positive zoom in, negative zoom out).</param> private static void HandleZoomCenter(IPlotView view, OxyInputEventArgs args, double delta) { args.Handled = true; view.ActualModel.ZoomAllAxes(1 + (delta * 0.12)); view.InvalidatePlot(false); }
/// <summary> /// Handles the reset event. /// </summary> /// <param name="view">The view to reset.</param> /// <param name="args">The <see cref="OxyInputEventArgs" /> instance containing the event data.</param> private static void HandleReset(IPlotView view, OxyInputEventArgs args) { args.Handled = true; view.ActualModel.ResetAllAxes(); view.InvalidatePlot(false); }