///<summary>初始化</summary> ///<param name="window">窗口</param> public void Initialize(IWindow window) { if (Graphs.IsReadOnly) { throw new InvalidOperationException(); } Graphs.IsReadOnly = true; var count = Graphs.Count; if (count > 0) { var graphs = new GraphProperties[count]; var index = 0; foreach (var graph in Graphs) { graph.Initialize(m_Core, (uint)index); graphs[index] = new GraphProperties { BaselineType = graph.BaselineType, GraphStyle = graph.GraphStyle, Foreground = ColorHelper.GetColor(graph.Foreground, 0xFF000000u), LineWidth = (uint)graph.LineWidth, Offset = graph.Offset, AutoTranslate = (float)graph.AutoTranslateOffset, IsEnabled = graph.IsGraphEnabled }; ++index; } var arg = new ConstructionParameters(window, ColorHelper.GetColor(ContentBackground, 0xFFFFFFFFu), (uint)DataLength, (float)Range, (float)ScaleX, (float)MaxScaleX, (float)ScaleY, (float)MaxScaleY, (uint)TranslateX, (uint)TranslateY, RefreshMode, ColorHelper.GetColor(AxisColor, 0xFF000000u), (uint)AxisLineWidth, (uint)AxisTicksCountX, (uint)AxisTicksCountY, (uint)AxisTickSizeX, (uint)AxisTickSizeY, (uint)AxisSizeX, (uint)AxisSizeY, AxisPlacementX, AxisPlacementY, graphs); m_Core.Initialize(ref arg); } }
///<summary>初始化</summary> ///<param name="window">窗口</param> public void Initialize(IWindow window) { if (IsFrozen) { throw new InvalidOperationException(); } m_IsFrozen = true; m_Graph.Initialize(m_Core, 0u); var arg = new ConstructionParameters(window, ColorHelper.GetColor(ContentBackground, 0xFFFFFFFFu), (uint)DataLength, (float)Range, (float)ScaleX, (float)MaxScaleX, (float)ScaleY, (float)MaxScaleY, (uint)TranslateX, (uint)TranslateY, RefreshMode, ColorHelper.GetColor(AxisColor, 0xFF000000u), (uint)AxisLineWidth, (uint)AxisTicksCountX, (uint)AxisTicksCountY, (uint)AxisTickSizeX, (uint)AxisTickSizeY, (uint)AxisSizeX, (uint)AxisSizeY, AxisPlacementX, AxisPlacementY, new GraphProperties[] { new GraphProperties { BaselineType = BaselineType, GraphStyle = GraphStyle, Foreground = ColorHelper.GetColor(GraphForeground, 0xFF000000u), LineWidth = (uint)LineWidth, Offset = Offset, AutoTranslate = (float)AutoTranslateOffset, IsEnabled = IsGraphEnabled } }); m_Core.Initialize(ref arg); }