diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
index f65cc0174d..fac7e555ce 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
@@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
@@ -144,6 +145,7 @@ namespace ICSharpCode.WpfDesign.Designer
this.Focusable = true;
this.VerticalAlignment = VerticalAlignment.Top;
this.HorizontalAlignment = HorizontalAlignment.Left;
+ DesignerProperties.SetIsInDesignMode(this, true);
_eatAllHitTestRequests = new EatAllHitTestRequests();
_adornerLayer = new AdornerLayer(this);
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs
new file mode 100644
index 0000000000..5644f8efec
--- /dev/null
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs
@@ -0,0 +1,45 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+
+namespace ICSharpCode.WpfDesign.Designer
+{
+ ///
+ /// Static helper methods for working with the designer DOM.
+ ///
+ public static class ModelTools
+ {
+ ///
+ /// Compares the positions of a and b in the model file.
+ ///
+ public static int ComparePositionInModelFile(DesignItem a, DesignItem b)
+ {
+ // first remember all parent properties of a
+ HashSet aProps = new HashSet();
+ DesignItem tmp = a;
+ while (tmp != null) {
+ aProps.Add(tmp.ParentProperty);
+ tmp = tmp.Parent;
+ }
+
+ // now walk up b's parent tree until a matching property is found
+ tmp = b;
+ while (tmp != null) {
+ DesignItemProperty prop = tmp.ParentProperty;
+ if (aProps.Contains(prop)) {
+ if (prop.IsCollection) {
+ return prop.CollectionElements.IndexOf(a).CompareTo(prop.CollectionElements.IndexOf(b));
+ } else {
+ return 0;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs
index 97da36331a..2a36b1d81b 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/DragMoveMouseGesture.cs
@@ -43,6 +43,9 @@ namespace ICSharpCode.WpfDesign.Designer.Services
{
IPlacementBehavior b = PlacementOperation.GetPlacementBehavior(selectedItems);
if (b != null && b.CanPlace(selectedItems, PlacementType.Move, PlacementAlignments.TopLeft)) {
+ List sortedSelectedItems = new List(selectedItems);
+ sortedSelectedItems.Sort(ModelTools.ComparePositionInModelFile);
+ selectedItems = sortedSelectedItems;
operation = PlacementOperation.Start(selectedItems, PlacementType.Move);
}
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/SelectionService.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/SelectionService.cs
index 46de417382..514551b81a 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/SelectionService.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Services/SelectionService.cs
@@ -77,10 +77,16 @@ namespace ICSharpCode.WpfDesign.Designer.Services
}
selectionType &= ~SelectionTypes.Primary;
- // if selectionType was only Primary, keep current selection; but if new primary selection
- // is not yet selected, replace existing selection with new
- if (selectionType == 0 && IsComponentSelected(newPrimarySelection) == false) {
- selectionType = SelectionTypes.Replace;
+ if (selectionType == 0) {
+ // if selectionType was only Primary, and components has only one item that
+ // changes the primary selection was changed to an already-selected item,
+ // then we keep the current selection.
+ // otherwise, we replace it
+ if (components.Count == 1 && IsComponentSelected(newPrimarySelection)) {
+ // keep selectionType = 0 -> don't change the selection
+ } else {
+ selectionType = SelectionTypes.Replace;
+ }
}
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
index eb9dc78f80..189f14a888 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
@@ -71,6 +71,7 @@
+
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs
index 73fabab4af..b8289765d1 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlDesignItem.cs
@@ -86,6 +86,20 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
}
}
+ public override DesignItemProperty ParentProperty {
+ get {
+ DesignItem parent = this.Parent;
+ if (parent == null)
+ return null;
+ XamlProperty prop = _xamlObject.ParentProperty;
+ if (prop.IsAttached) {
+ return parent.Properties.GetAttachedProperty(prop.PropertyTargetType, prop.PropertyName);
+ } else {
+ return parent.Properties.GetProperty(prop.PropertyName);
+ }
+ }
+ }
+
public override UIElement View {
get {
if (_view != null)
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTestHelper.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTestHelper.cs
similarity index 97%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTestHelper.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTestHelper.cs
index 001c5fb2e8..15a6a3cc12 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTestHelper.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTestHelper.cs
@@ -15,9 +15,10 @@ using System.Windows.Media;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using NUnit.Framework;
+using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.Designer.Xaml;
-namespace ICSharpCode.WpfDesign.Designer.Tests
+namespace ICSharpCode.WpfDesign.Tests.Designer
{
///
/// Base class for model tests.
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs
similarity index 98%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTests.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs
index ccdbf2a0f1..8433776039 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/ModelTests.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/ModelTests.cs
@@ -13,10 +13,11 @@ using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using NUnit.Framework;
+using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Designer.Services;
-namespace ICSharpCode.WpfDesign.Designer.Tests
+namespace ICSharpCode.WpfDesign.Tests.Designer
{
[TestFixture]
public class ModelTests : ModelTestHelper
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Designer.Tests.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Tests.csproj
similarity index 72%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Designer.Tests.csproj
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Tests.csproj
index 563ae58969..10c625c737 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Designer.Tests.csproj
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/WpfDesign.Tests.csproj
@@ -4,8 +4,8 @@
Debug
AnyCPU
Library
- ICSharpCode.WpfDesign.Designer.Tests
- ICSharpCode.WpfDesign.Designer.Tests
+ ICSharpCode.WpfDesign.Tests
+ ICSharpCode.WpfDesign.Tests
..\..\..\..\..\..\bin\UnitTests\
False
False
@@ -49,11 +49,24 @@
GlobalAssemblyInfo.cs
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {88DA149F-21B2-48AB-82C4-28FB6BDFD783}
+ WpfDesign.XamlDom
+
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}
WpfDesign
@@ -62,5 +75,7 @@
{78CC29AC-CC79-4355-B1F2-97936DF198AC}
WpfDesign.Designer
+
+
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClass.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClass.cs
similarity index 97%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClass.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClass.cs
index 763cf44ca3..957b5ebcb1 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClass.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClass.cs
@@ -9,7 +9,7 @@ using System;
using System.ComponentModel;
using System.Windows.Markup;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[ContentProperty("StringProp")]
public class ExampleClass : ISupportInitialize
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClassContainer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClassContainer.cs
similarity index 88%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClassContainer.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClassContainer.cs
index 055fdd059d..4227cb5617 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleClassContainer.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClassContainer.cs
@@ -7,10 +7,9 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Windows.Markup;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[ContentProperty("List")]
public class ExampleClassContainer : ExampleClass
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleService.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleService.cs
similarity index 96%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleService.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleService.cs
index 6e2d6fab91..6e93467e64 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/ExampleService.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleService.cs
@@ -8,7 +8,7 @@
using System;
using System.Windows;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
///
/// Provides an example attached property.
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SamplesTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs
similarity index 98%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SamplesTests.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs
index 728e0473c0..bff7a592c1 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SamplesTests.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SamplesTests.cs
@@ -8,7 +8,7 @@
using System;
using NUnit.Framework;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class SamplesTests : TestHelper
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SimpleLoadTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SimpleLoadTests.cs
similarity index 79%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SimpleLoadTests.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SimpleLoadTests.cs
index b25f45ffc2..8fdfedbedf 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SimpleLoadTests.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SimpleLoadTests.cs
@@ -5,10 +5,10 @@
// $Revision$
//
-using NUnit.Framework;
using System;
+using NUnit.Framework;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class SimpleLoadTests : TestHelper
@@ -54,7 +54,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
");
@@ -66,7 +66,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
@@ -79,7 +79,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -92,7 +92,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -107,7 +107,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -123,7 +123,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
otherValue
@@ -139,7 +139,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
otherValue
@@ -157,7 +157,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
{
TestLoading(@"
@@ -173,7 +173,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
{
TestLoading(@"
@@ -187,7 +187,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SystemTypesLoadTest.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SystemTypesLoadTest.cs
similarity index 94%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SystemTypesLoadTest.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SystemTypesLoadTest.cs
index c234344950..ebd1170444 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/SystemTypesLoadTest.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SystemTypesLoadTest.cs
@@ -9,7 +9,7 @@
using System;
using NUnit.Framework;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class SystemTypesLoadTest : TestHelper
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/TestHelper.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/TestHelper.cs
similarity index 95%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/TestHelper.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/TestHelper.cs
index 9e194be822..e6e60aa273 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/TestHelper.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/TestHelper.cs
@@ -6,15 +6,17 @@
//
using System;
-using System.Diagnostics;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
using System.Text;
using System.Windows.Markup;
using System.Xml;
-using System.IO;
+
+using ICSharpCode.WpfDesign.XamlDom;
using NUnit.Framework;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
public class TestHelper
{
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WhitespaceTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs
similarity index 74%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WhitespaceTests.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs
index 05cc598549..a6d5a75da3 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WhitespaceTests.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs
@@ -5,10 +5,10 @@
// $Revision$
//
-using NUnit.Framework;
using System;
+using NUnit.Framework;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class WhitespaceTests : TestHelper
@@ -19,7 +19,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -34,7 +34,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -47,7 +47,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test
string
@@ -61,7 +61,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -76,7 +76,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test string
@@ -89,7 +89,7 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
TestLoading(@"
a test
string
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/XamlTypeFinderTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/XamlTypeFinderTests.cs
similarity index 83%
rename from src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/XamlTypeFinderTests.cs
rename to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/XamlTypeFinderTests.cs
index e7be09c162..9f932ca76f 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/XamlTypeFinderTests.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/XamlTypeFinderTests.cs
@@ -5,14 +5,15 @@
// $Revision$
//
-using NUnit.Framework;
using System;
-using System.Collections.Generic;
-using System.Windows.Markup;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Markup;
-namespace ICSharpCode.WpfDesign.XamlDom.Tests
+using ICSharpCode.WpfDesign.XamlDom;
+using NUnit.Framework;
+
+namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
[TestFixture]
public class XamlTypeFinderTests : TestHelper
@@ -53,11 +54,13 @@ namespace ICSharpCode.WpfDesign.XamlDom.Tests
typeFinder.GetType(XamlConstants.XamlNamespace, "NullExtension"));
}
+ public const string XamlDomTestsNamespace = "clr-namespace:ICSharpCode.WpfDesign.Tests.XamlDom;assembly=ICSharpCode.WpfDesign.Tests";
+
[Test]
public void FindExampleClass()
{
Assert.AreEqual(typeof(ExampleClass),
- typeFinder.GetType("clr-namespace:ICSharpCode.WpfDesign.XamlDom.Tests;assembly=ICSharpCode.WpfDesign.XamlDom.Tests",
+ typeFinder.GetType(XamlDomTestsNamespace,
"ExampleClass"));
}
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/AssemblyInfo.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/AssemblyInfo.cs
deleted file mode 100644
index 5c5ff4a347..0000000000
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/AssemblyInfo.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// Information about this assembly is defined by the following
-// attributes.
-//
-// change them to the information which is associated with the assembly
-// you compile.
-
-[assembly: AssemblyTitle("WpfDesign.XamlDom.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WpfDesign.XamlDom.Tests.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WpfDesign.XamlDom.Tests.csproj
deleted file mode 100644
index dbd0d1d9dc..0000000000
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/WpfDesign.XamlDom.Tests.csproj
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
- {BD62F5BC-115F-4339-8B5B-96C7A21DC67E}
- Debug
- AnyCPU
- Library
- ICSharpCode.WpfDesign.XamlDom.Tests
- ICSharpCode.WpfDesign.XamlDom.Tests
- ..\..\..\..\..\..\bin\UnitTests\
- False
- False
- 4
- false
-
-
- true
- Full
- True
- DEBUG;TRACE
- False
-
-
- False
- None
- False
- TRACE
-
-
- False
- Auto
- 4194304
- AnyCPU
- 4096
-
-
-
-
- ..\..\..\..\..\Tools\NUnit\nunit.framework.dll
- False
- True
-
-
- False
-
-
- False
-
-
-
-
- False
-
-
-
-
- GlobalAssemblyInfo.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {88DA149F-21B2-48AB-82C4-28FB6BDFD783}
- WpfDesign.XamlDom
-
-
-
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/app.config b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/app.config
deleted file mode 100644
index e531f7e030..0000000000
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Tests/app.config
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.sln b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.sln
index 4e85bfb8d5..c16e9ba41c 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.sln
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.sln
@@ -4,15 +4,13 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.1.0.2382
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom", "WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj", "{88DA149F-21B2-48AB-82C4-28FB6BDFD783}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom.Tests", "WpfDesign.XamlDom\Tests\WpfDesign.XamlDom.Tests.csproj", "{BD62F5BC-115F-4339-8B5B-96C7A21DC67E}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Designer", "WpfDesign.Designer\Project\WpfDesign.Designer.csproj", "{78CC29AC-CC79-4355-B1F2-97936DF198AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandaloneDesigner", "StandaloneDesigner\StandaloneDesigner.csproj", "{84D65E9C-B66C-44C3-95FD-445EFE3ED322}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign", "WpfDesign\Project\WpfDesign.csproj", "{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Designer.Tests", "WpfDesign.Designer\Tests\WpfDesign.Designer.Tests.csproj", "{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Tests", "WpfDesign.Designer\Tests\WpfDesign.Tests.csproj", "{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs
index 86188b451a..9c8a4df207 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs
@@ -29,7 +29,7 @@ namespace ICSharpCode.WpfDesign
///
/// Gets the component type of this design site.
/// This value may be different from Component.GetType() if a CustomInstanceFactory created
- /// an object using a different type.
+ /// an object using a different type (e.g. ComponentType=Window but Component.GetType()=WindowClone).
///
public abstract Type ComponentType { get; }
@@ -48,6 +48,11 @@ namespace ICSharpCode.WpfDesign
///
public abstract DesignItem Parent { get; }
+ ///
+ /// Gets the property where this DesignItem is used as a value.
+ ///
+ public abstract DesignItemProperty ParentProperty { get; }
+
///
/// Gets properties set on the design item.
///
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItemProperty.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItemProperty.cs
index d1d73371ad..5b7b569920 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItemProperty.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItemProperty.cs
@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics;
using System.Windows;
namespace ICSharpCode.WpfDesign
@@ -15,8 +16,9 @@ namespace ICSharpCode.WpfDesign
///
/// Represents a property of a DesignItem.
/// All changes done via the DesignItemProperty class are represented in the underlying model (e.g. XAML).
- /// This also ensures that
- /// Changes directly done to control instances might not be reflected in the model.
+ /// All such changes are recorded in the currently running designer transaction (),
+ /// enabling Undo/Redo support.
+ /// Warning: Changes directly done to control instances might not be reflected in the model.
///
public abstract class DesignItemProperty
{
@@ -109,10 +111,14 @@ namespace ICSharpCode.WpfDesign
}
///
- /// Gets the property with the specified name.
+ /// Gets the design item property representing the specified dependency property.
+ /// The property must not be an attached property.
///
public DesignItemProperty this[DependencyProperty dependencyProperty] {
- get { return GetProperty(dependencyProperty); }
+ get {
+ Debug.Assert(DependencyPropertyDescriptor.FromProperty(dependencyProperty, dependencyProperty.OwnerType).IsAttached == false);
+ return GetProperty(dependencyProperty);
+ }
}
///
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs
index 4df56099e3..99e70c5476 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Undo/UndoStack.cs
@@ -79,12 +79,6 @@ namespace ICSharpCode.TextEditor.Undo
undostack.Push(new UndoQueue(undostack, actionCount));
}
- [Obsolete("Use CombineLast(int x) instead!")]
- public void UndoLast(int x)
- {
- CombineLast(x);
- }
-
///
/// Call this method to undo the last operation on the stack
///
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs
index 9256b8c5c6..448d011dc1 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/OverrideCompletionDataProvider.cs
@@ -59,6 +59,14 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
return properties.ToArray();
}
+ public override CompletionDataProviderKeyResult ProcessKey(char key)
+ {
+ if (key == '(')
+ return CompletionDataProviderKeyResult.NormalKey;
+ else
+ return base.ProcessKey(key);
+ }
+
public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
{
ParseInformation parseInfo = ParserService.GetParseInformation(fileName);
@@ -87,8 +95,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
public OverrideCompletionData(IMethod method)
- : base(GetName(method, ConversionFlags.None),
+ : base(GetName(method, ConversionFlags.ShowParameterList),
"override " + GetName(method, ConversionFlags.ShowReturnType
+ | ConversionFlags.ShowParameterList
| ConversionFlags.ShowAccessibility)
+ "\n\n" + method.Documentation,
ClassBrowserIconService.GetIcon(method))
diff --git a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj
index 4d77837806..f76d28c16c 100644
--- a/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj
+++ b/src/Main/Base/Test/ICSharpCode.SharpDevelop.Tests.csproj
@@ -161,4 +161,4 @@
-
+
\ No newline at end of file
diff --git a/src/SharpDevelop.Tests.sln b/src/SharpDevelop.Tests.sln
index 00285e2465..8af4ad4aee 100644
--- a/src/SharpDevelop.Tests.sln
+++ b/src/SharpDevelop.Tests.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
-# SharpDevelop 2.1.0.2192
+# SharpDevelop 2.1.0.2382
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@@ -10,7 +10,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WpfDesign", "WpfDesign", "{
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom.Tests", "AddIns\DisplayBindings\WpfDesign\WpfDesign.XamlDom\Tests\WpfDesign.XamlDom.Tests.csproj", "{BD62F5BC-115F-4339-8B5B-96C7A21DC67E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign", "AddIns\DisplayBindings\WpfDesign\WpfDesign\Project\WpfDesign.csproj", "{66A378A1-E9F4-4AD5-8946-D0EC06C2902F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Designer", "AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\Project\WpfDesign.Designer.csproj", "{78CC29AC-CC79-4355-B1F2-97936DF198AC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.Tests", "AddIns\DisplayBindings\WpfDesign\WpfDesign.Designer\Tests\WpfDesign.Tests.csproj", "{943DBBB3-E84E-4CF4-917C-C05AFA8743C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfDesign.XamlDom", "AddIns\DisplayBindings\WpfDesign\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj", "{88DA149F-21B2-48AB-82C4-28FB6BDFD783}"
EndProject
@@ -296,6 +300,18 @@ Global
{E73BB233-D88B-44A7-A98F-D71EE158381D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E73BB233-D88B-44A7-A98F-D71EE158381D}.Release|Any CPU.Build.0 = Release|Any CPU
{E73BB233-D88B-44A7-A98F-D71EE158381D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {943DBBB3-E84E-4CF4-917C-C05AFA8743C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {78CC29AC-CC79-4355-B1F2-97936DF198AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {78CC29AC-CC79-4355-B1F2-97936DF198AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {78CC29AC-CC79-4355-B1F2-97936DF198AC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {78CC29AC-CC79-4355-B1F2-97936DF198AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {66A378A1-E9F4-4AD5-8946-D0EC06C2902F}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -321,7 +337,9 @@ Global
{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
{C12B6EA7-2EFC-4368-B585-EC69EFCC3F97} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
{88DA149F-21B2-48AB-82C4-28FB6BDFD783} = {C12B6EA7-2EFC-4368-B585-EC69EFCC3F97}
- {BD62F5BC-115F-4339-8B5B-96C7A21DC67E} = {C12B6EA7-2EFC-4368-B585-EC69EFCC3F97}
+ {943DBBB3-E84E-4CF4-917C-C05AFA8743C1} = {C12B6EA7-2EFC-4368-B585-EC69EFCC3F97}
+ {78CC29AC-CC79-4355-B1F2-97936DF198AC} = {C12B6EA7-2EFC-4368-B585-EC69EFCC3F97}
+ {66A378A1-E9F4-4AD5-8946-D0EC06C2902F} = {C12B6EA7-2EFC-4368-B585-EC69EFCC3F97}
{B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}