Permalink
Browse files

2008-06-18 Ivan N. Zlatev <contact@i-nz.net>

	* UI/PropertyGrid.cs: Handle removing of the root component.


svn path=/trunk/mwf-designer/; revision=106160
  • Loading branch information...
1 parent fe07bfa commit 0bdf5c0cbe5673c903a04803621318172a6885c1 @ivanz ivanz committed Jun 18, 2008
Showing with 22 additions and 15 deletions.
  1. +4 −0 ChangeLog
  2. +2 −1 src/UI/ErrorListTabPage.cs
  3. +16 −14 src/UI/PropertyGrid.cs
View
@@ -1,3 +1,7 @@
+2008-06-18 Ivan N. Zlatev <contact@i-nz.net>
+
+ * UI/PropertyGrid.cs: Handle removing of the root component.
+
2008-03-11 Ivan N. Zlatev <contact@i-nz.net>
* DesignTime/CodeProviderDesignerLoader.cs: Guard against a NRE in
@@ -120,7 +120,8 @@ IWin32Window IUIService.GetDialogOwnerWindow ()
bool IUIService.CanShowComponentEditor (object component)
{
- throw new NotImplementedException ();
+ return false; // TODO
+ // throw new NotImplementedException ();
}
bool IUIService.ShowComponentEditor (object component, IWin32Window parent)
View
@@ -75,7 +75,6 @@ public void Update (IServiceProvider serviceProvider)
UpdatePropertyGrid (serviceProvider);
PopulateComponentsList (serviceProvider);
EnableComponentsChangeNotification (serviceProvider);
- // ShowEventsTab (); // MWF's PropertyGrid doesn't support EventsTab
}
_serviceProvider = serviceProvider;
}
@@ -94,6 +93,7 @@ private void UpdatePropertyGrid (IServiceProvider serviceProvider)
object[] selection = new object[selectionCollection.Count];
selectionCollection.CopyTo (selection, 0);
_propertyGrid.SelectedObjects = selection;
+ ShowEventsTab ();
}
}
@@ -122,14 +122,17 @@ private void PopulateComponentsList (IServiceProvider serviceProvider)
}
// MWF's PropertyGrid doesn't support EventsTab
- //
- // private void ShowEventsTab ()
- // {
- // _propertyGrid.PropertyTabs.AddTabType (typeof (System.Windows.Forms.Design.EventsTab));
- // _propertyGrid.Site = PrimarySelection.Site;
- // _propertyGrid.GetType ().InvokeMember ("ShowEventsButton", BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.NonPublic,
- // null, _propertyGrid, new object [] { true });
- // }
+ //
+ private void ShowEventsTab ()
+ {
+ IComponent component = _propertyGrid.SelectedObject as IComponent;
+ if (component != null) {
+ _propertyGrid.Site = component.Site;
+ _propertyGrid.PropertyTabs.AddTabType (typeof (System.Windows.Forms.Design.EventsTab));
+ _propertyGrid.GetType ().InvokeMember ("ShowEventsButton", BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.NonPublic,
+ null, _propertyGrid, new object [] { true });
+ }
+ }
private void OnPrimarySelectionChanged (object sender, EventArgs args)
{
@@ -138,14 +141,13 @@ private void OnPrimarySelectionChanged (object sender, EventArgs args)
if (container == null || selectionService == null)
return;
+ _updating = true;
IComponent primarySelection = selectionService.PrimarySelection as IComponent;
if (primarySelection != null && primarySelection.Site != null &&
- primarySelection.Site.Name != null) {
- _updating = true;
+ primarySelection.Site.Name != null)
_componentsCombo.SelectedItem = primarySelection.Site.Name;
- UpdatePropertyGrid (_serviceProvider);
- _updating = false;
- }
+ UpdatePropertyGrid (_serviceProvider);
+ _updating = false;
}
private void EnableComponentsChangeNotification (IServiceProvider provider)

0 comments on commit 0bdf5c0

Please sign in to comment.