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 @@ -379,11 +379,6 @@ namespace ICSharpCode.FormsDesigner
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);
if (IsTabOrderMode) { // fixes SD2-1015
@ -432,6 +427,7 @@ namespace ICSharpCode.FormsDesigner @@ -432,6 +427,7 @@ namespace ICSharpCode.FormsDesigner
options.EnableInSituEditing = PropertyService.Get("FormsDesigner.DesignerOptions.EnableInSituEditing", true);
options.ObjectBoundSmartTagAutoShow = GeneralOptionsPanel.SmartTagAutoShow;
options.UseOptimizedCodeGeneration = PropertyService.Get("FormsDesigner.DesignerOptions.UseOptimizedCodeGeneration", true);
options.EventHandlerNameFormat = "{0}{1}";
return options;
}
@ -473,10 +469,6 @@ namespace ICSharpCode.FormsDesigner @@ -473,10 +469,6 @@ namespace ICSharpCode.FormsDesigner
appDomainHost.DesignSurfaceFlushed -= new EventHandlerProxy(DesignerFlushed);
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.DesignSurfaceUnloaded += new EventHandlerProxy(

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

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

Loading…
Cancel
Save