/// <summary> /// Sets <c><see cref="_current"/></c> when a <c>RadioButton</c> fires /// <c>CheckedChanged</c>. /// </summary> /// <param name="sender"> /// <list type="bullet"> /// <item><c><see cref="rb_Clipboard"/></c></item> /// <item><c><see cref="rb_RowsBuffer"/></c></item> /// <item><c><see cref="rb_ColBuffer"/></c></item> /// <item><c><see cref="rb_CellsBuffer"/></c></item> /// </list></param> /// <param name="e"></param> void checkedchanged(object sender, EventArgs e) { if ((sender as RadioButton).Checked) { if (sender == rb_Clipboard) { _current = Current.Clipboard; rtb_Clip.Text = ClipboardService.GetText(); } else if (sender == rb_RowsBuffer) { _current = Current.RowsBuffer; SetRowsBufferText(); } else if (sender == rb_ColBuffer) { _current = Current.ColBuffer; SetColBufferText(); } else // sender == rb_CellsBuffer { _current = Current.CellsBuffer; SetCellsBufferText(); } rtb_Clip.ReadOnly = sender != rb_Clipboard; bu_Get.Enabled = bu_Set.Enabled = sender == rb_Clipboard; } }
/// <summary> /// Gets the current Windows Clipboard text each time this /// <c>ClipboardEditor's</c> <c>Activated</c> event fires iff /// <c><see cref="rb_Clipboard"/></c> is currently checked. /// </summary> /// <param name="e"></param> protected override void OnActivated(EventArgs e) { if (_inited && rb_Clipboard.Checked) { rtb_Clip.Text = ClipboardService.GetText(); } }
/// <summary> /// Handles <c>Click</c> on the Get button. /// </summary> /// <param name="sender"> /// <list type="bullet"> /// <item><c><see cref="bu_Get"/></c></item> /// <item><c><see cref="Yata"/>.it_ClipExport</c></item> /// <item><c>null</c></item> /// </list></param> /// <param name="e"></param> /// <remarks>Invoked by /// <list type="bullet"> /// <item>Get button</item> /// <item><c><see cref="Yata"/>.clipclick_ExportCopy()</c></item> /// <item><c><see cref="Infobox"/>.OnKeyDown()</c></item> /// </list></remarks> internal void click_Get(object sender, EventArgs e) { if (rb_Clipboard.Checked) { rtb_Clip.Text = ClipboardService.GetText(); } }
/// <summary> /// Imports the current contents of the Windows clipboard to /// <c><see cref="_copyr"/></c> and enables /// <c><see cref="it_PasteRange"/></c> and /// <c><see cref="it_ClipExport"/></c>. /// </summary> /// <param name="sender"><c><see cref="it_ClipImport"/></c></param> /// <param name="e"></param> void clipclick_ImportCopy(object sender, EventArgs e) { _copyr.Clear(); string clip = ClipboardService.GetText(); if (clip.Length != 0) { string[] lines = clip.Split(new[] { Environment.NewLine }, StringSplitOptions.None); string line; for (int i = 0; i != lines.Length; ++i) { if ((line = lines[i].Trim()).Length != 0) { string[] fields = YataGrid.ParseTableRow(line); _copyr.Add(fields); } } if (_fclip != null) { _fclip.SetRowsBufferText(); } it_PasteRange.Enabled = Table != null && !Table.Readonly; it_ClipExport.Enabled = true; } }