Click here to Skip to main content
15,891,788 members
Articles / Programming Languages / Forth.NET

DocMounter 2: A tool to build VS.NET documentation (now with Sandcastle)

,
Rate me:
Please Sign up or sign in to vote.
4.94/5 (29 votes)
15 Nov 2010GPL314 min read 139.2K   1.4K   99  
Tool for creating MS Visual Studio documentation files - XML Summaries, HxS/MSHC help solutions and manuals.
using System;
using System.Windows.Forms;

namespace TenTec.Utils
{
	/// <summary>
	/// This class is used to edit member fields. It supports 
	/// additional hot keys and other operations.
	/// </summary>
	internal class MemberFieldListBox: ListBox
	{
		/// <summary>
		/// Creates a new instance of the MemberFieldListBox class
		/// </summary>
		public MemberFieldListBox(){}

		/// <summary>
		/// Processes the hot keys.
		/// </summary>
		protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
		{
			if(keyData == (Keys.A | Keys.Control) && SelectionMode == SelectionMode.MultiExtended || SelectionMode == SelectionMode.MultiSimple)
			{
				SelectAll();
				return true;
			}
			if(keyData == (Keys.C | Keys.Control) || keyData == (Keys.Insert | Keys.Control))
			{
				OnCopyToClipboard(EventArgs.Empty);
				return true;
			}
			if(keyData == (Keys.V | Keys.Control) || keyData == (Keys.Insert | Keys.Shift))
			{
				OnPasteFromClipboard(EventArgs.Empty);
				return true;
			}
			return base.ProcessCmdKey (ref msg, keyData);
		}

		/// <summary>
		/// Copies the selected items to the clipboard.
		/// </summary>
		private void OnCopyToClipboard(EventArgs e)
		{
			if(CopyToClipboard != null)
				CopyToClipboard(this, e);
		}

		/// <summary>
		/// Pastes items from the clipboard.
		/// </summary>
		private void OnPasteFromClipboard(EventArgs e)
		{
			if(PasteFromClipboard != null)
				PasteFromClipboard(this, e);
		}

		/// <summary>
		/// Selects all the items.
		/// </summary>
		private void SelectAll()
		{
			for(int myIndex = 0; myIndex < Items.Count; myIndex++)
				SetSelected(myIndex, true);
		}

		/// <summary>
		/// This event is raised when the user presses the Ctrl+C keys.
		/// </summary>
		public event EventHandler CopyToClipboard;

		/// <summary>
		/// This event is raised when the user presses the Ctrl+V keys.
		/// </summary>
		public event EventHandler PasteFromClipboard;
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior)
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Written By
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Organisation

2 members

Comments and Discussions