private void ClipboardNotification_ClipboardUpdate(object sender, EventArgs e) { if (e is ClipboardEventArgs) { ClipboardQueue.GetInstance().Add((e as ClipboardEventArgs).Text); } }
public static ClipboardQueue GetInstance() { if (instance == null) { instance = new ClipboardQueue(); } return(instance); }
private void ContextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = false; notifyIcon.ContextMenuStrip.Items.Clear(); foreach (var item in ClipboardQueue.GetInstance().History) { notifyIcon.ContextMenuStrip.Items.Add(item); } notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); notifyIcon.ContextMenuStrip.Items.Add("Exit"); }