InitialSampleDemo → DemoBase → ZedGraphDemo(介面)
ZedGraphDemo 介面定義:Description、Title、ZedGraphControl、Types 四屬性。DemoBase 實作介面,並新增 PaneBase Pane、MasterPane MasterPane 兩屬性,提供多載構造函數。public InitialSampleDemo() : base("Code Project Initial Sample", "Initial Sample", DemoType.Tutorial)
基類四個多載構造函數最終呼叫私有 Init 方法:
private void Init(string description, string title, ICollection types) {
this.description = description;
this.title = title;
this.types = types;
control = new ZedGraphControl();
}
myPane.Title = "My Test Graph\n(For CodeProject Sample)";
myPane.XAxis.Title = "My X Axis";
myPane.YAxis.Title = "My Y Axis";
對應圖示中的標題區域。
同前節,使用 PointPairList 填充 36 個點的正弦波資料。