Beispiel #1
0
        public void UpdateView(int index, decimal value, string toolTip, bool isHero)
        {
            if (Config.HudBigBlindDecimals > 0)
            {
                var f = ""; for (int i = 0; i < Config.HudBigBlindDecimals; i++)
                {
                    f += "0";
                }
                UCLabel_Main.SetText(string.Format("{1}{0:0." + f + "}{2}", value, Config.HudBigBlindPrefix, Config.HudBigBlindPostfix));
            }
            else
            {
                UCLabel_Main.SetText(string.Format("{1}{0:0}{2}", value, Config.HudBigBlindPrefix, Config.HudBigBlindPostfix));
            }

            ToolTip = toolTip ?? "";

            Left = Table.RectangleClient.X + Table.RectangleClient.Width * Config.HudBigBlindLocationsX[(int)Table.TableHud.TableSize][index];
            Top  = Table.RectangleClient.Y + Table.RectangleClient.Height * Config.HudBigBlindLocationsY[(int)Table.TableHud.TableSize][index];

            if (!isHero)
            {
                UCLabel_Main.SetBackground(Config.HudBigBlindOpponentsBackground);
                UCLabel_Main.SetForeground(ColorByValue.GetColorByValue(Config.HudBigBlindOpponentsForeground, value, Config.HudBigBlindOpponentsColorsByValue));
                UCLabel_Main.SetFontFamily(Config.HudBigBlindOpponentsFontFamily);
                UCLabel_Main.SetFontWeight(Config.HudBigBlindOpponentsFontWeight);
                UCLabel_Main.SetFontStyle(Config.HudBigBlindOpponentsFontStyle);
                UCLabel_Main.SetMargin(Config.HudBigBlindOpponentsMargin);
                UCLabel_Main.SetBorderBrush(Config.HudBigBlindOpponentsBorderBrush);
                UCLabel_Main.SetBorderThickness(Config.HudBigBlindOpponentsBorderThickness);
                UCLabel_Main.SetCornerRadius(Config.HudBigBlindOpponentsCornerRadius);

                //UCLabel_Main.SetFontSize(Config.HudBigBlindOpponentsFontSize);
                Viewbox_Main.Height = ((Config.HudBigBlindOpponentsFontSize + Config.HudBigBlindOpponentsMargin.Top + Config.HudBigBlindOpponentsMargin.Bottom) / 546.0) * Table.RectangleClient.Height;
            }
            else
            {
                UCLabel_Main.SetBackground(Config.HudBigBlindHeroBackground);
                UCLabel_Main.SetForeground(ColorByValue.GetColorByValue(Config.HudBigBlindHeroForeground, value, Config.HudBigBlindHeroColorsByValue));
                UCLabel_Main.SetFontFamily(Config.HudBigBlindHeroFontFamily);
                UCLabel_Main.SetFontWeight(Config.HudBigBlindHeroFontWeight);
                UCLabel_Main.SetFontStyle(Config.HudBigBlindHeroFontStyle);
                UCLabel_Main.SetMargin(Config.HudBigBlindHeroMargin);
                UCLabel_Main.SetBorderBrush(Config.HudBigBlindHeroBorderBrush);
                UCLabel_Main.SetBorderThickness(Config.HudBigBlindHeroBorderThickness);
                UCLabel_Main.SetCornerRadius(Config.HudBigBlindHeroCornerRadius);

                //UCLabel_Main.SetFontSize(Config.HudBigBlindHeroFontSize);
                Viewbox_Main.Height = ((Config.HudBigBlindHeroFontSize + Config.HudBigBlindHeroMargin.Top + Config.HudBigBlindHeroMargin.Bottom) / 546.0) * Table.RectangleClient.Height;
            }
        }
        public UCColorByValue(Window owner, StackPanel stackPanel, ColorByValue colorByValue = null)
        {
            _stackPanel = stackPanel;
            InitializeComponent();

            UcColorPreview_Foreground.Owner = owner;

            TextBox_GreaterOrEqual.GotFocus += (sender, args) =>
            {
                if (TextBox_GreaterOrEqual.Text.Equals("-inf"))
                {
                    TextBox_GreaterOrEqual.Text = "";
                }
            };
            TextBox_Less.GotFocus += (sender, args) =>
            {
                if (TextBox_Less.Text.Equals("+inf"))
                {
                    TextBox_Less.Text = "";
                }
            };
            TextBox_GreaterOrEqual.LostFocus += (sender, args) =>
            {
                if (TextBox_GreaterOrEqual.Text.Equals("") || TextBox_GreaterOrEqual.Text.Equals("-inf"))
                {
                    TextBox_GreaterOrEqual.Text = "-inf";
                }
            };
            TextBox_Less.LostFocus += (sender, args) =>
            {
                if (TextBox_Less.Text.Equals("") || TextBox_Less.Text.Equals("+inf"))
                {
                    TextBox_Less.Text = "+inf";
                }
            };

            TextBox_GreaterOrEqual.TextChanged += (sender, args) => Validate();
            TextBox_Less.TextChanged += (sender, args) => Validate();

            if (colorByValue != null)
            {
                TextBox_GreaterOrEqual.Text = colorByValue.GreaterOrEqual == decimal.MinValue ? "-inf" : colorByValue.GreaterOrEqual.ToString(CultureInfo.InvariantCulture);
                TextBox_Less.Text = colorByValue.Less == decimal.MaxValue ? "+inf" : colorByValue.Less.ToString(CultureInfo.InvariantCulture);
                UcColorPreview_Foreground.Color = colorByValue.Color;
            }

            Validate();
        }
        public UCColorByValue(Window owner, StackPanel stackPanel, ColorByValue colorByValue = null)
        {
            _stackPanel = stackPanel;
            InitializeComponent();

            UcColorPreview_Foreground.Owner = owner;

            TextBox_GreaterOrEqual.GotFocus += (sender, args) =>
            {
                if (TextBox_GreaterOrEqual.Text.Equals("-inf"))
                {
                    TextBox_GreaterOrEqual.Text = "";
                }
            };
            TextBox_Less.GotFocus += (sender, args) =>
            {
                if (TextBox_Less.Text.Equals("+inf"))
                {
                    TextBox_Less.Text = "";
                }
            };
            TextBox_GreaterOrEqual.LostFocus += (sender, args) =>
            {
                if (TextBox_GreaterOrEqual.Text.Equals("") || TextBox_GreaterOrEqual.Text.Equals("-inf"))
                {
                    TextBox_GreaterOrEqual.Text = "-inf";
                }
            };
            TextBox_Less.LostFocus += (sender, args) =>
            {
                if (TextBox_Less.Text.Equals("") || TextBox_Less.Text.Equals("+inf"))
                {
                    TextBox_Less.Text = "+inf";
                }
            };

            TextBox_GreaterOrEqual.TextChanged += (sender, args) => Validate();
            TextBox_Less.TextChanged           += (sender, args) => Validate();

            if (colorByValue != null)
            {
                TextBox_GreaterOrEqual.Text     = colorByValue.GreaterOrEqual == decimal.MinValue ? "-inf" : colorByValue.GreaterOrEqual.ToString(CultureInfo.InvariantCulture);
                TextBox_Less.Text               = colorByValue.Less == decimal.MaxValue ? "+inf" : colorByValue.Less.ToString(CultureInfo.InvariantCulture);
                UcColorPreview_Foreground.Color = colorByValue.Color;
            }

            Validate();
        }