Browse Source

working on property pad integration

formsdesignerappdomain
Siegfried Pammer 14 years ago
parent
commit
a9aa050182
  1. 10
      src/AddIns/DisplayBindings/FormsDesigner/FormsDesigner.AddIn/FormsDesignerViewContent.cs
  2. 30
      src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesignerAppDomainHost.cs

10
src/AddIns/DisplayBindings/FormsDesigner/FormsDesigner.AddIn/FormsDesignerViewContent.cs

@ -379,11 +379,6 @@ namespace ICSharpCode.FormsDesigner
undoEngine = (IFormsDesignerUndoEngine)appDomainHost.GetService(typeof(IFormsDesignerUndoEngine)); undoEngine = (IFormsDesignerUndoEngine)appDomainHost.GetService(typeof(IFormsDesignerUndoEngine));
// appDomainHost.ComponentAdded += new ComponentEventHandlerProxy(ComponentListChanged);
// appDomainHost.ComponentRemoved += new ComponentEventHandlerProxy(ComponentListChanged);
// appDomainHost.ComponentRename += new ComponentRenameEventHandlerProxy(ComponentListChanged);
// appDomainHost.HostTransactionClosed += new DesignerTransactionCloseEventHandlerProxy(TransactionClose);
appDomainHost.SelectionChanged += new EventHandlerProxy(SelectionChangedHandler); appDomainHost.SelectionChanged += new EventHandlerProxy(SelectionChangedHandler);
if (IsTabOrderMode) { // fixes SD2-1015 if (IsTabOrderMode) { // fixes SD2-1015
@ -432,6 +427,7 @@ namespace ICSharpCode.FormsDesigner
options.EnableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true); options.EnableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true);
options.ObjectBoundSmartTagAutoShow = GeneralOptionsPanel.SmartTagAutoShow; options.ObjectBoundSmartTagAutoShow = GeneralOptionsPanel.SmartTagAutoShow;
options.UseOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true); options.UseOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true);
options.EventHandlerNameFormat = "{0}{1}";
return options; return options;
} }
@ -473,10 +469,6 @@ namespace ICSharpCode.FormsDesigner
appDomainHost.DesignSurfaceFlushed -= new EventHandlerProxy(DesignerFlushed); appDomainHost.DesignSurfaceFlushed -= new EventHandlerProxy(DesignerFlushed);
appDomainHost.DesignSurfaceUnloading -= new EventHandlerProxy(DesignerUnloading); appDomainHost.DesignSurfaceUnloading -= new EventHandlerProxy(DesignerUnloading);
// appDomainHost.ComponentAdded -= new ComponentEventHandlerProxy(ComponentListChanged);
// appDomainHost.ComponentRemoved -= new ComponentEventHandlerProxy(ComponentListChanged);
// appDomainHost.ComponentRename -= new ComponentRenameEventHandlerProxy(ComponentListChanged);
appDomainHost.SelectionChanged -= new EventHandlerProxy(SelectionChangedHandler); appDomainHost.SelectionChanged -= new EventHandlerProxy(SelectionChangedHandler);
appDomainHost.DesignSurfaceUnloaded += new EventHandlerProxy( appDomainHost.DesignSurfaceUnloaded += new EventHandlerProxy(

30
src/AddIns/DisplayBindings/FormsDesigner/Project/FormsDesignerAppDomainHost.cs

@ -394,9 +394,11 @@ namespace ICSharpCode.FormsDesigner
designSurface.Dispose(); designSurface.Dispose();
} }
PropertyGrid grid;
public PropertyGrid CreatePropertyGrid() public PropertyGrid CreatePropertyGrid()
{ {
var grid = new PropertyGrid() { Dock = DockStyle.Fill }; grid = new PropertyGrid() { Dock = DockStyle.Fill };
return grid; return grid;
} }
@ -404,20 +406,30 @@ namespace ICSharpCode.FormsDesigner
public void UpdatePropertyPad() public void UpdatePropertyPad()
{ {
if (HasDesignerHost) { if (HasDesignerHost) {
// propertyContainer.Host = appDomainHost.Host; UpdateDesignerHost(); // TODO reuse code from PropertyPad!
// propertyContainer.SelectableObjects = appDomainHost.Host.Container.Components; // propertyContainer.SelectableObjects = appDomainHost.Host.Container.Components;
// ISelectionService selectionService = (ISelectionService)appDomainHost.GetService(typeof(ISelectionService)); ISelectionService selectionService = (ISelectionService)GetService(typeof(ISelectionService));
// if (selectionService != null) { if (selectionService != null) {
// UpdatePropertyPadSelection(selectionService); UpdatePropertyPadSelection(selectionService);
// } }
} }
} }
void UpdateDesignerHost()
{
// if (grid. == Host)
// return;
// if (instance.host != null)
// instance.RemoveHost(instance.host);
// if (container.Host != null)
// instance.SetDesignerHost(container.Host);
}
public void UpdatePropertyPadSelection(ISelectionService selectionService) public void UpdatePropertyPadSelection(ISelectionService selectionService)
{ {
// ICollection selection = selectionService.GetSelectedComponents(); var selection = selectionService.GetSelectedComponents();
// object[] selArray = new object[selection.Count]; object[] selArray = new object[selection.Count];
// selection.CopyTo(selArray, 0); selection.CopyTo(selArray, 0);
// propertyContainer.SelectedObjects = selArray; // propertyContainer.SelectedObjects = selArray;
properties.FormsDesignerProxy.InvalidateRequerySuggested(); properties.FormsDesignerProxy.InvalidateRequerySuggested();
} }

Loading…
Cancel
Save