Exemple #1
0
        public ChartSettingsForm(ChartForm activeChart, IList <ChartForm> allCharts)
        {
            InitializeComponent();

            Localizer.LocalizeControl(this);
            this.activeChart = activeChart;
            this.allCharts   = allCharts;
            cbYAxis.Items.AddRange(EnumItem <YAxisAlignment> .items.Cast <object>().ToArray());
            cbChartType.Items.AddRange(EnumItem <StockSeries.CandleDrawMode> .items.Cast <object>().ToArray());
            cbTheme.Items.AddRange(EnumItem <ChartControl.Themes> .items.Cast <object>().ToArray());

            // компонент выбора цветовой схемы
            colorPicker              = new ColorSchemePicker(pictureBoxCandle);
            colorPicker.OnPickColor += colorPicker_OnPickColor;
            cbUseMarkerPrice.Checked = activeChart == null ? true : activeChart.chart.chart.StockSeries.ShowLastQuote;
            cbAutoScroll.Checked     = activeChart == null ? true : activeChart.chart.chart.StockSeries.AutoScroll;
            InitColorPicker();

            // заполнить значения полей
            if (activeChart != null)
            {
                InitFields(activeChart);
            }
            else
            {
                InitFields(allCharts);
                btnAccept.Enabled = false;
            }
        }
        public ChartSettingsForm(ChartForm activeChart, IList<ChartForm> allCharts)
        {
            InitializeComponent();

            Localizer.LocalizeControl(this);
            this.activeChart = activeChart;
            this.allCharts = allCharts;
            cbYAxis.Items.AddRange(EnumItem<YAxisAlignment>.items.Cast<object>().ToArray());
            cbChartType.Items.AddRange(EnumItem<StockSeries.CandleDrawMode>.items.Cast<object>().ToArray());
            cbTheme.Items.AddRange(EnumItem<ChartControl.Themes>.items.Cast<object>().ToArray());

            // компонент выбора цветовой схемы
            colorPicker = new ColorSchemePicker(pictureBoxCandle);
            colorPicker.OnPickColor += colorPicker_OnPickColor;
            cbUseMarkerPrice.Checked = activeChart == null ? true : activeChart.chart.chart.StockSeries.ShowLastQuote;
            cbAutoScroll.Checked = activeChart == null ? true : activeChart.chart.chart.StockSeries.AutoScroll;
            InitColorPicker();

            // заполнить значения полей
            if (activeChart != null)
                InitFields(activeChart);
            else
            {
                InitFields(allCharts);
                btnAccept.Enabled = false;
            }
        }