public void Setup()
		{
			_hotSpotProvider = new HotSpotProvider();
			_textBox = new ClickableTextBox();
			_textBox.Width = 350;
			_textBox.Text = "Now is the time for ...";
			_spot1 = new HotSpot.HotSpot(_textBox, 7, 3);
			_spot2 = new HotSpot.HotSpot(_textBox, 16, 3);

			_hotSpotProvider.SetEnableHotSpots(_textBox, true);
			_hotSpotProvider.RetrieveHotSpots +=
				delegate(object sender, RetrieveHotSpotsEventArgs e)
					{
						e.AddHotSpot(_spot1);
						e.AddHotSpot(_spot2);
						e.Color = Color.Yellow;
					};
			_originalCursorPosition = Cursor.Position;

			_form = new Form();
			_form.Controls.Add(_textBox);
			_form.Show();
		}
예제 #2
0
		public void SetEnableHotSpots_CalledAfterDisposed_Throws()
		{
			HotSpotProvider hotSpotProvider = new HotSpotProvider();
			hotSpotProvider.Dispose();
			using (TextBox textBox = new TextBox())
			{
				Assert.Throws<ObjectDisposedException>(() =>
hotSpotProvider.SetEnableHotSpots(textBox, false));
			}
		}