Browse Source

Implemented deleting components from the design surface.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2440 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
8f3490bb87
  1. 15
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
  2. 10
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignSurface.cs
  3. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs
  4. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs
  5. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WindowResizeBehavior.cs
  6. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs
  7. 7
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/CreateComponentTool.cs
  8. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs
  9. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/MouseGestureBase.cs
  10. 13
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignContext.cs
  11. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs
  12. 7
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementAlignment.cs
  13. 21
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementOperation.cs
  14. 11
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementType.cs
  15. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/DesignItemDataSource.cs
  16. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/FallbackEditor.cs
  17. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/IPropertyEditorDataSource.cs
  18. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultipleSelectionDataProperty.cs
  19. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultipleSelectionDataSource.cs
  20. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/TextBoxEditor.cs
  21. 4
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj

15
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs

@ -137,7 +137,6 @@ namespace ICSharpCode.WpfDesign.Designer @@ -137,7 +137,6 @@ namespace ICSharpCode.WpfDesign.Designer
DesignContext _context;
readonly EatAllHitTestRequests _eatAllHitTestRequests;
readonly AdornerLayer _adornerLayer;
readonly Canvas _markerCanvas;
public DesignPanel()
{
@ -148,10 +147,12 @@ namespace ICSharpCode.WpfDesign.Designer @@ -148,10 +147,12 @@ namespace ICSharpCode.WpfDesign.Designer
DesignerProperties.SetIsInDesignMode(this, true);
_eatAllHitTestRequests = new EatAllHitTestRequests();
_eatAllHitTestRequests.MouseDown += delegate {
// ensure the design panel has focus while the user is interacting with it
this.Focus();
};
_eatAllHitTestRequests.AllowDrop = true;
_adornerLayer = new AdornerLayer(this);
_markerCanvas = new Canvas();
_markerCanvas.IsHitTestVisible = false;
}
#endregion
@ -201,12 +202,10 @@ namespace ICSharpCode.WpfDesign.Designer @@ -201,12 +202,10 @@ namespace ICSharpCode.WpfDesign.Designer
// remove _adornerLayer and _eatAllHitTestRequests
RemoveVisualChild(_adornerLayer);
RemoveVisualChild(_eatAllHitTestRequests);
RemoveVisualChild(_markerCanvas);
} else if (base.Child == null) {
// Child is being set from null to some value
AddVisualChild(_adornerLayer);
AddVisualChild(_eatAllHitTestRequests);
AddVisualChild(_markerCanvas);
}
base.Child = value;
}
@ -221,8 +220,6 @@ namespace ICSharpCode.WpfDesign.Designer @@ -221,8 +220,6 @@ namespace ICSharpCode.WpfDesign.Designer
return _eatAllHitTestRequests;
else if (index == 2)
return _adornerLayer;
else if (index == 3)
return _markerCanvas;
}
return base.GetVisualChild(index);
}
@ -230,7 +227,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -230,7 +227,7 @@ namespace ICSharpCode.WpfDesign.Designer
protected override int VisualChildrenCount {
get {
if (base.Child != null)
return 4;
return 3;
else
return base.VisualChildrenCount;
}
@ -242,7 +239,6 @@ namespace ICSharpCode.WpfDesign.Designer @@ -242,7 +239,6 @@ namespace ICSharpCode.WpfDesign.Designer
if (this.Child != null) {
_adornerLayer.Measure(constraint);
_eatAllHitTestRequests.Measure(constraint);
_markerCanvas.Measure(constraint);
}
return result;
}
@ -254,7 +250,6 @@ namespace ICSharpCode.WpfDesign.Designer @@ -254,7 +250,6 @@ namespace ICSharpCode.WpfDesign.Designer
Rect r = new Rect(new Point(0, 0), arrangeSize);
_adornerLayer.Arrange(r);
_eatAllHitTestRequests.Arrange(r);
_markerCanvas.Arrange(r);
}
return result;
}

10
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignSurface.cs

@ -86,12 +86,18 @@ namespace ICSharpCode.WpfDesign.Designer @@ -86,12 +86,18 @@ namespace ICSharpCode.WpfDesign.Designer
#region Command: Delete
void OnDeleteExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (_designContext != null) {
ModelTools.DeleteComponents(_designContext.Services.Selection.SelectedItems);
}
}
void OnDeleteCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (_designContext != null) {
e.CanExecute = ModelTools.CanDeleteComponents(_designContext.Services.Selection.SelectedItems);
} else {
e.CanExecute = false;
}
}
#endregion

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/CanvasPlacementSupport.cs

@ -34,7 +34,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -34,7 +34,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <inherits/>
public bool CanPlace(ICollection<DesignItem> child, PlacementType type, PlacementAlignment position)
{
return type == PlacementType.Resize || type == PlacementType.Move || type == PlacementType.Delete;
return type == PlacementType.Resize || type == PlacementType.Move
|| type == PlacementType.Delete
|| type == PlacementType.AddItem;
}
/// <inherits/>
@ -84,8 +86,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -84,8 +86,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
/// <inherits/>
public void BeginPlacement(PlacementOperation op)
{
if (op.Type == PlacementType.Move || op.Type == PlacementType.Resize) {
GrayOutDesignerExceptActiveArea.Start(ref grayOut, this.Services, this.ExtendedItem.View);
}
}
/// <inherits/>
public void EndPlacement(PlacementOperation op)

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs

@ -39,14 +39,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -39,14 +39,14 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
this.Adorners.Add(adornerPanel);
resizeThumbs = new ResizeThumb[] {
CreateThumb(PlacementAlignments.TopLeft, Cursors.SizeNWSE),
CreateThumb(PlacementAlignments.Top, Cursors.SizeNS),
CreateThumb(PlacementAlignments.TopRight, Cursors.SizeNESW),
CreateThumb(PlacementAlignments.Left, Cursors.SizeWE),
CreateThumb(PlacementAlignments.Right, Cursors.SizeWE),
CreateThumb(PlacementAlignments.BottomLeft, Cursors.SizeNESW),
CreateThumb(PlacementAlignments.Bottom, Cursors.SizeNS),
CreateThumb(PlacementAlignments.BottomRight, Cursors.SizeNWSE)
CreateThumb(PlacementAlignment.TopLeft, Cursors.SizeNWSE),
CreateThumb(PlacementAlignment.Top, Cursors.SizeNS),
CreateThumb(PlacementAlignment.TopRight, Cursors.SizeNESW),
CreateThumb(PlacementAlignment.Left, Cursors.SizeWE),
CreateThumb(PlacementAlignment.Right, Cursors.SizeWE),
CreateThumb(PlacementAlignment.BottomLeft, Cursors.SizeNESW),
CreateThumb(PlacementAlignment.Bottom, Cursors.SizeNS),
CreateThumb(PlacementAlignment.BottomRight, Cursors.SizeNWSE)
};
}

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/WindowResizeBehavior.cs

@ -29,9 +29,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -29,9 +29,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public bool CanPlace(ICollection<DesignItem> children, PlacementType type, PlacementAlignment position)
{
return type == PlacementType.Resize &&
(position == PlacementAlignments.Right
|| position == PlacementAlignments.BottomRight
|| position == PlacementAlignments.Bottom);
(position == PlacementAlignment.Right
|| position == PlacementAlignment.BottomRight
|| position == PlacementAlignment.Bottom);
}

27
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
// </file>
using System;
using System.Collections.Generic;
using System.Windows;
namespace ICSharpCode.WpfDesign.Designer
@ -43,6 +44,32 @@ namespace ICSharpCode.WpfDesign.Designer @@ -43,6 +44,32 @@ namespace ICSharpCode.WpfDesign.Designer
return 0;
}
/// <summary>
/// Gets if the specified components can be deleted.
/// </summary>
public static bool CanDeleteComponents(ICollection<DesignItem> items)
{
IPlacementBehavior b = PlacementOperation.GetPlacementBehavior(items);
return b != null
&& b.CanPlace(items, PlacementType.Delete, PlacementAlignment.Center);
}
/// <summary>
/// Deletes the specified components from their parent containers.
/// If the deleted components are currently selected, they are deselected before they are deleted.
/// </summary>
public static void DeleteComponents(ICollection<DesignItem> items)
{
PlacementOperation operation = PlacementOperation.Start(items, PlacementType.Delete);
try {
Func.First(items).Services.Selection.SetSelectedComponents(items, SelectionTypes.Remove);
operation.DeleteItemsAndCommit();
} catch {
operation.Abort();
throw;
}
}
internal static Size GetDefaultSize(DesignItem createdItem)
{
return new Size(GetWidth(createdItem.View), GetHeight(createdItem.View));

7
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/CreateComponentTool.cs

@ -64,7 +64,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -64,7 +64,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services
/// </summary>
protected virtual DesignItem CreateItem(DesignContext context)
{
object newInstance = Activator.CreateInstance(componentType);
object newInstance = context.Services.ExtensionManager.CreateInstanceWithCustomInstanceFactory(componentType, null);
return context.Services.Component.RegisterComponentForDesigner(newInstance);
}
@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services
container,
new DesignItem[] { createdItem },
new Rect[] { new Rect(position, ModelTools.GetDefaultSize(createdItem)) },
PlacementType.Move
PlacementType.AddItem
);
if (operation != null) {
container.Services.Selection.SetSelectedComponents(new DesignItem[] { createdItem });
@ -124,9 +124,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -124,9 +124,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services
if (result.ModelHit != null) {
IPlacementBehavior behavior = result.ModelHit.GetBehavior<IPlacementBehavior>();
if (behavior != null) {
// ensure the design panel has the focus - otherwise pressing Escape to abort creating doesn't work
designPanel.Focus();
DesignItem createdItem = CreateItem(designPanel.Context);
new CreateComponentMouseGesture(result.ModelHit, createdItem).Start(designPanel, e);

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -42,7 +42,7 @@ namespace ICSharpCode.WpfDesign.Designer.Services
protected override void OnDragStarted(MouseEventArgs e)
{
IPlacementBehavior b = PlacementOperation.GetPlacementBehavior(selectedItems);
if (b != null && b.CanPlace(selectedItems, PlacementType.Move, PlacementAlignments.TopLeft)) {
if (b != null && b.CanPlace(selectedItems, PlacementType.Move, PlacementAlignment.TopLeft)) {
List<DesignItem> sortedSelectedItems = new List<DesignItem>(selectedItems);
sortedSelectedItems.Sort(ModelTools.ComparePositionInModelFile);
selectedItems = sortedSelectedItems;

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/MouseGestureBase.cs

@ -45,7 +45,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -45,7 +45,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services
isStarted = true;
this.designPanel = designPanel;
this.services = designPanel.Context.Services;
designPanel.IsAdornerLayerHitTestVisible = false;
if (designPanel.CaptureMouse()) {
RegisterEvents();
OnStarted(e);
@ -104,7 +103,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services @@ -104,7 +103,6 @@ namespace ICSharpCode.WpfDesign.Designer.Services
isStarted = false;
designPanel.ReleaseMouseCapture();
UnRegisterEvents();
designPanel.IsAdornerLayerHitTestVisible = true;
OnStopped();
}

13
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignContext.cs

@ -55,22 +55,11 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -55,22 +55,11 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
propertyGridEditorManager.RegisterAssembly(typeof(XamlDesignContext).Assembly);
XamlParserSettings xamlParseSettings = new XamlParserSettings();
xamlParseSettings.CreateInstanceCallback = OnXamlParserCreateInstance;
xamlParseSettings.CreateInstanceCallback = this.Services.ExtensionManager.CreateInstanceWithCustomInstanceFactory;
_doc = XamlParser.Parse(xamlReader, xamlParseSettings);
_rootItem = _componentService.RegisterXamlComponentRecursive(_doc.RootElement);
}
object OnXamlParserCreateInstance(Type instanceType, object[] arguments)
{
foreach (Type extensionType in this.Services.ExtensionManager.GetExtensionTypes(instanceType)) {
if (typeof(CustomInstanceFactory).IsAssignableFrom(extensionType)) {
CustomInstanceFactory factory = (CustomInstanceFactory)Activator.CreateInstance(extensionType);
return factory.CreateInstance(instanceType, arguments);
}
}
return CustomInstanceFactory.DefaultInstanceFactory.CreateInstance(instanceType, arguments);
}
/// <summary>
/// Saves the XAML DOM into the XML writer.
/// </summary>

27
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs

@ -98,6 +98,8 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -98,6 +98,8 @@ namespace ICSharpCode.WpfDesign.Extensions
/// </summary>
public IEnumerable<Type> GetExtensionTypes(Type extendedItemType)
{
if (extendedItemType == null)
throw new ArgumentNullException("extendedItemType");
foreach (ExtensionEntry entry in GetExtensionEntries(extendedItemType)) {
yield return entry.ExtensionType;
}
@ -194,6 +196,9 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -194,6 +196,9 @@ namespace ICSharpCode.WpfDesign.Extensions
/// </summary>
public ExtensionServer GetExtensionServer(ExtensionServerAttribute attribute)
{
if (attribute == null)
throw new ArgumentNullException("attribute");
Type extensionServerType = attribute.ExtensionServerType;
ExtensionServer server;
@ -209,5 +214,27 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -209,5 +214,27 @@ namespace ICSharpCode.WpfDesign.Extensions
return server;
}
#endregion
#region Special extensions (Instance Factory)
/// <summary>
/// Create an instance of the specified type using the specified arguments.
/// The instance is created using a CustomInstanceFactory registered for the type,
/// or using reflection if no instance factory is found.
/// </summary>
public object CreateInstanceWithCustomInstanceFactory(Type instanceType, object[] arguments)
{
if (instanceType == null)
throw new ArgumentNullException("instanceType");
if (arguments == null)
arguments = new object[0];
foreach (Type extensionType in GetExtensionTypes(instanceType)) {
if (typeof(CustomInstanceFactory).IsAssignableFrom(extensionType)) {
CustomInstanceFactory factory = (CustomInstanceFactory)Activator.CreateInstance(extensionType);
return factory.CreateInstance(instanceType, arguments);
}
}
return CustomInstanceFactory.DefaultInstanceFactory.CreateInstance(instanceType, arguments);
}
#endregion
}
}

7
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementAlignment.cs

@ -81,13 +81,8 @@ namespace ICSharpCode.WpfDesign @@ -81,13 +81,8 @@ namespace ICSharpCode.WpfDesign
return !(lhs.Equals(rhs));
}
#endregion
}
/// <summary>
/// Contains known PlacementAlignment values like an enumeration.
/// </summary>
public static class PlacementAlignments
{
/// <summary>Top left</summary>
public static readonly PlacementAlignment TopLeft = new PlacementAlignment(HorizontalAlignment.Left, VerticalAlignment.Top);
/// <summary>Top center</summary>

21
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementOperation.cs

@ -82,9 +82,14 @@ namespace ICSharpCode.WpfDesign @@ -82,9 +82,14 @@ namespace ICSharpCode.WpfDesign
{
if (newContainer == null)
throw new ArgumentNullException("newContainer");
if (isAborted || isCommitted)
throw new InvalidOperationException("The operation is not running anymore.");
if (currentContainer == newContainer)
return;
if (!currentContainerBehavior.CanLeaveContainer(this))
throw new NotSupportedException("The items cannot be removed from their parent container.");
try {
currentContainerBehavior.LeaveContainer(this);
@ -107,6 +112,22 @@ namespace ICSharpCode.WpfDesign @@ -107,6 +112,22 @@ namespace ICSharpCode.WpfDesign
}
#endregion
#region Delete Items
/// <summary>
/// Deletes the items being placed, and commits the placement operation.
/// </summary>
public void DeleteItemsAndCommit()
{
if (isAborted || isCommitted)
throw new InvalidOperationException("The operation is not running anymore.");
if (!currentContainerBehavior.CanLeaveContainer(this))
throw new NotSupportedException("The items cannot be removed from their parent container.");
currentContainerBehavior.LeaveContainer(this);
Commit();
}
#endregion
#region Start
/// <summary>
/// Starts a new placement operation that changes the placement of <paramref name="placedItem"/>.

11
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementType.cs

@ -15,17 +15,24 @@ namespace ICSharpCode.WpfDesign @@ -15,17 +15,24 @@ namespace ICSharpCode.WpfDesign
public sealed class PlacementType
{
/// <summary>
/// Placement is done by resizing an element.
/// Placement is done by resizing an element in a drag'n'drop operation.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly PlacementType Resize = Register("Resize");
/// <summary>
/// Placement is done by moving an element.
/// Placement is done by moving an element in a drag'n'drop operation.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly PlacementType Move = Register("Move");
/// <summary>
/// Adding an element to a specified position in the container.
/// T
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
public static readonly PlacementType AddItem = Register("AddItem");
/// <summary>
/// Not a "real" placement, but deleting the element.
/// </summary>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/DesignItemDataSource.cs

@ -98,7 +98,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -98,7 +98,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
sources[i++] = GetDataSourceForDesignItem(item);
}
return MultiSelectionDataSource.CreateDataSource(context != null ? context.Services : null, sources);
return MultipleSelectionDataSource.CreateDataSource(context != null ? context.Services : null, sources);
}
/// <summary>

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/FallbackEditor.cs

@ -36,6 +36,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -36,6 +36,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
OnValueChanged(null, null);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
void OnValueChanged(object sender, EventArgs e)
{
if (property.IsSet) {

3
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/IPropertyEditorDataSource.cs

@ -93,7 +93,8 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -93,7 +93,8 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
/// Gets the description of the property. The returned object should be something that
/// can be used as Content for a WPF tooltip.
/// </summary>
object GetDescription();
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
object GetDescription(); // is not a property because it can create a new instance on every call
/// <summary>
/// Gets/Sets if the property has been assigned a local value.

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultiSelectionDataProperty.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultipleSelectionDataProperty.cs

@ -10,12 +10,12 @@ using System.Diagnostics; @@ -10,12 +10,12 @@ using System.Diagnostics;
namespace ICSharpCode.WpfDesign.PropertyEditor
{
sealed class MultiSelectionDataProperty : IPropertyEditorDataProperty
sealed class MultipleSelectionDataProperty : IPropertyEditorDataProperty
{
readonly MultiSelectionDataSource ownerDataSource;
readonly MultipleSelectionDataSource ownerDataSource;
readonly IPropertyEditorDataProperty[] data;
public MultiSelectionDataProperty(MultiSelectionDataSource ownerDataSource, IPropertyEditorDataProperty[] data)
public MultipleSelectionDataProperty(MultipleSelectionDataSource ownerDataSource, IPropertyEditorDataProperty[] data)
{
Debug.Assert(ownerDataSource != null);
Debug.Assert(data != null);

8
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultiSelectionDataSource.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/MultipleSelectionDataSource.cs

@ -13,7 +13,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -13,7 +13,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
/// <summary>
/// Implements IPropertyEditorDataSource by combining the information from multiple data sources.
/// </summary>
public sealed class MultiSelectionDataSource : IPropertyEditorDataSource
public sealed class MultipleSelectionDataSource : IPropertyEditorDataSource
{
/// <summary>
/// Creates a data source for a collection of data sources.
@ -35,7 +35,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -35,7 +35,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
}
throw new InvalidOperationException();
} else {
return new MultiSelectionDataSource(services, sources);
return new MultipleSelectionDataSource(services, sources);
}
}
@ -47,7 +47,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -47,7 +47,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
/// <summary>
/// Creates a new MultiSelectionDataSource instance.
/// </summary>
public MultiSelectionDataSource(ServiceContainer services, ICollection<IPropertyEditorDataSource> sources)
public MultipleSelectionDataSource(ServiceContainer services, ICollection<IPropertyEditorDataSource> sources)
{
this.services = services;
if (sources == null)
@ -73,7 +73,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -73,7 +73,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
}
if (properties != null) {
this.properties.Add(new MultiSelectionDataProperty(this, properties));
this.properties.Add(new MultipleSelectionDataProperty(this, properties));
}
}
}

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyEditor/TextBoxEditor.cs

@ -93,6 +93,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -93,6 +93,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
base.OnTextChanged(e);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
protected override void OnLostFocus(RoutedEventArgs e)
{
if (isDirty) {
@ -113,6 +114,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor @@ -113,6 +114,7 @@ namespace ICSharpCode.WpfDesign.PropertyEditor
base.OnLostFocus(e);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);

4
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj

@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<Compile Include="PlacementOperation.cs" />
<Compile Include="PlacementType.cs" />
<Compile Include="PropertyEditor\BooleanEditor.cs" />
<Compile Include="PropertyEditor\MultiSelectionDataProperty.cs" />
<Compile Include="PropertyEditor\MultipleSelectionDataProperty.cs" />
<Compile Include="PropertyEditor\StandardValuesComboBoxEditor.cs" />
<Compile Include="PropertyEditor\DesignItemDataProperty.cs" />
<Compile Include="PropertyEditor\DesignItemDataSource.cs" />
<Compile Include="PropertyEditor\EditorManager.cs" />
<Compile Include="PropertyEditor\FallbackEditor.cs" />
<Compile Include="PropertyEditor\IPropertyEditorDataSource.cs" />
<Compile Include="PropertyEditor\MultiSelectionDataSource.cs" />
<Compile Include="PropertyEditor\MultipleSelectionDataSource.cs" />
<Compile Include="PropertyEditor\TextBoxEditor.cs" />
<Compile Include="PropertyEditor\PropertyEditorAttribute.cs" />
<Compile Include="PropertyEditor\PropertyEditorBindingHelper.cs" />

Loading…
Cancel
Save