Пример #1
0
        ///<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);
            }
        }