Browse Source

implement correct handling of Keys; add more unit tests

pull/252/head
Siegfried Pammer 14 years ago
parent
commit
604d43076e
  1. 5
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KeyMapping.cs
  2. 66
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs
  3. 72
      ILSpy.BamlDecompiler/Tests/Cases/AvalonDockBrushes.xaml
  4. 58
      ILSpy.BamlDecompiler/Tests/Cases/AvalonDockCommon.xaml
  5. 6
      ILSpy.BamlDecompiler/Tests/Cases/SimpleNames.xaml
  6. 26
      ILSpy.BamlDecompiler/Tests/Cases/SimpleNames.xaml.cs
  7. 6
      ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj
  8. 26
      ILSpy.BamlDecompiler/Tests/Mocks/AvalonDock.cs
  9. 12
      ILSpy.BamlDecompiler/Tests/TestRunner.cs

5
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KeyMapping.cs

@ -22,14 +22,19 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -22,14 +22,19 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
public bool Shared { get; set; }
public bool SharedSet { get; set; }
public int Position { get; set; }
public KeyMapping()
{
this.staticResources = new List<object>();
this.Position = -1;
}
public KeyMapping(string key)
{
this.KeyString = key;
this.staticResources = new List<object>();
this.Position = -1;
}
}
}

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

@ -46,6 +46,35 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -46,6 +46,35 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
bool isDefKeysClosed = true;
#region Context
Stack<ReaderContext> layer = new Stack<ReaderContext>();
class ReaderContext
{
public bool IsDeferred { get; set; }
public bool IsInStaticResource { get; set; }
public ReaderContext Previous { get; private set; }
public ReaderContext()
{
this.Previous = this;
}
public ReaderContext(ReaderContext previous)
{
this.Previous = previous;
}
}
ReaderContext Current {
get {
if (!layer.Any())
layer.Push(new ReaderContext());
return layer.Peek();
}
}
int currentKey;
List<KeyMapping> keys = new List<KeyMapping>();
@ -58,6 +87,19 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -58,6 +87,19 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
return last;
}
}
void LayerPop()
{
layer.Pop();
}
void LayerPush()
{
if (layer.Any())
layer.Push(new ReaderContext(layer.Peek()));
else
layer.Push(new ReaderContext());
}
#endregion
int bytesToSkip;
@ -359,6 +401,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -359,6 +401,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
reader.ReadInt32();
break;
case BamlRecordType.DeferableContentStart:
Current.IsDeferred = true;
reader.ReadInt32();
break;
case BamlRecordType.DefAttribute:
@ -910,7 +953,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -910,7 +953,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
string extension = GetTypeExtension(typeIdentifier);
keys.Add(new KeyMapping(extension) { Shared = shared, SharedSet = sharedSet });
keys.Add(new KeyMapping(extension) { Shared = shared, SharedSet = sharedSet, Position = position });
}
void ReadDefAttribute()
@ -932,7 +975,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -932,7 +975,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
if (recordName != "Key") throw new NotSupportedException(recordName);
pd = new PropertyDeclaration(recordName, XamlTypeDeclaration);
keys.Add(new KeyMapping(text));
keys.Add(new KeyMapping(text) { Position = -1 });
break;
}
@ -944,15 +987,16 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -944,15 +987,16 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
void ReadDefAttributeKeyString()
{
short num = reader.ReadInt16();
short stringId = reader.ReadInt16();
int position = reader.ReadInt32();
//bool shared = reader.ReadBoolean();
//bool sharedSet = reader.ReadBoolean();
string text = this.stringTable[num];
bool shared = reader.ReadBoolean();
bool sharedSet = reader.ReadBoolean();
string text = this.stringTable[stringId];
if (text == null)
throw new NotSupportedException();
keys.Add(new KeyMapping(text));
keys.Add(new KeyMapping(text) { Position = position });
}
void ReadXmlnsProperty()
@ -990,6 +1034,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -990,6 +1034,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
void ReadElementEnd()
{
CloseElement();
LayerPop();
}
void ReadPropertyComplexStart()
@ -1146,6 +1191,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1146,6 +1191,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
void ReadElementStart()
{
LayerPush();
short identifier = reader.ReadInt16();
sbyte flags = reader.ReadSByte();
if (flags < 0 || flags > 3)
@ -1186,7 +1232,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1186,7 +1232,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
nodes.Enqueue(new XmlBamlSimpleProperty(XWPFNamespace, "Class", string.Format("{0}.{1}", oldDeclaration.Namespace, oldDeclaration.Name)));
}
if (parentElement != null && complexPropertyOpened == 0) {
if (parentElement != null && complexPropertyOpened == 0 && !Current.IsInStaticResource && Current.Previous.IsDeferred) {
if (keys != null && keys.Count > currentKey) {
string key = keys[currentKey].KeyString;
AddKeyToElement(key);
@ -1301,12 +1347,13 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1301,12 +1347,13 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
StringBuilder sb = new StringBuilder();
FormatElementExtension((XmlBamlElement)nodes[start], sb);
keys.Add(new KeyMapping(sb.ToString()));
keys.Add(new KeyMapping(sb.ToString()) { Position = -1 });
}
}
void ReadStaticResourceStart()
{
Current.IsInStaticResource = true;
short identifier = reader.ReadInt16();
byte flags = reader.ReadByte();
TypeDeclaration declaration = GetTypeDeclaration(identifier);
@ -1324,6 +1371,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection @@ -1324,6 +1371,7 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
void ReadStaticResourceEnd()
{
CloseElement();
Current.IsInStaticResource = false;
}
void ReadStaticResourceId()

72
ILSpy.BamlDecompiler/Tests/Cases/AvalonDockBrushes.xaml

@ -3,75 +3,51 @@ @@ -3,75 +3,51 @@
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}" Color="#FFF4F2E8" />
<LinearGradientBrush x:Key="ManagedContentTabItemNormalBackground" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FFECEBE6" Offset="0"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
<GradientStop Color="#FFECEBE6" Offset="0" />
<GradientStop Color="#FFFFFFFF" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ManagedContentTabItemInvNormalBackground" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFECEBE6" Offset="1"/>
<GradientStop Color="#FFFFFFFF" Offset="0" />
<GradientStop Color="#FFECEBE6" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<LinearGradientBrush x:Key="ManagedContentTabItemHotBackground" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFECEBE6" Offset="1"/>
<GradientStop Color="#FFFFFFFF" Offset="0" />
<GradientStop Color="#FFECEBE6" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBackground"
Color="#FFFCFCFE"/>
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBackground"
Color="#FFF5F4EA"/>
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBackground" Color="#FFFCFCFE" />
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBackground" Color="#FFF5F4EA" />
<LinearGradientBrush x:Key="ManagedContentTabItemSelectedBorderBackround" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#FFFFC73C" Offset="0"/>
<GradientStop Color="#FFE68B2C" Offset="1"/>
<GradientStop Color="#FFFFC73C" Offset="0" />
<GradientStop Color="#FFE68B2C" Offset="1" />
</LinearGradientBrush>
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBorderBrush"
Color="#FFE68B2C"/>
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBackround"
Color="#FFFFC73C"/>
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBrush"
Color="#FFE68B2C"/>
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBorderBrush"
Color="#FFC9C7BA"/>
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackgroundSelected}}"
StartPoint="0,0"
EndPoint="0,1">
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBorderBrush" Color="#FFE68B2C" />
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBackround" Color="#FFFFC73C" />
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBrush" Color="#FFE68B2C" />
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBorderBrush" Color="#FFC9C7BA" />
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackgroundSelected}}" StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FF3B80ED"
Offset="0"/>
<GradientStop Color="#FF316AC5"
Offset="1"/>
<GradientStop Color="#FF3B80ED" Offset="0" />
<GradientStop Color="#FF316AC5" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackground}}"
Color="#FFCCC5BA"/>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForeground}}"
Color="Black"/>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForegroundSelected}}"
Color="White"/>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}"
Color="{x:Static SystemColors.ControlLightLightColor}" Opacity="0.5" />
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}"
Color="{x:Static SystemColors.ControlDarkColor}"/>
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackground}}" Color="#FFCCC5BA" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForeground}}" Color="Black" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForegroundSelected}}" Color="White" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}" Color="{x:Static SystemColors.ControlLightLightColor}" Opacity="0.5" />
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}" Color="{x:Static SystemColors.ControlDarkColor}" />
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackground}}" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#FFFFFFFF" Offset="0" />
<GradientStop Color="#FFE0E0E0" Offset="1" />
</LinearGradientBrush>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}"
Color="{x:Static SystemColors.WindowTextColor}"/>
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}" Color="{x:Static SystemColors.WindowTextColor}" />
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackgroundSelected}}" StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#FFFFFFFF" Offset="0" />
<GradientStop Color="#FFC1D2EE" Offset="1" />
</LinearGradientBrush>
<SolidColorBrush
x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackgroundMouseOver}}"
Color="White"/>
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackgroundMouseOver}}" Color="White" />
</ResourceDictionary>

58
ILSpy.BamlDecompiler/Tests/Cases/AvalonDockCommon.xaml

@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ad="clr-namespace:AvalonDock">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AvalonDock;component/Resources/Brushes.xaml" />
</ResourceDictionary.MergedDictionaries>
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.DockableFloatingWindow}}">
<MenuItem Command="ad:ManagedContentCommands.Show" />
<MenuItem Command="ad:ManagedContentCommands.Hide" />
<MenuItem Command="ad:DockableContentCommands.ShowAsDocument" />
<Separator />
<MenuItem Command="ad:DockableFloatingWindowCommands.SetAsFloatingWindow" />
<MenuItem Command="ad:DockableFloatingWindowCommands.SetAsDockableWindow" />
</ContextMenu>
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.DocumentFloatingWindow}}">
<MenuItem Command="ad:ManagedContentCommands.Close" />
<Separator />
<MenuItem Command="ad:DocumentContentCommands.FloatingDocument" />
<MenuItem Command="ad:DocumentContentCommands.TabbedDocument" />
</ContextMenu>
<Style x:Key="{x:Type ad:Resizer}" TargetType="{x:Type ad:Resizer}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:Resizer}">
<Border Background="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PaneHeaderCommandStyle" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="PaneHeaderCommandIntBorder" Background="Transparent" BorderThickness="1" Margin="0" Opacity="0.8">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" TargetName="PaneHeaderCommandIntBorder" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" />
<Setter Property="Background" TargetName="PaneHeaderCommandIntBorder" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" />
<Setter Property="Opacity" TargetName="PaneHeaderCommandIntBorder" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PaneHeaderContextMenuCommandStyle" TargetType="{x:Type Border}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" />
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" />
<Setter Property="Opacity" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

6
ILSpy.BamlDecompiler/Tests/Cases/SimpleNames.xaml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
<Window x:Class="ILSpy.BamlDecompiler.Tests.Cases.SimpleNames" Title="ILSpy.BamlDecompiler.Tests.Cases" Height="300" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Button x:Name="test" />
<Button Name="test2" />
</Grid>
</Window>

26
ILSpy.BamlDecompiler/Tests/Cases/SimpleNames.xaml.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
namespace ILSpy.BamlDecompiler.Tests.Cases
{
/// <summary>
/// Interaction logic for SimpleNames.xaml
/// </summary>
public partial class SimpleNames : Window
{
public SimpleNames()
{
InitializeComponent();
}
}
}

6
ILSpy.BamlDecompiler/Tests/ILSpy.BamlDecompiler.Tests.csproj

@ -74,6 +74,10 @@ @@ -74,6 +74,10 @@
<DependentUpon>Simple.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Cases\SimpleNames.xaml.cs">
<DependentUpon>SimpleNames.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Mocks\AvalonDock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestRunner.cs" />
@ -107,11 +111,13 @@ @@ -107,11 +111,13 @@
</ItemGroup>
<ItemGroup>
<Page Include="Cases\AvalonDockBrushes.xaml" />
<Page Include="Cases\AvalonDockCommon.xaml" />
<Page Include="Cases\Resources.xaml" />
<Page Include="Cases\Simple.xaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Page>
<Page Include="Cases\SimpleDictionary.xaml" />
<Page Include="Cases\SimpleNames.xaml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

26
ILSpy.BamlDecompiler/Tests/Mocks/AvalonDock.cs

@ -2,7 +2,8 @@ @@ -2,7 +2,8 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Windows.Media;
using System.Windows;
using System.Windows.Controls.Primitives;
namespace AvalonDock
{
@ -13,6 +14,21 @@ namespace AvalonDock @@ -13,6 +14,21 @@ namespace AvalonDock
}
}
public class Resizer : Thumb
{
static Resizer()
{
//This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
//This style is defined in themes\generic.xaml
DefaultStyleKeyProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(typeof(Resizer)));
MinWidthProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
MinHeightProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
HorizontalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
VerticalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure));
}
}
public enum AvalonDockBrushes
{
DefaultBackgroundBrush,
@ -43,4 +59,12 @@ namespace AvalonDock @@ -43,4 +59,12 @@ namespace AvalonDock
NavigatorWindowSelectionBorderbrush,
NavigatorWindowBottomBackground
}
public enum ContextMenuElement
{
DockablePane,
DocumentPane,
DockableFloatingWindow,
DocumentFloatingWindow
}
}

12
ILSpy.BamlDecompiler/Tests/TestRunner.cs

@ -37,12 +37,24 @@ namespace ILSpy.BamlDecompiler.Tests @@ -37,12 +37,24 @@ namespace ILSpy.BamlDecompiler.Tests
RunTest("cases/resources");
}
[Test]
public void SimpleNames()
{
RunTest("cases/simplenames");
}
[Test]
public void AvalonDockBrushes()
{
RunTest("cases/avalondockbrushes");
}
[Test]
public void AvalonDockCommon()
{
RunTest("cases/avalondockcommon");
}
#region RunTest
void RunTest(string name)
{

Loading…
Cancel
Save