Browse Source

Merge commit 'refs/pull/404/head' of github.com:icsharpcode/ILSpy

Conflicts:
	ILSpy.BamlDecompiler/Tests/TestRunner.cs
pull/469/merge
Siegfried Pammer 11 years ago
parent
commit
0894e4cd71
  1. 7
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs
  2. 25
      ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs
  3. 16
      ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml
  4. 2
      ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
  5. 6
      ILSpy.BamlDecompiler/Tests/TestRunner.cs

7
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

@ -1677,6 +1677,13 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1677,6 +1677,13 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
|| (elementDeclaration.Type != null && declaration.Type != null && elementDeclaration.Type.IsSubclassOf(declaration.Type)))
return String.Empty;
}
else if (node is XmlBamlPropertyElement)
{
XmlBamlPropertyElement property = (XmlBamlPropertyElement)node;
declaration = property.TypeDeclaration;
if (property.Parent.TypeDeclaration.Type.IsSubclassOf(property.PropertyDeclaration.DeclaringType.Type))
declaration = property.Parent.TypeDeclaration;
}
else if (node is XmlBamlElement)
declaration = ((XmlBamlElement)node).TypeDeclaration;
else

25
ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace ILSpy.BamlDecompiler.Tests.Cases
{
public class CustomControl : ContentControl
{
public static readonly DependencyProperty CustomNameProperty = DependencyProperty.RegisterAttached("CustomName", typeof(string), typeof(CustomControl));
public static string GetCustomName(DependencyObject target)
{
return (string)target.GetValue(CustomNameProperty);
}
public static void SetCustomName(DependencyObject target, string value)
{
target.SetValue(CustomNameProperty, value);
}
}
}

16
ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:cc="clr-namespace:ILSpy.BamlDecompiler.Tests.Cases">
<cc:CustomControl>
<cc:CustomControl.Style>
<Style />
</cc:CustomControl.Style>
<Grid.Row>0</Grid.Row>
<cc:CustomControl.CustomName>Custom1</cc:CustomControl.CustomName>
</cc:CustomControl>
<Label>
<Label.Style>
<Style />
</Label.Style>
<Grid.Row>0</Grid.Row>
<cc:CustomControl.CustomName>Label1</cc:CustomControl.CustomName>
</Label>
</Grid>

2
ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj

@ -74,6 +74,7 @@ @@ -74,6 +74,7 @@
<DependentUpon>AttachedEvent.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\CustomControl.cs" />
<Compile Include="Cases\MyControl.xaml.cs">
<DependentUpon>MyControl.xaml</DependentUpon>
<SubType>Code</SubType>
@ -127,6 +128,7 @@ @@ -127,6 +128,7 @@
<Page Include="Cases\AvalonDockCommon.xaml" />
<Page Include="Cases\MarkupExtension.xaml" />
<Page Include="Cases\MyControl.xaml" />
<Page Include="Cases\NamespacePrefix.xaml" />
<Page Include="Cases\Resources.xaml" />
<Page Include="Cases\Simple.xaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

6
ILSpy.BamlDecompiler/Tests/TestRunner.cs

@ -85,6 +85,12 @@ namespace ILSpy.BamlDecompiler.Tests @@ -85,6 +85,12 @@ namespace ILSpy.BamlDecompiler.Tests
RunTest("cases/issue445");
}
[Test]
public void NamespacePrefix()
{
RunTest("cases/namespaceprefix");
}
#region RunTest
void RunTest(string name)
{

Loading…
Cancel
Save