107 lines
2.5 KiB
C#
107 lines
2.5 KiB
C#
using DrawGraph;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Drawing;
|
|
|
|
|
|
namespace DrawGraph
|
|
{
|
|
[JsonObject(MemberSerialization.OptOut)]
|
|
[Serializable]
|
|
public class BorderPackObj : PackObjBase
|
|
{
|
|
private float packWidth = 800f;
|
|
|
|
private float packHeight = 600f;
|
|
|
|
[ClassAttributs(Description = "面板宽度")]
|
|
public float SetWidth
|
|
{
|
|
get
|
|
{
|
|
return this.packWidth;
|
|
}
|
|
set
|
|
{
|
|
this.packWidth = value;
|
|
bool flag = this.baseZed != null;
|
|
if (flag)
|
|
{
|
|
this.baseZed.Width = int.Parse(Math.Round(Convert.ToDouble(value.ToString()), 0).ToString());
|
|
}
|
|
}
|
|
}
|
|
|
|
[ClassAttributs(Description = "面板高度")]
|
|
public float SetHeight
|
|
{
|
|
get
|
|
{
|
|
return this.packHeight;
|
|
}
|
|
set
|
|
{
|
|
this.packHeight = value;
|
|
bool flag = this.baseZed != null;
|
|
if (flag)
|
|
{
|
|
this.baseZed.Height = int.Parse(Math.Round(Convert.ToDouble(value.ToString()), 0).ToString());
|
|
}
|
|
}
|
|
}
|
|
|
|
public BorderPackObj(ZedGraphControl zgc, PackObjManager poManager) : base(zgc, poManager)
|
|
{
|
|
this.baseZed = zgc;
|
|
base.Descript = "白板对象";
|
|
base.PackText = "白板对象";
|
|
base.MyOrder = 100000;
|
|
this.init();
|
|
}
|
|
|
|
public void init()
|
|
{
|
|
bool flag = this.baseZed != null;
|
|
if (flag)
|
|
{
|
|
this.baseZed.IsZoomOnMouseCenter = false;
|
|
this.baseZed.IsEnableZoom = false;
|
|
this.baseZed.IsEnableVZoom = false;
|
|
this.baseZed.IsEnableHZoom = false;
|
|
this.baseZed.IsShowCursorValues = false;
|
|
this.baseZed.IsShowPointValues = false;
|
|
this.baseZed.GraphPane.Title.Text = "";
|
|
this.baseZed.GraphPane.Title.IsVisible = false;
|
|
this.baseZed.GraphPane.Margin.All = 0f;
|
|
this.baseZed.GraphPane.Border.IsVisible = false;
|
|
bool flag2 = this.baseZed.GraphPane.YAxisList.Count > 1;
|
|
if (flag2)
|
|
{
|
|
this.baseZed.GraphPane.YAxisList.RemoveRange(1, this.baseZed.GraphPane.YAxisList.Count - 1);
|
|
}
|
|
this.baseZed.GraphPane.CurveList.Clear();
|
|
this.baseZed.MasterPane.GraphObjList.Clear();
|
|
}
|
|
}
|
|
|
|
public override void Draw()
|
|
{
|
|
bool flag = this.baseZed != null;
|
|
if (flag)
|
|
{
|
|
this.baseZed.Width = int.Parse(Math.Round(Convert.ToDouble(this.SetWidth.ToString()), 0).ToString());
|
|
this.baseZed.Height = int.Parse(Math.Round(Convert.ToDouble(this.SetHeight.ToString()), 0).ToString());
|
|
base.Refresh();
|
|
}
|
|
}
|
|
|
|
public override void Clear()
|
|
{
|
|
this.baseZed.GraphPane.CurveList.Clear();
|
|
this.baseZed.MasterPane.GraphObjList.Clear();
|
|
Chart chart = this.baseZed.GraphPane.Chart;
|
|
chart.Rect = new RectangleF(0f, 0f, 0f, 0f);
|
|
}
|
|
}
|
|
}
|