2009-09-10 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Thu, 10 Sep 2009 13:35:22 +0000 (13:35 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Thu, 10 Sep 2009 13:35:22 +0000 (13:35 -0000)
* DesignSurface.cs: Provide the default implementation of the
ISelectionService in the DesignSurface service container.
* DocumentDesigner.cs: If there is already a ISelectionService registered
in the ServiceContainer but it's not an IUISelectionService (WinForms
specific) then replace it with one.
[Fixes bug #538037]

svn path=/trunk/mcs/; revision=141677

mcs/class/System.Design/System.ComponentModel.Design/ChangeLog
mcs/class/System.Design/System.ComponentModel.Design/DesignSurface.cs
mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog
mcs/class/System.Design/System.Windows.Forms.Design/DocumentDesigner.cs

index 167fea86ce42fdeaa27559fd940816b7a118b413..f608e4f8611b2d4c785b4cd3e2891e12acb6d52d 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-10  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * DesignSurface.cs: Provide the default implementation of the 
+       ISelectionService in the DesignSurface service container.
+       [Fixes bug #538037]
+
 2009-09-07  Ivan N. Zlatev  <contact@i-nz.net>
 
        * DesignSurface.cs: Don't be so strict and allow for the users 
index 1e7c9abce5df2099f2ed4557a3f18ddae9a7b8c0..d2ba8bde3baf8f3c5e38e18123d4c12b751c86a5 100644 (file)
@@ -144,6 +144,9 @@ namespace System.ComponentModel.Design
                        _serviceContainer.AddService (typeof (IExtenderProviderService), (IExtenderProviderService) extenderService);
                        _serviceContainer.AddService (typeof (IExtenderListService), (IExtenderListService) extenderService);
                        _serviceContainer.AddService (typeof (DesignSurface), this);
+
+                       SelectionService selectionService = new SelectionService (_serviceContainer);
+                       _serviceContainer.AddService (typeof (ISelectionService), (ISelectionService) selectionService);
                }
                
                protected ServiceContainer ServiceContainer {
index 4705e703beec2a0a77c6097cd910974d64f545cc..2e4c47e2877a1d1e2ede89536f67a29d109bb51d 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-10  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * DocumentDesigner.cs: If there is already a ISelectionService registered 
+       in the ServiceContainer but it's not an IUISelectionService (WinForms 
+       specific) then replace it with one.
+       [Fixes bug #538037]
+
 2009-09-09  Ivan N. Zlatev  <contact@i-nz.net>
 
        * ParentControlDesigner.cs, ControlDesigner.cs, UISelectionService.cs, 
index f6b5025233d65b88458bddf76c9ec7760b161abe..8df62b001cc87443e1765b20608e57c0ae09357b 100644 (file)
@@ -289,11 +289,15 @@ namespace System.Windows.Forms.Design
 
                private void InitializeSelectionService ()
                {
+                       ISelectionService selection = this.GetService (typeof (ISelectionService)) as ISelectionService;
+                       if (selection != null && selection is IUISelectionService)
+                               return;
+
                        IServiceContainer serviceContainer = this.GetService (typeof (IServiceContainer)) as IServiceContainer;
-                       if (serviceContainer.GetService (typeof (ISelectionService)) != null)
+                       if (selection != null)
                                serviceContainer.RemoveService (typeof (ISelectionService));
 
-                       UISelectionService selection = new UISelectionService (serviceContainer);
+                       selection = new UISelectionService (serviceContainer);
                        serviceContainer.AddService (typeof (ISelectionService), (ISelectionService) selection);
                        serviceContainer.AddService (typeof (IUISelectionService), (IUISelectionService) selection);