public ColorPresetControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); AccessibleName = Res.Get(StringId.ColorPickerColor); System.Diagnostics.Debug.Assert(colors.Length == 12, "Unexpected number of buttons. If you change the number of buttons, then you'll need to ensure that the navigation code is updated as well."); int i = 0; foreach (ColorButton button in colors) { button.ColorSelected += colorSelected; button.Navigate += new GridNavigateEventHandler(ColorPresetControl_Navigate); button.TabIndex = i; button.Margin = new System.Windows.Forms.Padding(0); tableLayout.Controls.Add(button); tableLayout.SetCellPosition(button, new TableLayoutPanelCellPosition(i % (NUM_ROWS + 1), i / (NUM_COLUMNS))); i++; } foreach (RowStyle style in tableLayout.RowStyles) { style.SizeType = SizeType.Percent; style.Height = 1 / (float)tableLayout.RowCount; } foreach (ColumnStyle style in tableLayout.ColumnStyles) { style.SizeType = SizeType.Percent; style.Width = 1 / (float)tableLayout.ColumnCount; } this.Controls.Add(tableLayout); }
public ColorDefaultColorControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.Text = Res.Get(StringId.ColorPickerDefaultColor); Color = Color.Empty; }
public ColorDefaultColorControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.Text = Res.Get(StringId.ColorPickerDefaultColor); Color = Color.Empty; }
protected virtual void OnNavigate(List <Core.GameStateInformation.Directions> movements) { NavigateEventHandler temp = Navigate; if (temp != null) { temp(movements.ToArray()); } }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// navigateeventhandler.BeginInvoke(sender, ne, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this NavigateEventHandler navigateeventhandler, Object sender, NavigateEventArgs ne, AsyncCallback callback) { if (navigateeventhandler == null) { throw new ArgumentNullException("navigateeventhandler"); } return(navigateeventhandler.BeginInvoke(sender, ne, callback, null)); }
public ColorDialogLauncherControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.Text = Res.Get(StringId.ColorPickerMoreColors); }
public IColorPickerSubControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) { _ColorSelected += colorSelected; _Navigate = navigate; }
public IColorPickerSubControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) { _ColorSelected += colorSelected; _Navigate = navigate; }
public ColorDialogLauncherControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.Text = Res.Get(StringId.ColorPickerMoreColors); }
public ColorPresetControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); AccessibleName = Res.Get(StringId.ColorPickerColor); System.Diagnostics.Debug.Assert(colors.Length == 12, "Unexpected number of buttons. If you change the number of buttons, then you'll need to ensure that the navigation code is updated as well."); int i = 0; foreach (ColorButton button in colors) { button.ColorSelected += colorSelected; button.Navigate += new GridNavigateEventHandler(ColorPresetControl_Navigate); button.TabIndex = i; button.Margin = new System.Windows.Forms.Padding(0); tableLayout.Controls.Add(button); tableLayout.SetCellPosition(button, new TableLayoutPanelCellPosition(i % (NUM_ROWS + 1), i / (NUM_COLUMNS))); i++; } foreach (RowStyle style in tableLayout.RowStyles) { style.SizeType = SizeType.Percent; style.Height = 1 / (float)tableLayout.RowCount; } foreach (ColumnStyle style in tableLayout.ColumnStyles) { style.SizeType = SizeType.Percent; style.Width = 1 / (float)tableLayout.ColumnCount; } this.Controls.Add(tableLayout); }