Exemple #1
0
        private void SetupGrid()
        {
            var fontBold = new Font(Font, FontStyle.Bold);
            var blankAccountEventSettings = new AccountEventSettings();

            gridEvents.Columns.Add(new FastColumn(blankAccountEventSettings.Property(p => p.CodeName), Localizer.GetString("TitleEvent"))
            {
                ColumnMinWidth = 60
            });
            gridEvents.Columns.Add(new FastColumn(blankAccountEventSettings.Property(p => p.ActionName), Localizer.GetString("TitleAction"))
            {
                ColumnMinWidth         = 60,
                IsHyperlinkStyleColumn = true,
                HyperlinkFontActive    = fontBold,
                HyperlinkActiveCursor  = Cursors.Hand
            });

            foreach (var action in Enum.GetValues(typeof(AccountEventAction)).Cast <AccountEventAction>())
            {
                var item = contextMenuAction.Items.Add(EnumFriendlyName <AccountEventAction> .GetString(action));
                item.Tag    = action;
                item.Click += ActionMenuItemClicked;
            }

            var blankBarSettings = new BarSettings();

            gridCandles.Columns.Add(new FastColumn(blankBarSettings.Property(p => p.Title), Localizer.GetString("TitleName")));
            gridCandles.Columns.Add(new FastColumn(blankBarSettings.Property(p => p.TimeDescription), Localizer.GetString("TitleIntervals")));

            var blankGridImageRecord = new GridImageRecord(string.Empty, null, null);

            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.Name), Localizer.GetString("TitleParameter"))
            {
                SortOrder      = FastColumnSort.Ascending,
                ColumnMinWidth = 100
            });
            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.Name), "?")
            {
                ColumnWidth              = 20,
                formatter                = v => "?",
                IsHyperlinkStyleColumn   = true,
                HyperlinkActiveCursor    = Cursors.Hand,
                HyperlinkFontActive      = fontBold,
                ColorHyperlinkTextActive = Color.Blue
            });
            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.ImageIndex), "*")
            {
                ColumnWidth            = 23,
                IsHyperlinkStyleColumn = true,
                HyperlinkActiveCursor  = Cursors.Hand,
                ImageList = imageListSetsGrid
            });
            gridTradeSettings.UserHitCell += GridTradeSettingsOnUserHitCell;
            // заполнить таблицу настроек
            var sets = new List <GridImageRecord>
            {
                new GridImageRecord(Localizer.GetString("MessageQuotesConfirmOrder"),
                                    val => { UserSettings.Instance.PromptTradeFromQuoteWindow = (bool)val; },
                                    () => UserSettings.Instance.PromptTradeFromQuoteWindow)
                {
                    BooleanValue = UserSettings.Instance.PromptTradeFromQuoteWindow
                },
                new GridImageRecord(Localizer.GetString("MessageQuotesConfirmOrder"),
                                    val => { UserSettings.Instance.PromptFastButtonTrade = (bool)val; },
                                    () => UserSettings.Instance.PromptFastButtonTrade)
                {
                    BooleanValue = UserSettings.Instance.PromptFastButtonTrade
                },
                new GridImageRecord(Localizer.GetString("MessageInstantOrderPriceCheck"),
                                    val => { UserSettings.Instance.CheckInstTradePrice = (bool)val; },
                                    () => UserSettings.Instance.CheckInstTradePrice)
                {
                    BooleanValue = UserSettings.Instance.CheckInstTradePrice
                }
            };

            gridTradeSettings.CalcSetTableMinWidth();
            gridTradeSettings.DataBind(sets);
            gridTradeSettings.CheckSize();
        }
Exemple #2
0
        private void SetupGrid()
        {
            var fontBold = new Font(Font, FontStyle.Bold);
            var blankAccountEventSettings = new AccountEventSettings();
            gridEvents.Columns.Add(new FastColumn(blankAccountEventSettings.Property(p => p.CodeName), Localizer.GetString("TitleEvent"))
                {
                    ColumnMinWidth = 60
                });
            gridEvents.Columns.Add(new FastColumn(blankAccountEventSettings.Property(p => p.ActionName), Localizer.GetString("TitleAction"))
                {
                    ColumnMinWidth = 60,
                    IsHyperlinkStyleColumn = true,
                    HyperlinkFontActive = fontBold,
                    HyperlinkActiveCursor = Cursors.Hand
                });

            foreach (var action in Enum.GetValues(typeof(AccountEventAction)).Cast<AccountEventAction>())
            {
                var item = contextMenuAction.Items.Add(EnumFriendlyName<AccountEventAction>.GetString(action));
                item.Tag = action;
                item.Click += ActionMenuItemClicked;
            }

            var blankBarSettings = new BarSettings();
            gridCandles.Columns.Add(new FastColumn(blankBarSettings.Property(p => p.Title), Localizer.GetString("TitleName")));
            gridCandles.Columns.Add(new FastColumn(blankBarSettings.Property(p => p.TimeDescription), Localizer.GetString("TitleIntervals")));

            var blankGridImageRecord = new GridImageRecord(string.Empty, null, null);
            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.Name), Localizer.GetString("TitleParameter"))
                {
                    SortOrder = FastColumnSort.Ascending,
                    ColumnMinWidth = 100
                });
            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.Name), "?")
            {
                ColumnWidth = 20,
                formatter = v => "?",
                IsHyperlinkStyleColumn = true,
                HyperlinkActiveCursor = Cursors.Hand,
                HyperlinkFontActive = fontBold,
                ColorHyperlinkTextActive = Color.Blue
            });
            gridTradeSettings.Columns.Add(new FastColumn(blankGridImageRecord.Property(p => p.ImageIndex), "*")
            {
                ColumnWidth = 23,
                IsHyperlinkStyleColumn = true,
                HyperlinkActiveCursor = Cursors.Hand,
                ImageList = imageListSetsGrid
            });
            gridTradeSettings.UserHitCell += GridTradeSettingsOnUserHitCell;
            // заполнить таблицу настроек
            var sets = new List<GridImageRecord>
                {
                    new GridImageRecord(Localizer.GetString("MessageQuotesConfirmOrder"),
                        val => { UserSettings.Instance.PromptTradeFromQuoteWindow = (bool) val; },
                        () => UserSettings.Instance.PromptTradeFromQuoteWindow)
                        {
                            BooleanValue = UserSettings.Instance.PromptTradeFromQuoteWindow
                        },
                    new GridImageRecord(Localizer.GetString("MessageQuotesConfirmOrder"),
                        val => { UserSettings.Instance.PromptFastButtonTrade = (bool) val; },
                        () => UserSettings.Instance.PromptFastButtonTrade)
                        {
                            BooleanValue = UserSettings.Instance.PromptFastButtonTrade
                        },
                    new GridImageRecord(Localizer.GetString("MessageInstantOrderPriceCheck"),
                        val => { UserSettings.Instance.CheckInstTradePrice = (bool) val; },
                        () => UserSettings.Instance.CheckInstTradePrice)
                        {
                            BooleanValue = UserSettings.Instance.CheckInstTradePrice
                        }
                };
            gridTradeSettings.CalcSetTableMinWidth();
            gridTradeSettings.DataBind(sets);
            gridTradeSettings.CheckSize();
        }