public override ChartIcon MakeCopy()
 {
     var cpy = new ChartIconDropDownDialog
                   {
                       Owner = Owner,
                       key = key,
                       Position = Position,
                       Size = Size
                   };
     return cpy;
 }
        public override ChartIcon MakeCopy()
        {
            var cpy = new ChartIconDropDownDialog
            {
                Owner    = Owner,
                key      = key,
                Position = Position,
                Size     = Size
            };

            return(cpy);
        }
        private static void SetupChartIcons()
        {
            // забубенить кнопкам картинки
            var imageKeyByName = new Dictionary<string, string[]>
                {
                    { ChartIcon.ChartIcon.chartButtonStatByTicker, new [] { "ico_calculator.png" } },
                    { ChartIcon.ChartIcon.chartButtonDealByTicker, new [] { "ico_black_orders.png" } },
                    { ChartIcon.ChartIcon.chartButtonFastBuy, new [] { "ico_black_up.png" } },
                    { ChartIcon.ChartIcon.chartButtonFastSell, new [] { "ico_black_down.png" } },
                    { ChartIcon.ChartIcon.chartButtonFavIndicators, new [] { "ico_black_favourite.png" } },
                    { ChartIcon.ChartIcon.chartButtonIndexAutoScroll, new [] { "ico_black_forward.png", "ico_black_pause.png" } },
                    { ChartIcon.ChartIcon.chartButtonIndicators, new [] { "ico_black_indicator.png" } },
                    { ChartIcon.ChartIcon.chartButtonNewOrder, new [] { "ico_black_dollar.png" } },
                    { ChartIcon.ChartIcon.chartButtonPatchQuotes, new [] { "ico_black_synch.png" } },
                    { ChartIcon.ChartIcon.chartButtonQuoteArchive, new [] { "ico_black_archive.png" } },
                    { ChartIcon.ChartIcon.chartVisualSettings, new [] { "ico_makeup.png" } },
                    { ChartIcon.ChartIcon.chartProfitByTicker, new [] { "ico_profit_ticker.png" } },
                    { ChartIcon.ChartIcon.chartRobot, new [] { "ico_robot.png" } },
                };

            foreach (var img in imageKeyByName)
            {
                var imgCollection = new ChartIcon.ChartIcon.ButtonImageCollection
                    {
                        images = new Bitmap[2,img.Value.Length]
                    };

                for (var i = 0; i < img.Value.Length; i++)
                {
                    // загрузить картинку и создать ее инверсную копию
                    var fullName = "Candlechart.images." + img.Value[i];
                    Bitmap imgNormal, imgInverse;
                    LoadImageFromResxAndMakeInverseCopy(fullName, out imgNormal, out imgInverse);
                    imgCollection.images[0, i] = imgNormal;
                    imgCollection.images[1, i] = imgInverse;
                }
                ChartIcon.ChartIcon.AddButtonImages(img.Key, imgCollection);
            }

            var iconStatByTicker = new ChartIconDropDownDialog
            {
                key = ChartIcon.ChartIcon.chartButtonStatByTicker
            };
            var iconAscroll = new ChartIconCheckBox(null)
            {
                key = ChartIcon.ChartIcon.chartButtonIndexAutoScroll
            };
            var iconIndi = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartButtonIndicators
            };
            var iconOrder = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartButtonNewOrder
            };
            var iconArchive = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartButtonQuoteArchive
            };
            var iconPatchQuotes = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartButtonPatchQuotes
            };
            var iconFavIndi = new ChartIconDropDown
            {
                key = ChartIcon.ChartIcon.chartButtonFavIndicators
            };
            var iconFastSell = new ChartIconDropDown
            {
                key = ChartIcon.ChartIcon.chartButtonFastSell
            };
            var iconFastBuy = new ChartIconDropDown
            {
                key = ChartIcon.ChartIcon.chartButtonFastBuy
            };
            var iconFastOrders = new ChartIconDropDown
            {
                key = ChartIcon.ChartIcon.chartButtonDealByTicker
            };
            var iconVisual = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartVisualSettings
            };
            var iconProfitByTicker = new ChartIcon.ChartIcon((obj, e) => { })
            {
                key = ChartIcon.ChartIcon.chartProfitByTicker
            };
            var iconRobots = new ChartIconDropDown
            {
                key = ChartIcon.ChartIcon.chartRobot
            };
            iconFastOrders.listControl.columns = new List<FastColumn>
                {
                    new FastColumn("") {ColumnWidth = 38},
                    new FastColumn("") {ColumnWidth = 72},
                    new FastColumn("") {ColumnWidth = 48},
                    new FastColumn("") {ColumnWidth = 73},
                    new FastColumn("") {ColumnWidth = 73}
                };
            iconFastOrders.listControl.MinWidth = iconFastOrders.listControl.columns.Sum(c => c.ColumnWidth);
            iconFastOrders.listControl.MaxWidth = iconFastOrders.listControl.MinWidth;
            iconFastOrders.listControl.Width = iconFastOrders.listControl.MinWidth;
            iconFastOrders.listControl.CalcWidthAuto = false;

            // добавить все в массив
            allChartIcons.Add(iconStatByTicker);
            allChartIcons.Add(iconFastOrders);
            allChartIcons.Add(iconAscroll);
            allChartIcons.Add(iconIndi);
            allChartIcons.Add(iconOrder);
            allChartIcons.Add(iconArchive);
            allChartIcons.Add(iconFavIndi);
            allChartIcons.Add(iconFastSell);
            allChartIcons.Add(iconFastBuy);
            allChartIcons.Add(iconPatchQuotes);
            allChartIcons.Add(iconVisual);
            allChartIcons.Add(iconProfitByTicker);
            allChartIcons.Add(iconRobots);

            allChartIcons.ForEach(i =>
                {
                    i.Size = new Size(22, 22);
                });
        }