Skip to content

Commit

Permalink
Merge commit 'refs/pull/404/head' of github.com:icsharpcode/ILSpy
Browse files Browse the repository at this point in the history
Conflicts:
	ILSpy.BamlDecompiler/Tests/TestRunner.cs
  • Loading branch information
siegfriedpammer committed Jun 7, 2014
2 parents 82999a0 + 53cf2a6 commit 0894e4c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,13 @@ public override string NamespaceURI {
|| (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
Expand Down
25 changes: 25 additions & 0 deletions ILSpy.BamlDecompiler/Tests/Cases/CustomControl.cs
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions ILSpy.BamlDecompiler/Tests/Cases/NamespacePrefix.xaml
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions ILSpy.BamlDecompiler/Tests/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void Issue445()
RunTest("cases/issue445");
}

[Test]
public void NamespacePrefix()
{
RunTest("cases/namespaceprefix");
}

#region RunTest
void RunTest(string name)
{
Expand Down

0 comments on commit 0894e4c

Please sign in to comment.