Exemple #1
0
            public static Button Button(Expressions Expression, EventHandler <ExpressionEventArgs> OnClick,
                                        Color BackColor = default(Color), Color TextColor = default(Color))
            {
                if (BackColor == default(Color))
                {
                    BackColor = Color.Silver;
                }
                if (TextColor == default(Color))
                {
                    TextColor = Color.Black;
                }
                Button Button = new Button {
                    Text      = Expression.AsString(),
                    TextColor = TextColor, BackgroundColor = BackColor
                };

                Button.Clicked += (object sender, EventArgs e) => { OnClick(sender, new ExpressionEventArgs(Expression)); };
                return(Button);
            }