示例#1
0
 public void SetEnableHotSpots(Control c, bool value)
 {
     if (c == null)
     {
         throw new ArgumentNullException();
     }
     if (!CanExtend(c))
     {
         throw new ArgumentException("Control must be derived from TextBoxBase");
     }
     if (!value)
     {
         HotSpotPainter hotSpotPainter;
         if (_extendees.TryGetValue(c, out hotSpotPainter))
         {
             _extendees.Remove(c);
             hotSpotPainter.Dispose();
         }
     }
     else if (!_extendees.ContainsKey(c))
     {
         _extendees[c] = new HotSpotPainter(this, (TextBoxBase)c);
     }
 }
示例#2
0
		public void SetEnableHotSpots(Control c, bool value)
		{
			if (c == null)
			{
				throw new ArgumentNullException();
			}
			if (!CanExtend(c))
			{
				throw new ArgumentException("Control must be derived from TextBoxBase");
			}
			if (!value)
			{
				HotSpotPainter hotSpotPainter;
				if (_extendees.TryGetValue(c, out hotSpotPainter))
				{
					_extendees.Remove(c);
					hotSpotPainter.Dispose();
				}
			}
			else if (!_extendees.ContainsKey(c))
			{
				_extendees[c] = new HotSpotPainter(this, (TextBoxBase) c);
			}
		}