Browse Source
Keep the Z-Order when moving multiple elements between containers. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2421 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
28 changed files with 185 additions and 169 deletions
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.WpfDesign.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Static helper methods for working with the designer DOM.
|
||||
/// </summary>
|
||||
public static class ModelTools |
||||
{ |
||||
/// <summary>
|
||||
/// Compares the positions of a and b in the model file.
|
||||
/// </summary>
|
||||
public static int ComparePositionInModelFile(DesignItem a, DesignItem b) |
||||
{ |
||||
// first remember all parent properties of a
|
||||
HashSet<DesignItemProperty> aProps = new HashSet<DesignItemProperty>(); |
||||
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; |
||||
} |
||||
} |
||||
} |
@ -1,15 +0,0 @@
@@ -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("")] |
@ -1,76 +0,0 @@
@@ -1,76 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{BD62F5BC-115F-4339-8B5B-96C7A21DC67E}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.WpfDesign.XamlDom.Tests</RootNamespace> |
||||
<AssemblyName>ICSharpCode.WpfDesign.XamlDom.Tests</AssemblyName> |
||||
<OutputPath>..\..\..\..\..\..\bin\UnitTests\</OutputPath> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<Optimize>False</Optimize> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
</PropertyGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
<ItemGroup> |
||||
<Reference Include="nunit.framework"> |
||||
<HintPath>..\..\..\..\..\Tools\NUnit\nunit.framework.dll</HintPath> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
<Private>True</Private> |
||||
</Reference> |
||||
<Reference Include="PresentationCore"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="PresentationFramework"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="WindowsBase"> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="..\..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
<Compile Include="AssemblyInfo.cs" /> |
||||
<Compile Include="ExampleClass.cs" /> |
||||
<Compile Include="ExampleClassContainer.cs" /> |
||||
<Compile Include="ExampleService.cs" /> |
||||
<Compile Include="SamplesTests.cs" /> |
||||
<Compile Include="SimpleLoadTests.cs" /> |
||||
<Compile Include="SystemTypesLoadTest.cs" /> |
||||
<Compile Include="TestHelper.cs" /> |
||||
<Compile Include="WhitespaceTests.cs" /> |
||||
<Compile Include="XamlTypeFinderTests.cs" /> |
||||
<None Include="app.config" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\Project\WpfDesign.XamlDom.csproj"> |
||||
<Project>{88DA149F-21B2-48AB-82C4-28FB6BDFD783}</Project> |
||||
<Name>WpfDesign.XamlDom</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
</Project> |
@ -1,15 +0,0 @@
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0"?> |
||||
<configuration> |
||||
<configSections> |
||||
<sectionGroup name="NUnit"> |
||||
<section name="TestRunner" |
||||
type="System.Configuration.NameValueSectionHandler" /> |
||||
</sectionGroup> |
||||
</configSections> |
||||
<NUnit> |
||||
<TestRunner> |
||||
<!-- Valid values are STA,MTA. Others ignored. --> |
||||
<add key="ApartmentState" value="STA" /> |
||||
</TestRunner> |
||||
</NUnit> |
||||
</configuration> |
Loading…
Reference in new issue