//解析模板数据
    public override void parseSample(int sid)
    {
        PlotSample sample  = new PlotSample();
        string     dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
Example #2
0
        /// <summary>
        /// Creates and shows samplePlot [index]
        /// </summary>
        private void ShowSample(int index)
        {
            layout.Remove(plotCanvas);                          // remove previous sample

            currentType   = sampleTypes [index];
            currentSample = (PlotSample)Activator.CreateInstance(currentType);
            plotCanvas    = currentSample.Canvas;

            infoBox.Buffer.Text = currentSample.InfoText;               // update info Text
            layout.Attach(plotCanvas, 0, 8, 0, 8);                      // attach new sample
            ShowAll();
        }
Example #3
0
    public override void copy(object destObj)
    {
        base.copy(destObj);
        PlotSample dest = destObj as PlotSample;

        if (this.sids != null)
        {
            dest.sids = new int[this.sids.Length];
            for (int i = 0; i < this.sids.Length; i++)
            {
                dest.sids [i] = this.sids [i];
            }
        }
    }
Example #4
0
        /// <summary>
        /// Creates and shows samplePlot [index]
        /// </summary>
        private void ShowSample(int index)
        {
            Point canvasOrigin = plotCanvas.Location;
            Size  canvasSize   = plotCanvas.Size;

            SuspendLayout();
            Controls.Remove(plotCanvas);                        // remove previous sample

            currentType   = sampleTypes [index];
            currentSample = (PlotSample)Activator.CreateInstance(currentType);

            plotCanvas          = currentSample.Canvas;
            plotCanvas.Location = canvasOrigin;
            plotCanvas.Size     = canvasSize;

            infoBox.Text = currentSample.InfoText;              // update info Text
            Controls.Add(plotCanvas);                           // Add new sample
            ResumeLayout();
        }