Пример #1
0
        private void ChangeSelectedFormat()
        {
            if (listViewFormats.SelectedItems.Count < 1)
            {
                return;                  // should never happen
            }
            ListViewItem selectedItem = listViewFormats.SelectedItems[0];
            LiveClipboardFormatHandler formatHandler = selectedItem.Tag as LiveClipboardFormatHandler;

            using (LiveClipboardChangeHandlerForm changeHandlerForm = new LiveClipboardChangeHandlerForm(formatHandler))
            {
                if (changeHandlerForm.ShowDialog(FindForm()) == DialogResult.OK)
                {
                    LiveClipboardFormatHandler newFormatHandler = changeHandlerForm.FormatHandler;
                    if (newFormatHandler != null)
                    {
                        LiveClipboardManager.SetContentSourceForFormat(newFormatHandler.Format, newFormatHandler.ContentSource.Id);
                        UpdateListViewItem(selectedItem, newFormatHandler);
                    }
                }
            }
        }
        private void ChangeSelectedFormat()
        {
            if (listViewFormats.SelectedItems.Count < 1)
                return; // should never happen

            ListViewItem selectedItem = listViewFormats.SelectedItems[0];
            LiveClipboardFormatHandler formatHandler = selectedItem.Tag as LiveClipboardFormatHandler;

            using (LiveClipboardChangeHandlerForm changeHandlerForm = new LiveClipboardChangeHandlerForm(formatHandler))
            {
                if (changeHandlerForm.ShowDialog(FindForm()) == DialogResult.OK)
                {
                    LiveClipboardFormatHandler newFormatHandler = changeHandlerForm.FormatHandler;
                    if (newFormatHandler != null)
                    {
                        LiveClipboardManager.SetContentSourceForFormat(newFormatHandler.Format, newFormatHandler.ContentSource.Id);
                        UpdateListViewItem(selectedItem, newFormatHandler);
                    }
                }
            }
        }