示例#1
0
		public override void Initialize (IComponent component)
		{
			base.Initialize (component);

			if (!(component is Control))
				throw new ArgumentException ("Component is not a Control.");

			Control.Text = component.Site.Name;
			_messageRouter = new WndProcRouter ((Control) component, (IMessageReceiver) this);
			Control.WindowTarget = _messageRouter;

			// DT properties
			//
			this.Visible = true;
			this.Enabled = true;
			this.Locked = false;
			this.AllowDrop = false;
			//
			// The control properties
			//
			Control.Enabled = true;
			Control.Visible = true;
			Control.AllowDrop = false;

			this.Control.DragDrop += new DragEventHandler (OnDragDrop);
			this.Control.DragEnter += new DragEventHandler (OnDragEnter);
			this.Control.DragLeave += new EventHandler (OnDragLeave);
			this.Control.DragOver += new DragEventHandler (OnDragOver);

			// XXX: The control already has a handle?
			//
			if (Control.IsHandleCreated)
				OnCreateHandle ();

		}
示例#2
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            if (!(component is Control))
            {
                throw new ArgumentException("Component is not a Control.");
            }

            Control.Text         = component.Site.Name;
            _messageRouter       = new WndProcRouter((Control)component, (IMessageReceiver)this);
            Control.WindowTarget = _messageRouter;

            // DT properties
            //
            this.Visible   = true;
            this.Enabled   = true;
            this.Locked    = false;
            this.AllowDrop = false;
            //
            // The control properties
            //
            Control.Enabled   = true;
            Control.Visible   = true;
            Control.AllowDrop = false;

            this.Control.DragDrop  += new DragEventHandler(OnDragDrop);
            this.Control.DragEnter += new DragEventHandler(OnDragEnter);
            this.Control.DragLeave += new EventHandler(OnDragLeave);
            this.Control.DragOver  += new DragEventHandler(OnDragOver);

            // XXX: The control already has a handle?
            //
            if (Control.IsHandleCreated)
            {
                OnCreateHandle();
            }
        }