private void TextLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { int index = (((Label)sender).DataContext as ClimoItem).Index; ClimoItem removedItem = ClimoItems.RemoveItem(index); if (_SAVE_TYPE == "db") { _ClimoContorller.RemoveItem(removedItem.ID); } else { _ClimoContorller.RemoveItem(index); } ReloadClimoCollection(); }
private static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { switch (msg) { case WM_HOTKEY: switch (wParam.ToInt32()) { case HOTKEY_ID_COPY: System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(Clipboard.GetText())); ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_COPY1: System.Threading.Thread.Sleep(500); System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(0, Clipboard.GetText())); ClimoItems.ItemPasteIndex = 0; ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_COPY2: System.Threading.Thread.Sleep(500); System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(1, Clipboard.GetText())); ClimoItems.ItemPasteIndex = 1; ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_COPY3: System.Threading.Thread.Sleep(500); System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(2, Clipboard.GetText())); ClimoItems.ItemPasteIndex = 2; ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_COPY4: System.Threading.Thread.Sleep(500); System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(3, Clipboard.GetText())); ClimoItems.ItemPasteIndex = 3; ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_COPY5: System.Threading.Thread.Sleep(500); System.Windows.Forms.SendKeys.SendWait("^c"); System.Threading.Thread.Sleep(100); if (Clipboard.GetText().Trim() != "") { _ClimoContorller.AddItem(ClimoItems.AddItem(4, Clipboard.GetText())); ClimoItems.ItemPasteIndex = 45; ReloadClimoCollection(); } handled = true; break; case HOTKEY_ID_PASTE: SetClipboardByIndex(ClimoItems.ItemPasteIndex); ClimoItems.IncrementPasteIndex(); System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; case HOTKEY_ID_PASTE1: SetClipboardByIndex(0); ClimoItems.ItemPasteIndex = 1; System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; case HOTKEY_ID_PASTE2: SetClipboardByIndex(1); ClimoItems.ItemPasteIndex = 2; System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; case HOTKEY_ID_PASTE3: SetClipboardByIndex(2); ClimoItems.ItemPasteIndex = 3; System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; case HOTKEY_ID_PASTE4: SetClipboardByIndex(3); ClimoItems.ItemPasteIndex = 4; System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; case HOTKEY_ID_PASTE5: SetClipboardByIndex(4); ClimoItems.ItemPasteIndex = 0; System.Windows.Forms.SendKeys.SendWait("^v"); handled = true; break; } break; } return(IntPtr.Zero); }