SidebarLibrary.WinControls.OutlookBar.OutlookBar C# (CSharp) Method

OutlookBar() public method

public OutlookBar ( ) : System
return System
		public OutlookBar()
		{
			// Construct band collection
			bands = new OutlookBarBandCollection(this);

			Dock = DockStyle.Left;
			// We are going to do all of the painting so better setup the control
			// to use double buffering
			SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.ResizeRedraw
				|ControlStyles.Opaque|ControlStyles.UserPaint|ControlStyles.DoubleBuffer, true);
			Font = SystemInformation.MenuFont;

			CreateContextMenu();

			// Setup timer
			highlightTimer.Tick += new EventHandler(OnHighlightHeader);
			highlightTimer.Interval = 100;

			// Load drag cursor
			Assembly myAssembly = Assembly.GetAssembly(Type.GetType("SidebarLibrary.WinControls.OutlookBar"));
			Stream cursorStream = null;
			try
			{
				foreach(string resourcename in myAssembly.GetManifestResourceNames())
				{
					if(resourcename.ToLower().EndsWith("dragcursor.cur"))
					{
						cursorStream = myAssembly.GetManifestResourceStream(resourcename);
						break;
					}
				}
				Debug.Assert(cursorStream != null, "Could not load the DragCursor.cur resource.");
				dragCursor = new Cursor(cursorStream);
			}
			finally
			{
				if (cursorStream != null)
					cursorStream.Dispose();
			}
			// don't display it until we need to
			textBox.Visible = false;
			// Hook up notification for the Enter and LostFocus events
			textBox.KeyUp += new KeyEventHandler(TextBoxKeyDown);
			textBox.LostFocus += new EventHandler(TextBoxLostFocus);

		}
		#endregion