Exemple #1
0
        /// <summary>
        /// Coppies data in the current plot surface view window to the clipboard
        /// as text.
        /// </summary>
        public void CopyDataToClipboard()
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            for (int i = 0; i < this.InteractivePlotSurface2D.Drawables.Count; ++i)
            {
                IPlot plot = this.InteractivePlotSurface2D.Drawables[i] as IPlot;
                if (plot != null)
                {
                    Axis xAxis = this.InteractivePlotSurface2D.WhichXAxis(plot);
                    Axis yAxis = this.InteractivePlotSurface2D.WhichYAxis(plot);

                    RectangleD region = new RectangleD(
                        xAxis.WorldMin,
                        yAxis.WorldMin,
                        xAxis.WorldMax - xAxis.WorldMin,
                        yAxis.WorldMax - yAxis.WorldMin);

                    plot.WriteData(sb, region, true);
                }
            }

            Clipboard.SetDataObject(sb.ToString(), true);
        }