Exemplo n.º 1
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            // FIXME: Remove this code because it will end up in FormDocumentDesigner
            if (component is Form)
            {
                ((Form)component).TopLevel = false;
                // XXX: File a MWF bug: setting toplevel to false also sets visible to false
                ((Form)component).Visible = true;
            }

            _designerViewFrame = new DesignerViewFrame(this.Control, new ComponentTray(this, component.Site));
            _designerViewFrame.DesignedControl.Location = new Point(15, 15);
            SetValue(this.Component, "Location", new Point(0, 0));

            IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService;

            if (componentChangeSvc != null)
            {
                componentChangeSvc.ComponentAdded   += new ComponentEventHandler(OnComponentAdded);
                componentChangeSvc.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved);
            }

            ISelectionService selectionSvc = GetService(typeof(ISelectionService)) as ISelectionService;

            if (selectionSvc != null)               // set itself to primary selection
            {
                selectionSvc.SetSelectedComponents(new IComponent[] { this.Component });
            }
        }
Exemplo n.º 2
0
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            _designerViewFrame = new DesignerViewFrame(this.Control, new ComponentTray(this, component.Site));
            _designerViewFrame.DesignedControl.Location = new Point(15, 15);
            SetValue(this.Component, "Location", new Point(0, 0));

            IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService;

            if (componentChangeSvc != null)
            {
                componentChangeSvc.ComponentAdded   += new ComponentEventHandler(OnComponentAdded);
                componentChangeSvc.ComponentRemoved += new ComponentEventHandler(OnComponentRemoved);
            }

            IMenuCommandService menuCommands     = GetService(typeof(IMenuCommandService)) as IMenuCommandService;
            IServiceContainer   serviceContainer = this.GetService(typeof(IServiceContainer)) as IServiceContainer;

            if (menuCommands != null && serviceContainer != null)
            {
                new DefaultMenuCommands(serviceContainer).AddTo(menuCommands);
            }
            InitializeSelectionService();
        }
Exemplo n.º 3
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_designerViewFrame != null)
         {
             _designerViewFrame.Dispose();
             _designerViewFrame = null;
         }
         IComponentChangeService componentChangeSvc = GetService(typeof(IComponentChangeService)) as IComponentChangeService;
         if (componentChangeSvc != null)
         {
             componentChangeSvc.ComponentAdded   -= new ComponentEventHandler(OnComponentAdded);
             componentChangeSvc.ComponentRemoved -= new ComponentEventHandler(OnComponentRemoved);
         }
     }
     base.Dispose(disposing);
 }
Exemplo n.º 4
0
		protected override void Dispose (bool disposing)
		{
			if (disposing) {
				if (_designerViewFrame != null) {
					_designerViewFrame.Dispose ();
					_designerViewFrame = null;
					
				}
				IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService;
				if (componentChangeSvc != null) {
					componentChangeSvc.ComponentAdded -= new ComponentEventHandler (OnComponentAdded);
					componentChangeSvc.ComponentRemoved -= new ComponentEventHandler (OnComponentRemoved);
				}
			}
			base.Dispose (disposing);
		}
Exemplo n.º 5
0
		public override void Initialize (IComponent component)
		{
			base.Initialize (component);

			_designerViewFrame = new DesignerViewFrame (this.Control, new ComponentTray (this, component.Site));
			_designerViewFrame.DesignedControl.Location = new Point (15, 15);
			SetValue (this.Component,  "Location", new Point (0, 0));

			IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService;
			if (componentChangeSvc != null) {
				componentChangeSvc.ComponentAdded += new ComponentEventHandler (OnComponentAdded);
				componentChangeSvc.ComponentRemoved += new ComponentEventHandler (OnComponentRemoved);
			}

			IMenuCommandService menuCommands = GetService (typeof (IMenuCommandService)) as IMenuCommandService;
			IServiceContainer serviceContainer = this.GetService (typeof (IServiceContainer)) as IServiceContainer;
			if (menuCommands != null && serviceContainer != null)
				new DefaultMenuCommands (serviceContainer).AddTo (menuCommands);
			InitializeSelectionService ();
		}
Exemplo n.º 6
0
		public override void Initialize (IComponent component)
		{
			base.Initialize (component);

			// FIXME: Remove this code because it will end up in FormDocumentDesigner
			if (component is Form) {
				((Form)component).TopLevel = false;
				// XXX: File a MWF bug: setting toplevel to false also sets visible to false
				((Form)component).Visible = true;
			}

			_designerViewFrame = new DesignerViewFrame (this.Control, new ComponentTray (this, component.Site));
			_designerViewFrame.DesignedControl.Location = new Point (15, 15);
			SetValue (this.Component,  "Location", new Point (0, 0));

			IComponentChangeService componentChangeSvc = GetService (typeof (IComponentChangeService)) as IComponentChangeService;
			if (componentChangeSvc != null) {
				componentChangeSvc.ComponentAdded += new ComponentEventHandler (OnComponentAdded);
				componentChangeSvc.ComponentRemoved += new ComponentEventHandler (OnComponentRemoved);
			}

			ISelectionService selectionSvc = GetService (typeof (ISelectionService)) as ISelectionService;
			if (selectionSvc != null) { // set itself to primary selection
				selectionSvc.SetSelectedComponents (new IComponent[] { this.Component });
			}
		}