private void pCollapse_Click(object sender, EventArgs e) { if (pCollapse.Visible) { ButtonClick?.Invoke(this, EventArgs.Empty); } }
private void Button_Click(object sender, RoutedEventArgs e) { if (sender == ButtonHPlus) { ButtonClick?.Invoke(this, 1); } if (sender == ButtonHMinus) { ButtonClick?.Invoke(this, 2); } if (sender == ButtonVPlus) { ButtonClick?.Invoke(this, 3); } if (sender == ButtonVMinus) { ButtonClick?.Invoke(this, 4); } if (sender == ButtonAuto) { ButtonClick?.Invoke(this, 5); } if (sender == ButtonLarger) { ButtonClick?.Invoke(this, 6); } if (sender == ButtonSmaller) { ButtonClick?.Invoke(this, 7); } }
/// <summary> /// Zavolá metodu <see cref="OnButtonClick(EventArgs)"/> a event <see cref="ButtonClick"/>. /// </summary> protected void CallButtonClick() { EventArgs args = EventArgs.Empty; OnButtonClick(args); ButtonClick?.Invoke(this, args); }
private void nowaGraToolStripMenuItem_Click(object sender, EventArgs e) { string nowaGra = "zaczynamy"; var now = new ButtonInteractionArgs(nowaGra); ButtonClick?.Invoke(this, now); }
private void wyjdźToolStripMenuItem_Click(object sender, EventArgs e) { char czyKoniec = 't'; var kon = new ButtonInteractionArgs(czyKoniec); ButtonClick?.Invoke(this, kon); }
private void button1_Click(object sender, EventArgs e) { bool czyZapisac = true; var zap = new ButtonInteractionArgs(czyZapisac); ButtonClick?.Invoke(this, zap); }
private void label_Click(object sender, EventArgs e) { if (ButtonClick != null) { ButtonClick.Invoke(this, e); } }
private void ActionExecuting(object sender, RoutedEventArgs e) { if (ButtonClick != null) { ButtonClick.Invoke(this, new RoutedEventArgs()); } }
protected override void OnClick(EventArgs e) { if (CarretState == CellDisplayState.Default) { ButtonClick?.Invoke(this, e); } }
private void Initialize(Context context, IAttributeSet attrs, int?defStyleAttr, int?defStyleRes) { LayoutInflater.From(context).Inflate(Resource.Layout.Widget_DataRow, this, true); _iconView = FindViewById <ImageView>(Resource.Id.DataRow_Icon); _buttonView = FindViewById <LinearLayout>(Resource.Id.DataRow_Button); _buttonIconView = FindViewById <ImageView>(Resource.Id.DataRow_ButtonIcon); _textOneView = FindViewById <TextView>(Resource.Id.DataRow_TextOne); _textTwoView = FindViewById <TextView>(Resource.Id.DataRow_TextTwo); var typedVal = new TypedValue(); context.Theme.ResolveAttribute(Resource.Attribute.Background_Text, typedVal, true); var defaultTextColor = typedVal.ResourceId; context.Theme.ResolveAttribute(Resource.Attribute.Primary_Dark, typedVal, true); var defaultButtonColor = typedVal.ResourceId; var attributes = context.Theme.ObtainStyledAttributes(attrs, Resource.Styleable.DataRow, defStyleAttr ?? 0, defStyleRes ?? 0); int icon; int buttonIcon; string textOne; string textTwo; int textOneColor; int textTwoColor; int buttonColor; try { icon = attributes.GetResourceId(Resource.Styleable.DataRow_Icon, Resource.Drawable.svg_star); buttonIcon = attributes.GetResourceId(Resource.Styleable.DataRow_ButtonIcon, Resource.Drawable.svg_star); textOne = attributes.GetString(Resource.Styleable.DataRow_TextOne) ?? ""; textTwo = attributes.GetString(Resource.Styleable.DataRow_TextTwo) ?? ""; textOneColor = attributes.GetResourceId(Resource.Styleable.DataRow_TextOneColor, defaultTextColor); textTwoColor = attributes.GetResourceId(Resource.Styleable.DataRow_TextTwoColor, defaultTextColor); buttonColor = attributes.GetResourceId(Resource.Styleable.DataRow_ButtonColor, defaultButtonColor); ButtonClickable = attributes.GetBoolean(Resource.Styleable.DataRow_ButtonClickable, false); ButtonVisible = attributes.GetBoolean(Resource.Styleable.DataRow_ButtonVisible, false); } finally { attributes.Recycle(); } SetIcon(icon); SetButtonIcon(buttonIcon); TextOne = textOne; TextTwo = textTwo; TextOneColor = ContextCompat.GetColor(context, textOneColor); TextTwoColor = ContextCompat.GetColor(context, textTwoColor); SetButtonColor(ContextCompat.GetColor(context, buttonColor)); _buttonView.Click += (sender, args) => ButtonClick?.Invoke(sender, args); }
public char ButtonElement => sign; //property to get the character of the current row private void Button_Click(object sender, EventArgs eventArgs) { Button letterButton = (sender as Button); sign = Convert.ToChar(letterButton.Text); ButtonClick?.Invoke(this, EventArgs.Empty); letterButton.BackColor = Color; }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); var actionButton = GetTemplateChild("ActionButton") as Button; if (actionButton != null) { actionButton.Click += (sender, e) => ButtonClick?.Invoke(sender, e); } }
/// <summary> /// Создает новый экземпляр класса QRButton /// </summary> public QRButton() { InitializeComponent(); Click += (s, e) => ButtonClick?.Invoke(this, e); foreach (Control ctrl in Controls) { ctrl.Click += (s, e) => ButtonClick?.Invoke(this, e); } }
void ctl_ButtonClick() { if (IsInEditMode) { if (ButtonClick != null) { ButtonClick.Invoke(this, EventArgs.Empty); } } }
private void button2_Click(object sender, EventArgs e) { label1.Hide(); comboBox1.Hide(); int czyWczytac = 1; var wcz = new ButtonInteractionArgs(czyWczytac); ButtonClick?.Invoke(this, wcz); czyWybrano = true; zapiszToolStripMenuItem.Visible = true; nowaGraToolStripMenuItem.Visible = true; }
public void OnMouseUp(int x, int y, MouseButtons button) { if (_buttonPress.IsTracked) { int id = HitTest(x, y); if (id == _buttonPress.Index) { ButtonClick?.Invoke(this, new ViewButtonClickEventArgs(_buttonPress.Item.Type)); } _buttonPress.Drop(); } }
protected override void OnPointerClick(FPoint relPositionPoint, InputState istate) { if (!IsEnabled) { return; } ToggleState = !ToggleState; ButtonClick?.Invoke(this, new HUDToggleButtonEventArgs(ToggleState)); HUD.Screen.Game.Sound.TryPlayButtonClickEffect(); //TODO evtl other sound? }
private void MessageInputTxt_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (Keyboard.Modifiers.HasFlag(ModifierKeys.Shift)) { messageInputTxt.Text += "\r\n"; messageInputTxt.SelectionStart = messageInputTxt.Text.Length; } else { ButtonClick.Invoke(this, e); } } }
private void Done_OnClick(object sender, RoutedEventArgs e) { var topic = Topic.Text; if (string.IsNullOrWhiteSpace(topic)) { return; } if (!ButtonClick?.Invoke(Topic.Text) ?? true) { return; } AddButton.Visibility = Visibility.Visible; Topic.Text = ""; }
/// <summary> /// Uživatel zmáčkl button nebo jeho HotKey /// </summary> /// <param name="buttonItem"></param> private void RunButtonClick(IMenuItem buttonItem) { ClickedButton = buttonItem; if (buttonItem.Tag is DialogResult dialogResult) { this.DialogResult = dialogResult; } OnButtonClick(buttonItem); ButtonClick?.Invoke(this, new TEventArgs <IMenuItem>(buttonItem)); if (CloseOnClickButton) { this.Close(); } }
private void CreateMenuButton() { _menuButton = new FloatingActionButton(Context) { BackgroundTintList = ColorStateList.ValueOf(BackgroundColor), Elevation = ButtonElevation, LongClickable = OpenOnHold, }; _menuButton.SetImageDrawable(Icon); _menuButton.Click += (s, e) => { if (IsOpened) { CloseMenu(); } else { ButtonClick?.Invoke(s, e); if (!OpenOnHold) { OpenMenu(); } } }; if (OpenOnHold) { _menuButton.LongClick += (s, e) => { if (IsOpened) { CloseMenu(); } else { OpenMenu(); } }; } else { _menuButton.LongClick += (s, e) => ButtonLongClick?.Invoke(s, e); } }
private void CreteButton() { if (!_buttonCreated) { _buttonCreated = true; _button = new Button(); _button.TabStop = false; _button.Cursor = Cursors.Default; _button.Click += (s, e) => { if (Enabled) { ButtonClick?.Invoke(this, e); } }; Controls.Add(_button); } }
private void RootGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { RootGrid.Background = MouseEnterBackBrush; //之前没有点击,则设置为已经点击 if (!IsActive) { SetNumberMessage(0); IsActive = true; //隐藏活跃标志 ActiveTagRect.Visibility = Visibility.Visible; //如果有代理事件,则执行代理 if (ButtonClick != null) { ButtonClick.Invoke(this, ButtonID); } } }
/// <summary> /// 虚拟点击,会将按钮的背景直接设置为正常背景 /// </summary> public void Active_Virtual_Click() { RootGrid.Background = NormalBackBrush; //之前没有点击,则设置为已经点击 if (!IsActive) { SetNumberMessage(0); IsActive = true; //隐藏活跃标志 ActiveTagRect.Visibility = Visibility.Visible; //如果有代理事件,则执行代理 if (ButtonClick != null) { ButtonClick.Invoke(this, ButtonID); } } }
public ComboTextInput(string label, string button = null) { ColumnCount = 1; var lbl = new Label { Text = label ?? "", Dock = DockStyle.Left, AutoSize = true }; var btn = new Button { Text = button ?? "", Dock = DockStyle.Right }; btn.Click += (sender, args) => ButtonClick?.Invoke(Text); editor = new TextBox { Dock = DockStyle.Fill, AutoSize = true }; RowStyles.Add(new RowStyle { SizeType = SizeType.AutoSize }); if (label != null) { ColumnStyles.Add(new ColumnStyle { SizeType = SizeType.AutoSize }); ColumnCount++; Controls.Add(lbl, 0, 0); } ColumnStyles.Add(new ColumnStyle { SizeType = SizeType.Percent, Width = 1f }); Controls.Add(editor, 1, 0); if (button != null) { ColumnStyles.Add(new ColumnStyle { SizeType = SizeType.AutoSize }); ColumnCount++; Controls.Add(btn, 2, 0); btn.Width = editor.Width; } AutoSize = true; }
private void Button_Click(object sender, CustomEventArgs e) { Button button = sender as Button; // Get type of object from DataGridView DataSource that we need to create currentTypeOfObject = ListBindingHelper.GetListItemType(dataGridView.DataSource).ToString(); if (button.Tag.ToString().Equals("AddNew")) { isAddNewMode = true; ToggleAddNewMode(isAddNewMode); return; } else if (button.Tag.ToString().Equals("Create")) { selectedObject = Activator.CreateInstance(Type.GetType(currentTypeOfObject), GetAllParametersFromInputControls()); } else if (button.Tag.ToString().Equals("Update")) { // Get 'Id' of current selection from DataGridView so we could find object with that 'Id' in records and update it string id = selectedObject.GetType().GetProperty("Id").GetValue(selectedObject).ToString(); // Create list that contains 'Id' of selected object and all the params from input controls List <object> objectParameters = new List <object> { id }; objectParameters.AddRange(GetAllParametersFromInputControls()); try { selectedObject = Activator.CreateInstance(Type.GetType(currentTypeOfObject), objectParameters.ToArray()); } catch { UpdateInputControls(); } } ButtonClick?.Invoke(sender, new CustomEventArgs(selectedObject)); isAddNewMode = false; ToggleAddNewMode(isAddNewMode); }
protected void OnButtonClick(ButtonClickEventArgs e) { ButtonClick?.Invoke(this, e); }
protected virtual bool OnButtonClick(ButtonClickEventArgs e) { ButtonClick?.Invoke(this, e); return(!e.Cancel); }
private void Button_Colour_Click(object sender, EventArgs e) { ButtonClick?.Invoke(sender, e); }
/// <summary> /// the click event /// </summary> /// <param name="sender">the button</param> /// <param name="e">event arguments</param> protected void Button_Click(object sender, EventArgs e) { //bubble the event up to the parent ButtonClick?.Invoke(this, e); }