From 111a6ca29261499c65c36b83dbb0b3b56c292172 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 22 May 2011 18:53:32 +0200 Subject: [PATCH 01/12] do not use primitive type names in TreeNodes; fixes #183 --- ICSharpCode.Decompiler/Ast/AstBuilder.cs | 72 +++++++++++++----------- ILSpy/CSharpLanguage.cs | 14 +++++ ILSpy/Language.cs | 7 +++ ILSpy/TreeNodes/TypeTreeNode.cs | 2 +- 4 files changed, 60 insertions(+), 35 deletions(-) diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index c0258db0b..17611ffa7 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -28,7 +28,8 @@ namespace ICSharpCode.Decompiler.Ast { None = 0, IncludeNamespace = 1, - IncludeTypeParameterDefinitions = 2 + IncludeTypeParameterDefinitions = 2, + DoNotUsePrimitiveTypeNames = 4 } public class AstBuilder : ICodeMappings @@ -462,39 +463,42 @@ namespace ICSharpCode.Decompiler.Ast return new PrimitiveType("dynamic"); } else { if (ns == "System") { - switch (name) { - case "SByte": - return new PrimitiveType("sbyte"); - case "Int16": - return new PrimitiveType("short"); - case "Int32": - return new PrimitiveType("int"); - case "Int64": - return new PrimitiveType("long"); - case "Byte": - return new PrimitiveType("byte"); - case "UInt16": - return new PrimitiveType("ushort"); - case "UInt32": - return new PrimitiveType("uint"); - case "UInt64": - return new PrimitiveType("ulong"); - case "String": - return new PrimitiveType("string"); - case "Single": - return new PrimitiveType("float"); - case "Double": - return new PrimitiveType("double"); - case "Decimal": - return new PrimitiveType("decimal"); - case "Char": - return new PrimitiveType("char"); - case "Boolean": - return new PrimitiveType("bool"); - case "Void": - return new PrimitiveType("void"); - case "Object": - return new PrimitiveType("object"); + if ((options & ConvertTypeOptions.DoNotUsePrimitiveTypeNames) + != ConvertTypeOptions.DoNotUsePrimitiveTypeNames) { + switch (name) { + case "SByte": + return new PrimitiveType("sbyte"); + case "Int16": + return new PrimitiveType("short"); + case "Int32": + return new PrimitiveType("int"); + case "Int64": + return new PrimitiveType("long"); + case "Byte": + return new PrimitiveType("byte"); + case "UInt16": + return new PrimitiveType("ushort"); + case "UInt32": + return new PrimitiveType("uint"); + case "UInt64": + return new PrimitiveType("ulong"); + case "String": + return new PrimitiveType("string"); + case "Single": + return new PrimitiveType("float"); + case "Double": + return new PrimitiveType("double"); + case "Decimal": + return new PrimitiveType("decimal"); + case "Char": + return new PrimitiveType("char"); + case "Boolean": + return new PrimitiveType("bool"); + case "Void": + return new PrimitiveType("void"); + case "Object": + return new PrimitiveType("object"); + } } } diff --git a/ILSpy/CSharpLanguage.cs b/ILSpy/CSharpLanguage.cs index 928e53a37..2408055fc 100644 --- a/ILSpy/CSharpLanguage.cs +++ b/ILSpy/CSharpLanguage.cs @@ -508,6 +508,12 @@ namespace ICSharpCode.ILSpy ConvertTypeOptions options = ConvertTypeOptions.IncludeTypeParameterDefinitions; if (includeNamespace) options |= ConvertTypeOptions.IncludeNamespace; + + return TypeToString(options, type, typeAttributes); + } + + string TypeToString(ConvertTypeOptions options, TypeReference type, ICustomAttributeProvider typeAttributes = null) + { AstType astType = AstBuilder.ConvertType(type, typeAttributes, options); StringWriter w = new StringWriter(); @@ -556,6 +562,14 @@ namespace ICSharpCode.ILSpy } else return property.Name; } + + public override string FormatTypeName(TypeDefinition type) + { + if (type == null) + throw new ArgumentNullException("type"); + + return TypeToString(ConvertTypeOptions.DoNotUsePrimitiveTypeNames | ConvertTypeOptions.IncludeTypeParameterDefinitions, type); + } public override bool ShowMember(MemberReference member) { diff --git a/ILSpy/Language.cs b/ILSpy/Language.cs index c29818621..d9f566013 100644 --- a/ILSpy/Language.cs +++ b/ILSpy/Language.cs @@ -127,6 +127,13 @@ namespace ICSharpCode.ILSpy throw new ArgumentNullException("property"); return property.Name; } + + public virtual string FormatTypeName(TypeDefinition type) + { + if (type == null) + throw new ArgumentNullException("type"); + return type.Name; + } /// /// Used for WPF keyboard navigation. diff --git a/ILSpy/TreeNodes/TypeTreeNode.cs b/ILSpy/TreeNodes/TypeTreeNode.cs index 85568708a..653def410 100644 --- a/ILSpy/TreeNodes/TypeTreeNode.cs +++ b/ILSpy/TreeNodes/TypeTreeNode.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.ILSpy.TreeNodes } public override object Text { - get { return HighlightSearchMatch(this.Language.TypeToString(type, includeNamespace: false)); } + get { return HighlightSearchMatch(this.Language.FormatTypeName(type)); } } public bool IsPublicAPI { From 51eb00aac724dda67eaf779a86babcc917395b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Mon, 23 May 2011 00:14:59 +0100 Subject: [PATCH 02/12] Remove unreachable code in ILAstBuilder. Closes #134. Closes #151. Closes #171. --- ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs | 44 ++++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs index aed211f56..f6edfad85 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs @@ -426,13 +426,12 @@ namespace ICSharpCode.Decompiler.ILAst } } - // Occasionally the compiler generates unreachable code - it can be usually just ignored - var reachableBody = body.Where(b => b.StackBefore != null); - var unreachableBody = body.Where(b => b.StackBefore == null); + // Occasionally the compilers or obfuscators generate unreachable code (which migt be intentonally invalid) + // I belive it is safe to just remove it + body.RemoveAll(b => b.StackBefore == null); // Genertate temporary variables to replace stack - // Unrachable code does not need temporary variables - the values are never pushed on the stack for consuption - foreach(ByteCode byteCode in reachableBody) { + foreach(ByteCode byteCode in body) { int argIdx = 0; int popCount = byteCode.PopCount ?? byteCode.StackBefore.Count; for (int i = byteCode.StackBefore.Count - popCount; i < byteCode.StackBefore.Count; i++) { @@ -450,19 +449,18 @@ namespace ICSharpCode.Decompiler.ILAst // Try to use single temporary variable insted of several if possilbe (especially useful for dup) // This has to be done after all temporary variables are assigned so we know about all loads - // Unrachable code will not have any StoreTo - foreach(ByteCode byteCode in reachableBody) { + foreach(ByteCode byteCode in body) { if (byteCode.StoreTo != null && byteCode.StoreTo.Count > 1) { var locVars = byteCode.StoreTo; // For each of the variables, find the location where it is loaded - there should be preciesly one - var loadedBy = locVars.Select(locVar => reachableBody.SelectMany(bc => bc.StackBefore).Single(s => s.LoadFrom == locVar)).ToList(); + var loadedBy = locVars.Select(locVar => body.SelectMany(bc => bc.StackBefore).Single(s => s.LoadFrom == locVar)).ToList(); // We now know that all the variables have a single load, // Let's make sure that they have also a single store - us if (loadedBy.All(slot => slot.PushedBy.Length == 1 && slot.PushedBy[0] == byteCode)) { // Great - we can reduce everything into single variable ILVariable tmpVar = new ILVariable() { Name = string.Format("expr_{0:X2}", byteCode.Offset), IsGenerated = true }; byteCode.StoreTo = new List() { tmpVar }; - foreach(ByteCode bc in reachableBody) { + foreach(ByteCode bc in body) { for (int i = 0; i < bc.StackBefore.Count; i++) { // Is it one of the variable to be merged? if (locVars.Contains(bc.StackBefore[i].LoadFrom)) { @@ -658,12 +656,14 @@ namespace ICSharpCode.Decompiler.ILAst // Find the first and widest scope int tryStart = ehs.Min(eh => eh.TryStart.Offset); int tryEnd = ehs.Where(eh => eh.TryStart.Offset == tryStart).Max(eh => eh.TryEnd.Offset); - var handlers = ehs.Where(eh => eh.TryStart.Offset == tryStart && eh.TryEnd.Offset == tryEnd).ToList(); + var handlers = ehs.Where(eh => eh.TryStart.Offset == tryStart && eh.TryEnd.Offset == tryEnd).OrderBy(eh => eh.TryStart.Offset).ToList(); + + // Remember that any part of the body migt have been removed due to unreachability // Cut all instructions up to the try block { - int tryStartIdx; - for (tryStartIdx = 0; body[tryStartIdx].Offset != tryStart; tryStartIdx++); + int tryStartIdx = 0; + while (tryStartIdx < body.Count && body[tryStartIdx].Offset < tryStart) tryStartIdx++; ast.AddRange(ConvertToAst(body.CutRange(0, tryStartIdx))); } @@ -671,24 +671,22 @@ namespace ICSharpCode.Decompiler.ILAst { HashSet nestedEHs = new HashSet(ehs.Where(eh => (tryStart <= eh.TryStart.Offset && eh.TryEnd.Offset < tryEnd) || (tryStart < eh.TryStart.Offset && eh.TryEnd.Offset <= tryEnd))); ehs.ExceptWith(nestedEHs); - int tryEndIdx; - for (tryEndIdx = 0; tryEndIdx < body.Count && body[tryEndIdx].Offset != tryEnd; tryEndIdx++); + int tryEndIdx = 0; + while (tryEndIdx < body.Count && body[tryEndIdx].Offset < tryEnd) tryEndIdx++; tryCatchBlock.TryBlock = new ILBlock(ConvertToAst(body.CutRange(0, tryEndIdx), nestedEHs)); } // Cut all handlers tryCatchBlock.CatchBlocks = new List(); foreach(ExceptionHandler eh in handlers) { - int startIndex; - for (startIndex = 0; body[startIndex].Offset != eh.HandlerStart.Offset; startIndex++); - int endInclusiveIndex; - if (eh.HandlerEnd == null) endInclusiveIndex = body.Count - 1; - // Note that the end(exclusive) instruction may not necessarly be in our body - else for (endInclusiveIndex = 0; body[endInclusiveIndex].Next.Offset != eh.HandlerEnd.Offset; endInclusiveIndex++); - int count = 1 + endInclusiveIndex - startIndex; - HashSet nestedEHs = new HashSet(ehs.Where(e => (eh.HandlerStart.Offset <= e.TryStart.Offset && e.TryEnd.Offset < eh.HandlerEnd.Offset) || (eh.HandlerStart.Offset < e.TryStart.Offset && e.TryEnd.Offset <= eh.HandlerEnd.Offset))); + int handlerEndOffset = eh.HandlerEnd == null ? methodDef.Body.CodeSize : eh.HandlerEnd.Offset; + int startIdx = 0; + while (startIdx < body.Count && body[startIdx].Offset < eh.HandlerStart.Offset) startIdx++; + int endIdx = 0; + while (endIdx < body.Count && body[endIdx].Offset < handlerEndOffset) endIdx++; + HashSet nestedEHs = new HashSet(ehs.Where(e => (eh.HandlerStart.Offset <= e.TryStart.Offset && e.TryEnd.Offset < handlerEndOffset) || (eh.HandlerStart.Offset < e.TryStart.Offset && e.TryEnd.Offset <= handlerEndOffset))); ehs.ExceptWith(nestedEHs); - List handlerAst = ConvertToAst(body.CutRange(startIndex, count), nestedEHs); + List handlerAst = ConvertToAst(body.CutRange(startIdx, endIdx - startIdx), nestedEHs); if (eh.HandlerType == ExceptionHandlerType.Catch) { ILTryCatchBlock.CatchBlock catchBlock = new ILTryCatchBlock.CatchBlock() { ExceptionType = eh.CatchType, From dd02632a4bad9307d01df5bc3bd94fc4d6732f1b Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 May 2011 16:57:39 +0200 Subject: [PATCH 03/12] add ILSpy.BamlDecompiler project --- .../ILSpy.BamlDecompiler.csproj | 48 +++++++++++++++++++ ILSpy.BamlDecompiler/MyClass.cs | 16 +++++++ .../Properties/AssemblyInfo.cs | 31 ++++++++++++ ILSpy.sln | 12 ++++- doc/MS-PL.txt | 31 ++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj create mode 100644 ILSpy.BamlDecompiler/MyClass.cs create mode 100644 ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs create mode 100644 doc/MS-PL.txt diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj new file mode 100644 index 000000000..c83e4dc5e --- /dev/null +++ b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj @@ -0,0 +1,48 @@ + + + + {A6BAD2BA-76BA-461C-8B6D-418607591247} + Debug + x86 + Library + ILSpy.BamlDecompiler + ILSpy.BamlDecompiler + v4.0 + Client + Properties + + + x86 + + + bin\Debug\ + True + Full + False + True + DEBUG;TRACE + + + bin\Release\ + False + None + True + False + TRACE + + + + + 3.5 + + + + 3.5 + + + + + + + + \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/MyClass.cs b/ILSpy.BamlDecompiler/MyClass.cs new file mode 100644 index 000000000..f89c0f24e --- /dev/null +++ b/ILSpy.BamlDecompiler/MyClass.cs @@ -0,0 +1,16 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; + +namespace ILSpy.BamlDecompiler +{ + /// + /// Description of MyClass. + /// + public class MyClass + { + + } +} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs b/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..54a525812 --- /dev/null +++ b/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +#region Using directives + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ILSpy.BamlDecompiler")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ILSpy.BamlDecompiler")] +[assembly: AssemblyCopyright("Copyright 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all the values or you can use the default the Revision and +// Build Numbers by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] diff --git a/ILSpy.sln b/ILSpy.sln index 7af0dee1b..747fdd135 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -# SharpDevelop 4.0.1.7146 +# SharpDevelop 4.1.0.7466-alpha Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}" ProjectSection(SolutionItems) = postProject doc\Command Line.txt = doc\Command Line.txt @@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPlugin", "TestPlugin\Te EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Pdb", "Mono.Cecil\symbols\pdb\Mono.Cecil.Pdb.csproj", "{63E6915C-7EA4-4D76-AB28-0D7191EEA626}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.BamlDecompiler", "ILSpy.BamlDecompiler\ILSpy.BamlDecompiler.csproj", "{A6BAD2BA-76BA-461C-8B6D-418607591247}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -105,6 +107,14 @@ Global {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.Build.0 = net_4_0_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.ActiveCfg = net_4_0_Release|Any CPU + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.Build.0 = Debug|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|x86.Build.0 = Debug|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|x86.ActiveCfg = Debug|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.Build.0 = Release|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.ActiveCfg = Release|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|x86.Build.0 = Release|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|x86.ActiveCfg = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/doc/MS-PL.txt b/doc/MS-PL.txt new file mode 100644 index 000000000..622a544b7 --- /dev/null +++ b/doc/MS-PL.txt @@ -0,0 +1,31 @@ +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file From 71c8fb1446e9f0dd96449fa4265d2b38ae609c3e Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 May 2011 17:20:55 +0200 Subject: [PATCH 04/12] add source of Ricciolo.StylesExplorer.MarkupReflection by Cristian Civera --- .../ILSpy.BamlDecompiler.csproj | 25 + .../AppDomainTypeResolver.cs | 172 ++ .../BamlAssembly.cs | 112 + .../BamlBinaryReader.cs | 47 + .../BamlFile.cs | 80 + .../BamlRecordType.cs | 72 + .../DotNetType.cs | 58 + .../IDependencyPropertyDescriptor.cs | 14 + .../IType.cs | 19 + .../ITypeResolver.cs | 15 + .../KnownInfo.cs | 1319 +++++++++++ .../PropertyDeclaration.cs | 58 + .../ResourceName.cs | 32 + .../TypeDeclaration.cs | 137 ++ .../WpfDependencyPropertyDescriptor.cs | 35 + .../XmlBamlElement.cs | 193 ++ .../XmlBamlNode.cs | 21 + .../XmlBamlProperty.cs | 86 + .../XmlBamlPropertyElement.cs | 48 + .../XmlBamlReader.cs | 1939 +++++++++++++++++ .../XmlBamlText.cs | 33 + .../XmlNamespace.cs | 47 + .../XmlPIMapping.cs | 63 + 23 files changed, 4625 insertions(+) create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/AppDomainTypeResolver.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlAssembly.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlBinaryReader.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlFile.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlRecordType.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/DotNetType.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IDependencyPropertyDescriptor.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IType.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ITypeResolver.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KnownInfo.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/PropertyDeclaration.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ResourceName.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/WpfDependencyPropertyDescriptor.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlElement.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlNode.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlProperty.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlPropertyElement.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlText.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlNamespace.cs create mode 100644 ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlPIMapping.cs diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj index c83e4dc5e..7424fec6f 100644 --- a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj +++ b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj @@ -43,6 +43,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/AppDomainTypeResolver.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/AppDomainTypeResolver.cs new file mode 100644 index 000000000..9cc329459 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/AppDomainTypeResolver.cs @@ -0,0 +1,172 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Reflection; +using System.Text; +using System.IO; +using System.Linq; +using Microsoft.Win32; +using System.Threading; +using System.Security.Permissions; +using System.Security; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public delegate void AssemblyResolveEventHandler(object s, AssemblyResolveEventArgs e); + + public class AppDomainTypeResolver : MarshalByRefObject, ITypeResolver + { + private readonly AppDomain _domain; + private string baseDir; + + public event AssemblyResolveEventHandler AssemblyResolve; + + public static AppDomainTypeResolver GetIntoNewAppDomain(string baseDir) + { + AppDomainSetup info = new AppDomainSetup(); + info.ApplicationBase = Environment.CurrentDirectory; + AppDomain domain = AppDomain.CreateDomain("AppDomainTypeResolver", null, info, new PermissionSet(PermissionState.Unrestricted)); + AppDomainTypeResolver resolver = (AppDomainTypeResolver)domain.CreateInstanceAndUnwrap(typeof(AppDomainTypeResolver).Assembly.FullName, + typeof(AppDomainTypeResolver).FullName, false, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, new object[] { domain, baseDir }, null, null, null); + + return resolver; + } + + Assembly domain_AssemblyResolve(object sender, ResolveEventArgs args) + { + // Cerco di risolvere automaticamente + AssemblyName name = new AssemblyName(args.Name); + string fileName = Path.Combine(this.baseDir, name.Name + ".exe"); + if (!File.Exists(fileName)) + fileName = Path.Combine(this.baseDir, name.Name + ".dll"); + + // Carico il percorso autocalcolato + if (File.Exists(fileName)) + return Assembly.LoadFile(fileName); + + if (AssemblyResolve != null) + { + AssemblyResolveEventArgs e = new AssemblyResolveEventArgs(args.Name, this.baseDir); + AssemblyResolve(this, e); + if (!String.IsNullOrEmpty(e.Location) && File.Exists(e.Location)) + return Assembly.LoadFile(e.Location); + } + + return null; + } + + public static void DestroyResolver(AppDomainTypeResolver resolver) + { + if (resolver == null) throw new ArgumentNullException("resolver"); + + ThreadPool.QueueUserWorkItem(delegate + { + AppDomain.Unload(resolver.Domain); + }); + } + + protected AppDomainTypeResolver(AppDomain domain, string baseDir) + { + _domain = domain; + this.baseDir = baseDir; + + domain.AssemblyResolve += new ResolveEventHandler(domain_AssemblyResolve); + } + + public BamlAssembly LoadAssembly(AssemblyName asm) + { + //return new BamlAssembly(Assembly.Load(asm)); + return new BamlAssembly(_domain.Load(asm)); + } + + public BamlAssembly LoadAssembly(string location) + { + Assembly asm = Assembly.LoadFile(location); + return new BamlAssembly(asm); + //return _domain.Load(System.IO.File.ReadAllBytes(location)); + //return Assembly.LoadFrom(location); + } + + public BamlAssembly[] GetReferencedAssemblies(BamlAssembly asm) + { + AssemblyName[] list = asm.Assembly.GetReferencedAssemblies(); + + return (from an in list + select this.LoadAssembly(an)).ToArray(); + } + + public AppDomain Domain + { + get { return _domain; } + } + + #region ITypeResolver Members + + public IType GetTypeByAssemblyQualifiedName(string name) + { + return new DotNetType(name); + } + + public IDependencyPropertyDescriptor GetDependencyPropertyDescriptor(string name, IType ownerType, IType targetType) + { + if (name == null) throw new ArgumentNullException("name"); + if (ownerType == null) throw new ArgumentNullException("ownerType"); + if (targetType == null) throw new ArgumentNullException("targetType"); + + Type dOwnerType = ((DotNetType)ownerType).Type; + Type dTargetType = ((DotNetType)targetType).Type; + + try + { + DependencyPropertyDescriptor propertyDescriptor = DependencyPropertyDescriptor.FromName(name, dOwnerType, dTargetType); + if (propertyDescriptor != null) + return new WpfDependencyPropertyDescriptor(propertyDescriptor); + return null; + } + catch (Exception) + { + return null; + } + } + + #endregion + + public override object InitializeLifetimeService() + { + return null; + } + } + + public class AssemblyResolveEventArgs : MarshalByRefObject + { + + private string _location; + private string _name; + private string _baseDir; + + public AssemblyResolveEventArgs(string name, string baseDir) + { + _name = name; + _baseDir = baseDir; + } + + public string Location + { + get { return _location; } + set { _location = value; } + } + + public string Name + { + get { return _name; } + } + + public string BaseDir + { + get { return _baseDir; } + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlAssembly.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlAssembly.cs new file mode 100644 index 000000000..d9d71860f --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlAssembly.cs @@ -0,0 +1,112 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Reflection; +using System.Resources; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class BamlAssembly : MarshalByRefObject + { + private readonly string _filePath; + private Assembly _assembly; + private BamlFileList _bamlFile; + + public BamlAssembly(Assembly assembly) + { + _assembly = assembly; + _filePath = assembly.CodeBase; + + ReadBaml(); + } + + public BamlAssembly(string filePath) + { + this._filePath = Path.GetFullPath(filePath); + this._assembly = Assembly.LoadFile(this.FilePath); + if (String.Compare(this.Assembly.CodeBase, this.FilePath, true) != 0) + throw new ArgumentException("Cannot load filePath because Assembly is already loaded", "filePath"); + + ReadBaml(); + } + + private void ReadBaml() + { + // Get available names + string[] resources = this.Assembly.GetManifestResourceNames(); + foreach (string res in resources) + { + // Solo le risorse + if (String.Compare(Path.GetExtension(res), ".resources", true) != 0) continue; + + // Get stream + using (Stream stream = this.Assembly.GetManifestResourceStream(res)) + { + try + { + ResourceReader reader = new ResourceReader(stream); + foreach (DictionaryEntry entry in reader) + { + if (String.Compare(Path.GetExtension(entry.Key.ToString()), ".baml", true) == 0 && entry.Value is Stream) + { + BamlFile bm = new BamlFile(GetAssemblyResourceUri(entry.Key.ToString()), (Stream)entry.Value); + this.BamlFiles.Add(bm); + } + } + } + catch (ArgumentException) + {} + } + } + } + + private Uri GetAssemblyResourceUri(string resourceName) + { + AssemblyName asm = this.Assembly.GetName(); + byte[] data = asm.GetPublicKeyToken(); + StringBuilder token = new StringBuilder(data.Length * 2); + for (int x = 0; x < data.Length; x++) + { + token.Append(data[x].ToString("x", System.Globalization.CultureInfo.InvariantCulture)); + } + + return new Uri(String.Format(@"{0};V{1};{2};component\{3}", asm.Name, asm.Version, token, Path.ChangeExtension(resourceName, ".xaml")), UriKind.RelativeOrAbsolute); + } + + public string FilePath + { + get { return _filePath; } + } + + public Assembly Assembly + { + get { return _assembly; } + } + + public BamlFileList BamlFiles + { + get + { + if (_bamlFile == null) + _bamlFile = new BamlFileList(); + return _bamlFile; + } + } + + public override object InitializeLifetimeService() + { + return null; + } + } + + [Serializable()] + public class BamlFileList : Collection + {} + +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlBinaryReader.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlBinaryReader.cs new file mode 100644 index 000000000..6df206561 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlBinaryReader.cs @@ -0,0 +1,47 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.IO; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class BamlBinaryReader : BinaryReader + { + // Methods + public BamlBinaryReader(Stream stream) + : base(stream) + { + } + + public virtual double ReadCompressedDouble() + { + switch (this.ReadByte()) + { + case 1: + return 0; + + case 2: + return 1; + + case 3: + return -1; + + case 4: + { + double num = this.ReadInt32(); + return (num * 1E-06); + } + case 5: + return this.ReadDouble(); + } + throw new NotSupportedException(); + } + + public int ReadCompressedInt32() + { + return base.Read7BitEncodedInt(); + } + } +} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlFile.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlFile.cs new file mode 100644 index 000000000..d4af6bb81 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlFile.cs @@ -0,0 +1,80 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Resources; +using System.Text; +using System.Windows; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + /// + /// Rappresenta un singole file Baml all'interno di un assembly + /// + public class BamlFile : Component + { + private Uri _uri; + private readonly Stream _stream; + + public BamlFile(Uri uri, Stream stream) + { + if (uri == null) + new ArgumentNullException("uri"); + if (stream == null) + throw new ArgumentNullException("stream"); + + _uri = uri; + _stream = stream; + } + + /// + /// Carica il Baml attraverso il motore di WPF con Application.LoadComponent + /// + /// + public object LoadContent() + { + try + { + return Application.LoadComponent(this.Uri); + } + catch (Exception e) + { + throw new InvalidOperationException("Invalid baml file.", e); + } + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + this.Stream.Dispose(); + } + + public override object InitializeLifetimeService() + { + return null; + } + + /// + /// Restituisce lo stream originale contenente il Baml + /// + public Stream Stream + { + get { return _stream; } + } + + /// + /// Restituisce l'indirizzo secondo lo schema pack:// + /// + public Uri Uri + { + get { return _uri; } + } + + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlRecordType.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlRecordType.cs new file mode 100644 index 000000000..50ca01ddb --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/BamlRecordType.cs @@ -0,0 +1,72 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal enum BamlRecordType : byte + { + AssemblyInfo = 0x1c, + AttributeInfo = 0x1f, + ClrEvent = 0x13, + Comment = 0x17, + ConnectionId = 0x2d, + ConstructorParametersEnd = 0x2b, + ConstructorParametersStart = 0x2a, + ConstructorParameterType = 0x2c, + ContentProperty = 0x2e, + DefAttribute = 0x19, + DefAttributeKeyString = 0x26, + DefAttributeKeyType = 0x27, + DeferableContentStart = 0x25, + DefTag = 0x18, + DocumentEnd = 2, + DocumentStart = 1, + ElementEnd = 4, + ElementStart = 3, + EndAttributes = 0x1a, + KeyElementEnd = 0x29, + KeyElementStart = 40, + LastRecordType = 0x39, + LineNumberAndPosition = 0x35, + LinePosition = 0x36, + LiteralContent = 15, + NamedElementStart = 0x2f, + OptimizedStaticResource = 0x37, + PIMapping = 0x1b, + PresentationOptionsAttribute = 0x34, + ProcessingInstruction = 0x16, + Property = 5, + PropertyArrayEnd = 10, + PropertyArrayStart = 9, + PropertyComplexEnd = 8, + PropertyComplexStart = 7, + PropertyCustom = 6, + PropertyDictionaryEnd = 14, + PropertyDictionaryStart = 13, + PropertyListEnd = 12, + PropertyListStart = 11, + PropertyStringReference = 0x21, + PropertyTypeReference = 0x22, + PropertyWithConverter = 0x24, + PropertyWithExtension = 0x23, + PropertyWithStaticResourceId = 0x38, + RoutedEvent = 0x12, + StaticResourceEnd = 0x31, + StaticResourceId = 50, + StaticResourceStart = 0x30, + StringInfo = 0x20, + Text = 0x10, + TextWithConverter = 0x11, + TextWithId = 0x33, + TypeInfo = 0x1d, + TypeSerializerInfo = 30, + Unknown = 0, + XmlAttribute = 0x15, + XmlnsProperty = 20 + } + +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/DotNetType.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/DotNetType.cs new file mode 100644 index 000000000..1dbf1b21a --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/DotNetType.cs @@ -0,0 +1,58 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class DotNetType : MarshalByRefObject, IType + { + private readonly string _assemblyQualifiedName; + private Type _type; + + public DotNetType(string assemblyQualifiedName) + { + if (assemblyQualifiedName == null) throw new ArgumentNullException("assemblyQualifiedName"); + + _assemblyQualifiedName = assemblyQualifiedName; + _type = Type.GetType(assemblyQualifiedName, false, true); + } + + #region IType Members + + public string AssemblyQualifiedName + { + get { return _assemblyQualifiedName; } + } + + public bool IsSubclassOf(IType type) + { + if (type == null) throw new ArgumentNullException("type"); + if (!(type is DotNetType)) throw new ArgumentException("type"); + if (_type == null) return false; + return this._type.IsSubclassOf(((DotNetType)type).Type); + } + + public bool Equals(IType type) + { + if (type == null) throw new ArgumentNullException("type"); + if (!(type is DotNetType)) throw new ArgumentException("type"); + if (_type == null) return false; + return this._type.Equals(((DotNetType)type).Type); + } + + #endregion + + public Type Type + { + get { return _type; } + } + + public override object InitializeLifetimeService() + { + return null; + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IDependencyPropertyDescriptor.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IDependencyPropertyDescriptor.cs new file mode 100644 index 000000000..0005efa52 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IDependencyPropertyDescriptor.cs @@ -0,0 +1,14 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public interface IDependencyPropertyDescriptor + { + bool IsAttached { get; } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IType.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IType.cs new file mode 100644 index 000000000..7ec8c79e4 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/IType.cs @@ -0,0 +1,19 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + /// + /// Interface rappresenting a DotNet type + /// + public interface IType + { + string AssemblyQualifiedName { get; } + bool IsSubclassOf(IType type); + bool Equals(IType type); + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ITypeResolver.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ITypeResolver.cs new file mode 100644 index 000000000..71e802a61 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ITypeResolver.cs @@ -0,0 +1,15 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public interface ITypeResolver + { + IType GetTypeByAssemblyQualifiedName(string name); + IDependencyPropertyDescriptor GetDependencyPropertyDescriptor(string name, IType ownerType, IType targetType); + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KnownInfo.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KnownInfo.cs new file mode 100644 index 000000000..e58762f41 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/KnownInfo.cs @@ -0,0 +1,1319 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class KnownInfo + { + internal TypeDeclaration[] KnownTypeTable = null; + internal PropertyDeclaration[] KnownPropertyTable = null; + internal static String[] KnownAssemblyTable = null; + internal Hashtable KnownResourceTable = new Hashtable(); + + #region Initialize + + static KnownInfo() + { + KnownAssemblyTable = new string[5]; + KnownAssemblyTable[0] = + "PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + KnownAssemblyTable[1] = + "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + KnownAssemblyTable[2] = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + KnownAssemblyTable[3] = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + KnownAssemblyTable[4] = "WindowBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + } + + public KnownInfo() : this(null) + { + } + + public KnownInfo(ITypeResolver resolver) + { + KnownAssemblyTable = new string[5]; + KnownAssemblyTable[0] = "PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + KnownAssemblyTable[1] = "PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + KnownAssemblyTable[2] = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + KnownAssemblyTable[3] = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + KnownAssemblyTable[4] = "WindowBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + + KnownTypeTable = new TypeDeclaration[760]; + KnownTypeTable[0] = new TypeDeclaration(resolver, string.Empty, string.Empty, 0); + KnownTypeTable[1] = new TypeDeclaration(resolver, "AccessText", "System.Windows.Controls", 0); + KnownTypeTable[2] = new TypeDeclaration(resolver, "AdornedElementPlaceholder", "System.Windows.Controls", 0); + KnownTypeTable[3] = new TypeDeclaration(resolver, "Adorner", "System.Windows.Documents", 0); + KnownTypeTable[4] = new TypeDeclaration(resolver, "AdornerDecorator", "System.Windows.Documents", 0); + KnownTypeTable[5] = new TypeDeclaration(resolver, "AdornerLayer", "System.Windows.Documents", 0); + KnownTypeTable[6] = new TypeDeclaration(resolver, "AffineTransform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[7] = new TypeDeclaration(resolver, "AmbientLight", "System.Windows.Media.Media3D", 1); + KnownTypeTable[8] = new TypeDeclaration(resolver, "AnchoredBlock", "System.Windows.Documents", 0); + KnownTypeTable[9] = new TypeDeclaration(resolver, "Animatable", "System.Windows.Media.Animaton", 1); + KnownTypeTable[10] = new TypeDeclaration(resolver, "AnimationClock", "System.Windows.Media.Animation", 1); + KnownTypeTable[11] = new TypeDeclaration(resolver, "AnimationTimeline", "System.Windows.Media.Animation", 1); + KnownTypeTable[12] = new TypeDeclaration(resolver, "Application", "System.Net.Mime", 3); + KnownTypeTable[13] = new TypeDeclaration(resolver, "ArcSegment", "System.Windows.Media", 1); + KnownTypeTable[14] = new TypeDeclaration(resolver, "ArrayExtension", "System.Windows.Markup", 0); + KnownTypeTable[15] = new TypeDeclaration(resolver, "AxisAngleRotation3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x10] = new TypeDeclaration(resolver, "BaseIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[0x11] = new TypeDeclaration(resolver, "BeginStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x12] = new TypeDeclaration(resolver, "BevelBitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x13] = new TypeDeclaration(resolver, "BezierSegment", "System.Windows.Media", 1); + KnownTypeTable[20] = new TypeDeclaration(resolver, "Binding", "System.Windows.Data", 0, true); + KnownTypeTable[0x15] = new TypeDeclaration(resolver, "BindingBase", "System.Windows.Data", 0); + KnownTypeTable[0x16] = new TypeDeclaration(resolver, "BindingExpression", "System.Windows.Data", 0); + KnownTypeTable[0x17] = new TypeDeclaration(resolver, "BindingExpressionBase", "System.Windows.Data", 0); + KnownTypeTable[0x18] = new TypeDeclaration(resolver, "BindingListCollectionView", "System.Windows.Data", 0); + KnownTypeTable[0x19] = new TypeDeclaration(resolver, "BitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x1a] = new TypeDeclaration(resolver, "BitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x1b] = new TypeDeclaration(resolver, "BitmapEffectCollection", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x1c] = new TypeDeclaration(resolver, "BitmapEffectGroup", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x1d] = new TypeDeclaration(resolver, "BitmapEffectInput", "System.Windows.Media.Effects", 1); + KnownTypeTable[30] = new TypeDeclaration(resolver, "BitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x1f] = new TypeDeclaration(resolver, "BitmapFrame", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x20] = new TypeDeclaration(resolver, "BitmapImage", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x21] = new TypeDeclaration(resolver, "BitmapMetadata", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x22] = new TypeDeclaration(resolver, "BitmapPalette", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x23] = new TypeDeclaration(resolver, "BitmapSource", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x24] = new TypeDeclaration(resolver, "Block", "System.Windows.Documents", 0); + KnownTypeTable[0x25] = new TypeDeclaration(resolver, "BlockUIContainer", "System.Windows.Documents", 0); + KnownTypeTable[0x26] = new TypeDeclaration(resolver, "BlurBitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x27] = new TypeDeclaration(resolver, "BmpBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[40] = new TypeDeclaration(resolver, "BmpBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x29] = new TypeDeclaration(resolver, "Bold", "System.Windows.Documents", 0); + KnownTypeTable[0x2b] = new TypeDeclaration(resolver, "Boolean", "System", 2); + KnownTypeTable[0x2c] = new TypeDeclaration(resolver, "BooleanAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2d] = new TypeDeclaration(resolver, "BooleanAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2e] = new TypeDeclaration(resolver, "BooleanConverter", "System.ComponentModel", 3); + KnownTypeTable[0x2f] = new TypeDeclaration(resolver, "BooleanKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x30] = new TypeDeclaration(resolver, "BooleanKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x31] = new TypeDeclaration(resolver, "BooleanToVisibilityConverter", "System.Windows.Controls", 0); + KnownTypeTable[0x2a] = new TypeDeclaration(resolver, "BoolIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[50] = new TypeDeclaration(resolver, "Border", "System.Windows.Controls", 0); + KnownTypeTable[0x33] = new TypeDeclaration(resolver, "BorderGapMaskConverter", "System.Windows.Controls", 0); + KnownTypeTable[0x34] = new TypeDeclaration(resolver, "Brush", "System.Windows.Media", 1); + KnownTypeTable[0x35] = new TypeDeclaration(resolver, "BrushConverter", "System.Windows.Media", 1); + KnownTypeTable[0x36] = new TypeDeclaration(resolver, "BulletDecorator", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x37] = new TypeDeclaration(resolver, "Button", "System.Windows.Controls", 0); + KnownTypeTable[0x38] = new TypeDeclaration(resolver, "ButtonBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x39] = new TypeDeclaration(resolver, "Byte", "System", 2); + KnownTypeTable[0x3a] = new TypeDeclaration(resolver, "ByteAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x3b] = new TypeDeclaration(resolver, "ByteAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[60] = new TypeDeclaration(resolver, "ByteAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x3d] = new TypeDeclaration(resolver, "ByteConverter", "System.ComponentModel", 3); + KnownTypeTable[0x3e] = new TypeDeclaration(resolver, "ByteKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x3f] = new TypeDeclaration(resolver, "ByteKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x40] = new TypeDeclaration(resolver, "CachedBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x41] = new TypeDeclaration(resolver, "Camera", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x42] = new TypeDeclaration(resolver, "Canvas", "System.Windows.Controls", 0); + KnownTypeTable[0x43] = new TypeDeclaration(resolver, "Char", "System", 2); + KnownTypeTable[0x44] = new TypeDeclaration(resolver, "CharAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x45] = new TypeDeclaration(resolver, "CharAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[70] = new TypeDeclaration(resolver, "CharConverter", "System.ComponentModel", 3); + KnownTypeTable[0x47] = new TypeDeclaration(resolver, "CharIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[0x48] = new TypeDeclaration(resolver, "CharKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x49] = new TypeDeclaration(resolver, "CharKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x4a] = new TypeDeclaration(resolver, "CheckBox", "System.Windows.Controls", 0); + KnownTypeTable[0x4b] = new TypeDeclaration(resolver, "Clock", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x4c] = new TypeDeclaration(resolver, "ClockController", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x4d] = new TypeDeclaration(resolver, "ClockGroup", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x4e] = new TypeDeclaration(resolver, "CollectionContainer", "System.Windows.Data", 0); + KnownTypeTable[0x4f] = new TypeDeclaration(resolver, "CollectionView", "System.Windows.Data", 0); + KnownTypeTable[80] = new TypeDeclaration(resolver, "CollectionViewSource", "System.Windows.Data", 0); + KnownTypeTable[0x51] = new TypeDeclaration(resolver, "Color", "Microsoft.Win32", 2); + KnownTypeTable[0x52] = new TypeDeclaration(resolver, "ColorAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x53] = new TypeDeclaration(resolver, "ColorAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x54] = new TypeDeclaration(resolver, "ColorAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x55] = new TypeDeclaration(resolver, "ColorConvertedBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x56] = new TypeDeclaration(resolver, "ColorConvertedBitmapExtension", "System.Windows", 0); + KnownTypeTable[0x57] = new TypeDeclaration(resolver, "ColorConverter", "System.Windows.Media", 1); + KnownTypeTable[0x58] = new TypeDeclaration(resolver, "ColorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x59] = new TypeDeclaration(resolver, "ColorKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[90] = new TypeDeclaration(resolver, "ColumnDefinition", "System.Windows.Controls", 0); + KnownTypeTable[0x5b] = new TypeDeclaration(resolver, "CombinedGeometry", "System.Windows.Media", 1); + KnownTypeTable[0x5c] = new TypeDeclaration(resolver, "ComboBox", "System.Windows.Controls", 0); + KnownTypeTable[0x5d] = new TypeDeclaration(resolver, "ComboBoxItem", "System.Windows.Controls", 0); + KnownTypeTable[0x5e] = new TypeDeclaration(resolver, "CommandConverter", "System.Windows.Input", 0); + KnownTypeTable[0x5f] = new TypeDeclaration(resolver, "ComponentResourceKey", "System.Windows", 0, true); + KnownTypeTable[0x60] = new TypeDeclaration(resolver, "ComponentResourceKeyConverter", "System.Windows.Markup", 0); + KnownTypeTable[0x61] = new TypeDeclaration(resolver, "CompositionTarget", "System.Windows.Media", 1); + KnownTypeTable[0x62] = new TypeDeclaration(resolver, "Condition", "System.Windows", 0); + KnownTypeTable[0x63] = new TypeDeclaration(resolver, "ContainerVisual", "System.Windows.Media", 1); + KnownTypeTable[100] = new TypeDeclaration(resolver, "ContentControl", "System.Windows.Controls", 0); + KnownTypeTable[0x65] = new TypeDeclaration(resolver, "ContentElement", "System.Windows", 1); + KnownTypeTable[0x66] = new TypeDeclaration(resolver, "ContentPresenter", "System.Windows.Controls", 0); + KnownTypeTable[0x67] = new TypeDeclaration(resolver, "ContentPropertyAttribute", "System.Windows.Markup", 4); + KnownTypeTable[0x68] = new TypeDeclaration(resolver, "ContentWrapperAttribute", "System.Windows.Markup", 4); + KnownTypeTable[0x69] = new TypeDeclaration(resolver, "ContextMenu", "System.Windows.Controls", 0); + KnownTypeTable[0x6a] = new TypeDeclaration(resolver, "ContextMenuService", "System.Windows.Controls", 0); + KnownTypeTable[0x6b] = new TypeDeclaration(resolver, "Control", "System.Windows.Controls", 0); + KnownTypeTable[0x6d] = new TypeDeclaration(resolver, "ControllableStoryboardAction", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x6c] = new TypeDeclaration(resolver, "ControlTemplate", "System.Windows.Controls", 0); + KnownTypeTable[110] = new TypeDeclaration(resolver, "CornerRadius", "System.Windows", 0); + KnownTypeTable[0x6f] = new TypeDeclaration(resolver, "CornerRadiusConverter", "System.Windows", 0); + KnownTypeTable[0x70] = new TypeDeclaration(resolver, "CroppedBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x71] = new TypeDeclaration(resolver, "CultureInfo", "System.Globalization", 2); + KnownTypeTable[0x72] = new TypeDeclaration(resolver, "CultureInfoConverter", "System.ComponentModel", 3); + KnownTypeTable[0x73] = new TypeDeclaration(resolver, "CultureInfoIetfLanguageTagConverter", "System.Windows", 1); + KnownTypeTable[0x74] = new TypeDeclaration(resolver, "Cursor", "System.Windows.Input", 1); + KnownTypeTable[0x75] = new TypeDeclaration(resolver, "CursorConverter", "System.Windows.Input", 1); + KnownTypeTable[0x76] = new TypeDeclaration(resolver, "DashStyle", "System.Windows.Media", 1); + KnownTypeTable[0x77] = new TypeDeclaration(resolver, "DataChangedEventManager", "System.Windows.Data", 0); + KnownTypeTable[120] = new TypeDeclaration(resolver, "DataTemplate", "System.Windows", 0); + KnownTypeTable[0x79] = new TypeDeclaration(resolver, "DataTemplateKey", "System.Windows", 0, true); + KnownTypeTable[0x7a] = new TypeDeclaration(resolver, "DataTrigger", "System.Windows", 0); + KnownTypeTable[0x7b] = new TypeDeclaration(resolver, "DateTime", "System", 2); + KnownTypeTable[0x7c] = new TypeDeclaration(resolver, "DateTimeConverter", "System.ComponentModel", 3); + KnownTypeTable[0x7d] = new TypeDeclaration(resolver, "DateTimeConverter2", "System.Windows.Markup", 4); + KnownTypeTable[0x7e] = new TypeDeclaration(resolver, "Decimal", "System", 2); + KnownTypeTable[0x7f] = new TypeDeclaration(resolver, "DecimalAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x80] = new TypeDeclaration(resolver, "DecimalAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x81] = new TypeDeclaration(resolver, "DecimalAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[130] = new TypeDeclaration(resolver, "DecimalConverter", "System.ComponentModel", 3); + KnownTypeTable[0x83] = new TypeDeclaration(resolver, "DecimalKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x84] = new TypeDeclaration(resolver, "DecimalKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x85] = new TypeDeclaration(resolver, "Decorator", "System.Windows.Controls", 0); + KnownTypeTable[0x86] = new TypeDeclaration(resolver, "DefinitionBase", "System.Windows.Controls", 0); + KnownTypeTable[0x87] = new TypeDeclaration(resolver, "DependencyObject", "System.Windows", 4); + KnownTypeTable[0x88] = new TypeDeclaration(resolver, "DependencyProperty", "System.Windows", 4); + KnownTypeTable[0x89] = new TypeDeclaration(resolver, "DependencyPropertyConverter", "System.Windows.Markup", 0); + KnownTypeTable[0x8a] = new TypeDeclaration(resolver, "DialogResultConverter", "System.Windows", 0); + KnownTypeTable[0x8b] = new TypeDeclaration(resolver, "DiffuseMaterial", "System.Windows.Media.Media3D", 1); + KnownTypeTable[140] = new TypeDeclaration(resolver, "DirectionalLight", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x8d] = new TypeDeclaration(resolver, "DiscreteBooleanKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x8e] = new TypeDeclaration(resolver, "DiscreteByteKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x8f] = new TypeDeclaration(resolver, "DiscreteCharKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x90] = new TypeDeclaration(resolver, "DiscreteColorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x91] = new TypeDeclaration(resolver, "DiscreteDecimalKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x92] = new TypeDeclaration(resolver, "DiscreteDoubleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x93] = new TypeDeclaration(resolver, "DiscreteInt16KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x94] = new TypeDeclaration(resolver, "DiscreteInt32KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x95] = new TypeDeclaration(resolver, "DiscreteInt64KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[150] = new TypeDeclaration(resolver, "DiscreteMatrixKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x97] = new TypeDeclaration(resolver, "DiscreteObjectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x98] = new TypeDeclaration(resolver, "DiscretePoint3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x99] = new TypeDeclaration(resolver, "DiscretePointKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9a] = new TypeDeclaration(resolver, "DiscreteQuaternionKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9b] = new TypeDeclaration(resolver, "DiscreteRectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9c] = new TypeDeclaration(resolver, "DiscreteRotation3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9d] = new TypeDeclaration(resolver, "DiscreteSingleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9e] = new TypeDeclaration(resolver, "DiscreteSizeKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x9f] = new TypeDeclaration(resolver, "DiscreteStringKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[160] = new TypeDeclaration(resolver, "DiscreteThicknessKeyFrame", "System.Windows.Media.Animation", 0); + KnownTypeTable[0xa1] = new TypeDeclaration(resolver, "DiscreteVector3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xa2] = new TypeDeclaration(resolver, "DiscreteVectorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xa3] = new TypeDeclaration(resolver, "DockPanel", "System.Windows.Controls", 0); + KnownTypeTable[0xa4] = new TypeDeclaration(resolver, "DocumentPageView", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0xa5] = new TypeDeclaration(resolver, "DocumentReference", "System.Windows.Documents", 0); + KnownTypeTable[0xa6] = new TypeDeclaration(resolver, "DocumentViewer", "System.Windows.Controls", 0); + KnownTypeTable[0xa7] = new TypeDeclaration(resolver, "DocumentViewerBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0xa8] = new TypeDeclaration(resolver, "Double", "System", 2); + KnownTypeTable[0xa9] = new TypeDeclaration(resolver, "DoubleAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[170] = new TypeDeclaration(resolver, "DoubleAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xab] = new TypeDeclaration(resolver, "DoubleAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xac] = new TypeDeclaration(resolver, "DoubleAnimationUsingPath", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xad] = new TypeDeclaration(resolver, "DoubleCollection", "System.Windows.Media", 1); + KnownTypeTable[0xae] = new TypeDeclaration(resolver, "DoubleCollectionConverter", "System.Windows.Media", 1); + KnownTypeTable[0xaf] = new TypeDeclaration(resolver, "DoubleConverter", "System.ComponentModel", 3); + KnownTypeTable[0xb0] = new TypeDeclaration(resolver, "DoubleIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[0xb1] = new TypeDeclaration(resolver, "DoubleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xb2] = new TypeDeclaration(resolver, "DoubleKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0xb3] = new TypeDeclaration(resolver, "Drawing", "System.Windows.Media", 1); + KnownTypeTable[180] = new TypeDeclaration(resolver, "DrawingBrush", "System.Windows.Media", 1); + KnownTypeTable[0xb5] = new TypeDeclaration(resolver, "DrawingCollection", "System.Windows.Media", 1); + KnownTypeTable[0xb6] = new TypeDeclaration(resolver, "DrawingContext", "System.Windows.Media", 1); + KnownTypeTable[0xb7] = new TypeDeclaration(resolver, "DrawingGroup", "System.Windows.Media", 1); + KnownTypeTable[0xb8] = new TypeDeclaration(resolver, "DrawingImage", "System.Windows.Media", 1); + KnownTypeTable[0xb9] = new TypeDeclaration(resolver, "DrawingVisual", "System.Windows.Media", 1); + KnownTypeTable[0xba] = new TypeDeclaration(resolver, "DropShadowBitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0xbb] = new TypeDeclaration(resolver, "Duration", "System.Windows", 1); + KnownTypeTable[0xbc] = new TypeDeclaration(resolver, "DurationConverter", "System.Windows", 1); + KnownTypeTable[0xbd] = new TypeDeclaration(resolver, "DynamicResourceExtension", "System.Windows", 0, true); + KnownTypeTable[190] = new TypeDeclaration(resolver, "DynamicResourceExtensionConverter", "System.Windows", 0); + KnownTypeTable[0xbf] = new TypeDeclaration(resolver, "Ellipse", "System.Windows.Shapes", 0); + KnownTypeTable[0xc0] = new TypeDeclaration(resolver, "EllipseGeometry", "System.Windows.Media", 1); + KnownTypeTable[0xc1] = new TypeDeclaration(resolver, "EmbossBitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0xc2] = new TypeDeclaration(resolver, "EmissiveMaterial", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0xc3] = new TypeDeclaration(resolver, "EnumConverter", "System.ComponentModel", 3); + KnownTypeTable[0xc4] = new TypeDeclaration(resolver, "EventManager", "System.Windows", 1); + KnownTypeTable[0xc5] = new TypeDeclaration(resolver, "EventSetter", "System.Windows", 0); + KnownTypeTable[0xc6] = new TypeDeclaration(resolver, "EventTrigger", "System.Windows", 0); + KnownTypeTable[0xc7] = new TypeDeclaration(resolver, "Expander", "System.Windows.Controls", 0); + KnownTypeTable[200] = new TypeDeclaration(resolver, "Expression", "System.Windows", 4); + KnownTypeTable[0xc9] = new TypeDeclaration(resolver, "ExpressionConverter", "System.Windows", 4); + KnownTypeTable[0xca] = new TypeDeclaration(resolver, "Figure", "System.Windows.Documents", 0); + KnownTypeTable[0xcb] = new TypeDeclaration(resolver, "FigureLength", "System.Windows", 0); + KnownTypeTable[0xcc] = new TypeDeclaration(resolver, "FigureLengthConverter", "System.Windows", 0); + KnownTypeTable[0xcd] = new TypeDeclaration(resolver, "FixedDocument", "System.Windows.Documents", 0); + KnownTypeTable[0xce] = new TypeDeclaration(resolver, "FixedDocumentSequence", "System.Windows.Documents", 0); + KnownTypeTable[0xcf] = new TypeDeclaration(resolver, "FixedPage", "System.Windows.Documents", 0); + KnownTypeTable[0xd0] = new TypeDeclaration(resolver, "Floater", "System.Windows.Documents", 0); + KnownTypeTable[0xd1] = new TypeDeclaration(resolver, "FlowDocument", "System.Windows.Documents", 0); + KnownTypeTable[210] = new TypeDeclaration(resolver, "FlowDocumentPageViewer", "System.Windows.Controls", 0); + KnownTypeTable[0xd3] = new TypeDeclaration(resolver, "FlowDocumentReader", "System.Windows.Controls", 0); + KnownTypeTable[0xd4] = new TypeDeclaration(resolver, "FlowDocumentScrollViewer", "System.Windows.Controls", 0); + KnownTypeTable[0xd5] = new TypeDeclaration(resolver, "FocusManager", "System.Windows.Input", 1); + KnownTypeTable[0xd6] = new TypeDeclaration(resolver, "FontFamily", "System.Windows.Media", 1); + KnownTypeTable[0xd7] = new TypeDeclaration(resolver, "FontFamilyConverter", "System.Windows.Media", 1); + KnownTypeTable[0xd8] = new TypeDeclaration(resolver, "FontSizeConverter", "System.Windows", 0); + KnownTypeTable[0xd9] = new TypeDeclaration(resolver, "FontStretch", "System.Windows", 1); + KnownTypeTable[0xda] = new TypeDeclaration(resolver, "FontStretchConverter", "System.Windows", 1); + KnownTypeTable[0xdb] = new TypeDeclaration(resolver, "FontStyle", "System.Windows", 1); + KnownTypeTable[220] = new TypeDeclaration(resolver, "FontStyleConverter", "System.Windows", 1); + KnownTypeTable[0xdd] = new TypeDeclaration(resolver, "FontWeight", "System.Windows", 1); + KnownTypeTable[0xde] = new TypeDeclaration(resolver, "FontWeightConverter", "System.Windows", 1); + KnownTypeTable[0xdf] = new TypeDeclaration(resolver, "FormatConvertedBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0xe0] = new TypeDeclaration(resolver, "Frame", "System.Windows.Controls", 0); + KnownTypeTable[0xe1] = new TypeDeclaration(resolver, "FrameworkContentElement", "System.Windows", 0); + KnownTypeTable[0xe2] = new TypeDeclaration(resolver, "FrameworkElement", "System.Windows", 0); + KnownTypeTable[0xe3] = new TypeDeclaration(resolver, "FrameworkElementFactory", "System.Windows", 0); + KnownTypeTable[0xe4] = new TypeDeclaration(resolver, "FrameworkPropertyMetadata", "System.Windows", 0); + KnownTypeTable[0xe5] = new TypeDeclaration(resolver, "FrameworkPropertyMetadataOptions", "System.Windows", 0); + KnownTypeTable[230] = new TypeDeclaration(resolver, "FrameworkRichTextComposition", "System.Windows.Documents", 0); + KnownTypeTable[0xe7] = new TypeDeclaration(resolver, "FrameworkTemplate", "System.Windows", 0); + KnownTypeTable[0xe8] = new TypeDeclaration(resolver, "FrameworkTextComposition", "System.Windows.Documents", 0); + KnownTypeTable[0xe9] = new TypeDeclaration(resolver, "Freezable", "System.Windows", 4); + KnownTypeTable[0xea] = new TypeDeclaration(resolver, "GeneralTransform", "System.Windows.Media", 1); + KnownTypeTable[0xeb] = new TypeDeclaration(resolver, "GeneralTransformCollection", "System.Windows.Media", 1); + KnownTypeTable[0xec] = new TypeDeclaration(resolver, "GeneralTransformGroup", "System.Windows.Media", 1); + KnownTypeTable[0xed] = new TypeDeclaration(resolver, "Geometry", "System.Windows.Media", 1); + KnownTypeTable[0xee] = new TypeDeclaration(resolver, "Geometry3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0xef] = new TypeDeclaration(resolver, "GeometryCollection", "System.Windows.Media", 1); + KnownTypeTable[240] = new TypeDeclaration(resolver, "GeometryConverter", "System.Windows.Media", 1); + KnownTypeTable[0xf1] = new TypeDeclaration(resolver, "GeometryDrawing", "System.Windows.Media", 1); + KnownTypeTable[0xf2] = new TypeDeclaration(resolver, "GeometryGroup", "System.Windows.Media", 1); + KnownTypeTable[0xf3] = new TypeDeclaration(resolver, "GeometryModel3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0xf4] = new TypeDeclaration(resolver, "GestureRecognizer", "System.Windows.Ink", 1); + KnownTypeTable[0xf5] = new TypeDeclaration(resolver, "GifBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0xf6] = new TypeDeclaration(resolver, "GifBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0xf7] = new TypeDeclaration(resolver, "GlyphRun", "System.Windows.Media", 1); + KnownTypeTable[0xf8] = new TypeDeclaration(resolver, "GlyphRunDrawing", "System.Windows.Media", 1); + KnownTypeTable[250] = new TypeDeclaration(resolver, "Glyphs", "System.Windows.Documents", 0); + KnownTypeTable[0xf9] = new TypeDeclaration(resolver, "GlyphTypeface", "System.Windows.Media", 1); + KnownTypeTable[0xfb] = new TypeDeclaration(resolver, "GradientBrush", "System.Windows.Media", 1); + KnownTypeTable[0xfc] = new TypeDeclaration(resolver, "GradientStop", "System.Windows.Media", 1); + KnownTypeTable[0xfd] = new TypeDeclaration(resolver, "GradientStopCollection", "System.Windows.Media", 1); + KnownTypeTable[0xfe] = new TypeDeclaration(resolver, "Grid", "System.Windows.Controls", 0); + KnownTypeTable[0xff] = new TypeDeclaration(resolver, "GridLength", "System.Windows", 0); + KnownTypeTable[0x100] = new TypeDeclaration(resolver, "GridLengthConverter", "System.Windows", 0); + KnownTypeTable[0x101] = new TypeDeclaration(resolver, "GridSplitter", "System.Windows.Controls", 0); + KnownTypeTable[0x102] = new TypeDeclaration(resolver, "GridView", "System.Windows.Controls", 0); + KnownTypeTable[0x103] = new TypeDeclaration(resolver, "GridViewColumn", "System.Windows.Controls", 0); + KnownTypeTable[260] = new TypeDeclaration(resolver, "GridViewColumnHeader", "System.Windows.Controls", 0); + KnownTypeTable[0x105] = new TypeDeclaration(resolver, "GridViewHeaderRowPresenter", "System.Windows.Controls", 0); + KnownTypeTable[0x106] = new TypeDeclaration(resolver, "GridViewRowPresenter", "System.Windows.Controls", 0); + KnownTypeTable[0x107] = new TypeDeclaration(resolver, "GridViewRowPresenterBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x108] = new TypeDeclaration(resolver, "GroupBox", "System.Windows.Controls", 0); + KnownTypeTable[0x109] = new TypeDeclaration(resolver, "GroupItem", "System.Windows.Controls", 0); + KnownTypeTable[0x10a] = new TypeDeclaration(resolver, "Guid", "System", 2); + KnownTypeTable[0x10b] = new TypeDeclaration(resolver, "GuidConverter", "System.ComponentModel", 3); + KnownTypeTable[0x10c] = new TypeDeclaration(resolver, "GuidelineSet", "System.Windows.Media", 1); + KnownTypeTable[0x10d] = new TypeDeclaration(resolver, "HeaderedContentControl", "System.Windows.Controls", 0); + KnownTypeTable[270] = new TypeDeclaration(resolver, "HeaderedItemsControl", "System.Windows.Controls", 0); + KnownTypeTable[0x10f] = new TypeDeclaration(resolver, "HierarchicalDataTemplate", "System.Windows", 0); + KnownTypeTable[0x110] = new TypeDeclaration(resolver, "HostVisual", "System.Windows.Media", 1); + KnownTypeTable[0x111] = new TypeDeclaration(resolver, "Hyperlink", "System.Windows.Documents", 0); + KnownTypeTable[0x112] = new TypeDeclaration(resolver, "IAddChild", "System.Windows.Markup", 1); + KnownTypeTable[0x113] = new TypeDeclaration(resolver, "IAddChildInternal", "System.Windows.Markup", 1); + KnownTypeTable[0x114] = new TypeDeclaration(resolver, "ICommand", "System.Windows.Input", 1); + KnownTypeTable[0x115] = new TypeDeclaration(resolver, "IComponentConnector", "System.Windows.Markup", 4); + KnownTypeTable[280] = new TypeDeclaration(resolver, "IconBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x119] = new TypeDeclaration(resolver, "Image", "System.Windows.Controls", 0); + KnownTypeTable[0x11a] = new TypeDeclaration(resolver, "ImageBrush", "System.Windows.Media", 1); + KnownTypeTable[0x11b] = new TypeDeclaration(resolver, "ImageDrawing", "System.Windows.Media", 1); + KnownTypeTable[0x11c] = new TypeDeclaration(resolver, "ImageMetadata", "System.Windows.Media", 1); + KnownTypeTable[0x11d] = new TypeDeclaration(resolver, "ImageSource", "System.Windows.Media", 1); + KnownTypeTable[0x11e] = new TypeDeclaration(resolver, "ImageSourceConverter", "System.Windows.Media", 1); + KnownTypeTable[0x116] = new TypeDeclaration(resolver, "INameScope", "System.Windows.Markup", 4); + KnownTypeTable[0x120] = new TypeDeclaration(resolver, "InkCanvas", "System.Windows.Controls", 0); + KnownTypeTable[0x121] = new TypeDeclaration(resolver, "InkPresenter", "System.Windows.Controls", 0); + KnownTypeTable[290] = new TypeDeclaration(resolver, "Inline", "System.Windows.Documents", 0); + KnownTypeTable[0x123] = new TypeDeclaration(resolver, "InlineCollection", "System.Windows.Documents", 0); + KnownTypeTable[0x124] = new TypeDeclaration(resolver, "InlineUIContainer", "System.Windows.Documents", 0); + KnownTypeTable[0x11f] = new TypeDeclaration(resolver, "InPlaceBitmapMetadataWriter", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x125] = new TypeDeclaration(resolver, "InputBinding", "System.Windows.Input", 1); + KnownTypeTable[0x126] = new TypeDeclaration(resolver, "InputDevice", "System.Windows.Input", 1); + KnownTypeTable[0x127] = new TypeDeclaration(resolver, "InputLanguageManager", "System.Windows.Input", 1); + KnownTypeTable[0x128] = new TypeDeclaration(resolver, "InputManager", "System.Windows.Input", 1); + KnownTypeTable[0x129] = new TypeDeclaration(resolver, "InputMethod", "System.Windows.Input", 1); + KnownTypeTable[0x12a] = new TypeDeclaration(resolver, "InputScope", "System.Windows.Input", 1); + KnownTypeTable[0x12b] = new TypeDeclaration(resolver, "InputScopeConverter", "System.Windows.Input", 1); + KnownTypeTable[300] = new TypeDeclaration(resolver, "InputScopeName", "System.Windows.Input", 1); + KnownTypeTable[0x12d] = new TypeDeclaration(resolver, "InputScopeNameConverter", "System.Windows.Input", 1); + KnownTypeTable[0x12e] = new TypeDeclaration(resolver, "Int16", "System", 2); + KnownTypeTable[0x12f] = new TypeDeclaration(resolver, "Int16Animation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x130] = new TypeDeclaration(resolver, "Int16AnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x131] = new TypeDeclaration(resolver, "Int16AnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x132] = new TypeDeclaration(resolver, "Int16Converter", "System.ComponentModel", 3); + KnownTypeTable[0x133] = new TypeDeclaration(resolver, "Int16KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x134] = new TypeDeclaration(resolver, "Int16KeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x135] = new TypeDeclaration(resolver, "Int32", "System", 2); + KnownTypeTable[310] = new TypeDeclaration(resolver, "Int32Animation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x137] = new TypeDeclaration(resolver, "Int32AnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x138] = new TypeDeclaration(resolver, "Int32AnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x139] = new TypeDeclaration(resolver, "Int32Collection", "System.Windows.Media", 1); + KnownTypeTable[0x13a] = new TypeDeclaration(resolver, "Int32CollectionConverter", "System.Windows.Media", 1); + KnownTypeTable[0x13b] = new TypeDeclaration(resolver, "Int32Converter", "System.ComponentModel", 3); + KnownTypeTable[0x13c] = new TypeDeclaration(resolver, "Int32KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x13d] = new TypeDeclaration(resolver, "Int32KeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x13e] = new TypeDeclaration(resolver, "Int32Rect", "System.Windows", 4); + KnownTypeTable[0x13f] = new TypeDeclaration(resolver, "Int32RectConverter", "System.Windows", 4); + KnownTypeTable[320] = new TypeDeclaration(resolver, "Int64", "System", 2); + KnownTypeTable[0x141] = new TypeDeclaration(resolver, "Int64Animation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x142] = new TypeDeclaration(resolver, "Int64AnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x143] = new TypeDeclaration(resolver, "Int64AnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x144] = new TypeDeclaration(resolver, "Int64Converter", "System.ComponentModel", 3); + KnownTypeTable[0x145] = new TypeDeclaration(resolver, "Int64KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x146] = new TypeDeclaration(resolver, "Int64KeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x117] = new TypeDeclaration(resolver, "IStyleConnector", "System.Windows.Markup", 0); + KnownTypeTable[0x147] = new TypeDeclaration(resolver, "Italic", "System.Windows.Documents", 0); + KnownTypeTable[0x148] = new TypeDeclaration(resolver, "ItemCollection", "System.Windows.Controls", 0); + KnownTypeTable[0x149] = new TypeDeclaration(resolver, "ItemsControl", "System.Windows.Controls", 0); + KnownTypeTable[330] = new TypeDeclaration(resolver, "ItemsPanelTemplate", "System.Windows.Controls", 0); + KnownTypeTable[0x14b] = new TypeDeclaration(resolver, "ItemsPresenter", "System.Windows.Controls", 0); + KnownTypeTable[0x14c] = new TypeDeclaration(resolver, "JournalEntry", "System.Windows.Navigation", 0); + KnownTypeTable[0x14d] = new TypeDeclaration(resolver, "JournalEntryListConverter", "System.Windows.Navigation", 0); + KnownTypeTable[0x14e] = new TypeDeclaration(resolver, "JournalEntryUnifiedViewConverter", "System.Windows.Navigation", 0); + KnownTypeTable[0x14f] = new TypeDeclaration(resolver, "JpegBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x150] = new TypeDeclaration(resolver, "JpegBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x151] = new TypeDeclaration(resolver, "KeyBinding", "System.Windows.Input", 1); + KnownTypeTable[0x159] = new TypeDeclaration(resolver, "KeyboardDevice", "System.Windows.Input", 1); + KnownTypeTable[0x152] = new TypeDeclaration(resolver, "KeyConverter", "System.Windows.Input", 4); + KnownTypeTable[0x153] = new TypeDeclaration(resolver, "KeyGesture", "System.Windows.Input", 1); + KnownTypeTable[340] = new TypeDeclaration(resolver, "KeyGestureConverter", "System.Windows.Input", 1); + KnownTypeTable[0x155] = new TypeDeclaration(resolver, "KeySpline", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x156] = new TypeDeclaration(resolver, "KeySplineConverter", "System.Windows", 1); + KnownTypeTable[0x157] = new TypeDeclaration(resolver, "KeyTime", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x158] = new TypeDeclaration(resolver, "KeyTimeConverter", "System.Windows", 1); + KnownTypeTable[0x15a] = new TypeDeclaration(resolver, "Label", "System.Windows.Controls", 0); + KnownTypeTable[0x15b] = new TypeDeclaration(resolver, "LateBoundBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x15c] = new TypeDeclaration(resolver, "LengthConverter", "System.Windows", 0); + KnownTypeTable[0x15d] = new TypeDeclaration(resolver, "Light", "System.Windows.Media.Media3D", 1); + KnownTypeTable[350] = new TypeDeclaration(resolver, "Line", "System.Windows.Shapes", 0); + KnownTypeTable[0x162] = new TypeDeclaration(resolver, "LinearByteKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x163] = new TypeDeclaration(resolver, "LinearColorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x164] = new TypeDeclaration(resolver, "LinearDecimalKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x165] = new TypeDeclaration(resolver, "LinearDoubleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x166] = new TypeDeclaration(resolver, "LinearGradientBrush", "System.Windows.Media", 1); + KnownTypeTable[0x167] = new TypeDeclaration(resolver, "LinearInt16KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[360] = new TypeDeclaration(resolver, "LinearInt32KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x169] = new TypeDeclaration(resolver, "LinearInt64KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16a] = new TypeDeclaration(resolver, "LinearPoint3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16b] = new TypeDeclaration(resolver, "LinearPointKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16c] = new TypeDeclaration(resolver, "LinearQuaternionKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16d] = new TypeDeclaration(resolver, "LinearRectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16e] = new TypeDeclaration(resolver, "LinearRotation3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x16f] = new TypeDeclaration(resolver, "LinearSingleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x170] = new TypeDeclaration(resolver, "LinearSizeKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x171] = new TypeDeclaration(resolver, "LinearThicknessKeyFrame", "System.Windows.Media.Animation", 0); + KnownTypeTable[370] = new TypeDeclaration(resolver, "LinearVector3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x173] = new TypeDeclaration(resolver, "LinearVectorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x15f] = new TypeDeclaration(resolver, "LineBreak", "System.Windows.Documents", 0); + KnownTypeTable[0x160] = new TypeDeclaration(resolver, "LineGeometry", "System.Windows.Media", 1); + KnownTypeTable[0x161] = new TypeDeclaration(resolver, "LineSegment", "System.Windows.Media", 1); + KnownTypeTable[0x174] = new TypeDeclaration(resolver, "List", "System.Windows.Documents", 0); + KnownTypeTable[0x175] = new TypeDeclaration(resolver, "ListBox", "System.Windows.Controls", 0); + KnownTypeTable[0x176] = new TypeDeclaration(resolver, "ListBoxItem", "System.Windows.Controls", 0); + KnownTypeTable[0x177] = new TypeDeclaration(resolver, "ListCollectionView", "System.Windows.Data", 0); + KnownTypeTable[0x178] = new TypeDeclaration(resolver, "ListItem", "System.Windows.Documents", 0); + KnownTypeTable[0x179] = new TypeDeclaration(resolver, "ListView", "System.Windows.Controls", 0); + KnownTypeTable[0x17a] = new TypeDeclaration(resolver, "ListViewItem", "System.Windows.Controls", 0); + KnownTypeTable[0x17b] = new TypeDeclaration(resolver, "Localization", "System.Windows", 0); + KnownTypeTable[380] = new TypeDeclaration(resolver, "LostFocusEventManager", "System.Windows", 0); + KnownTypeTable[0x17d] = new TypeDeclaration(resolver, "MarkupExtension", "System.Windows.Markup", 4); + KnownTypeTable[0x17e] = new TypeDeclaration(resolver, "Material", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x17f] = new TypeDeclaration(resolver, "MaterialCollection", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x180] = new TypeDeclaration(resolver, "MaterialGroup", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x181] = new TypeDeclaration(resolver, "Matrix", "System.Windows.Media", 4); + KnownTypeTable[0x182] = new TypeDeclaration(resolver, "Matrix3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x183] = new TypeDeclaration(resolver, "Matrix3DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x184] = new TypeDeclaration(resolver, "MatrixAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x185] = new TypeDeclaration(resolver, "MatrixAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[390] = new TypeDeclaration(resolver, "MatrixAnimationUsingPath", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x187] = new TypeDeclaration(resolver, "MatrixCamera", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x188] = new TypeDeclaration(resolver, "MatrixConverter", "System.Windows.Media", 4); + KnownTypeTable[0x189] = new TypeDeclaration(resolver, "MatrixKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x18a] = new TypeDeclaration(resolver, "MatrixKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x18b] = new TypeDeclaration(resolver, "MatrixTransform", "System.Windows.Media", 1); + KnownTypeTable[0x18c] = new TypeDeclaration(resolver, "MatrixTransform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x18d] = new TypeDeclaration(resolver, "MediaClock", "System.Windows.Media", 1); + KnownTypeTable[0x18e] = new TypeDeclaration(resolver, "MediaElement", "System.Windows.Controls", 0); + KnownTypeTable[0x18f] = new TypeDeclaration(resolver, "MediaPlayer", "System.Windows.Media", 1); + KnownTypeTable[400] = new TypeDeclaration(resolver, "MediaTimeline", "System.Windows.Media", 1); + KnownTypeTable[0x191] = new TypeDeclaration(resolver, "Menu", "System.Windows.Controls", 0); + KnownTypeTable[0x192] = new TypeDeclaration(resolver, "MenuBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x193] = new TypeDeclaration(resolver, "MenuItem", "System.Windows.Controls", 0); + KnownTypeTable[0x194] = new TypeDeclaration(resolver, "MenuScrollingVisibilityConverter", "System.Windows.Controls", 0); + KnownTypeTable[0x195] = new TypeDeclaration(resolver, "MeshGeometry3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x196] = new TypeDeclaration(resolver, "Model3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x197] = new TypeDeclaration(resolver, "Model3DCollection", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x198] = new TypeDeclaration(resolver, "Model3DGroup", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x199] = new TypeDeclaration(resolver, "ModelVisual3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[410] = new TypeDeclaration(resolver, "ModifierKeysConverter", "System.Windows.Input", 4); + KnownTypeTable[0x19b] = new TypeDeclaration(resolver, "MouseActionConverter", "System.Windows.Input", 1); + KnownTypeTable[0x19c] = new TypeDeclaration(resolver, "MouseBinding", "System.Windows.Input", 1); + KnownTypeTable[0x19d] = new TypeDeclaration(resolver, "MouseDevice", "System.Windows.Input", 1); + KnownTypeTable[0x19e] = new TypeDeclaration(resolver, "MouseGesture", "System.Windows.Input", 1); + KnownTypeTable[0x19f] = new TypeDeclaration(resolver, "MouseGestureConverter", "System.Windows.Input", 1); + KnownTypeTable[0x1a0] = new TypeDeclaration(resolver, "MultiBinding", "System.Windows.Data", 0, false); + KnownTypeTable[0x1a1] = new TypeDeclaration(resolver, "MultiBindingExpression", "System.Windows.Data", 0); + KnownTypeTable[0x1a2] = new TypeDeclaration(resolver, "MultiDataTrigger", "System.Windows", 0); + KnownTypeTable[0x1a3] = new TypeDeclaration(resolver, "MultiTrigger", "System.Windows", 0); + KnownTypeTable[420] = new TypeDeclaration(resolver, "NameScope", "System.Windows", 0); + KnownTypeTable[0x1a5] = new TypeDeclaration(resolver, "NavigationWindow", "System.Windows.Navigation", 0); + KnownTypeTable[0x1a7] = new TypeDeclaration(resolver, "NullableBoolConverter", "System.Windows", 0); + KnownTypeTable[0x1a8] = new TypeDeclaration(resolver, "NullableConverter", "System.ComponentModel", 3); + KnownTypeTable[0x1a6] = new TypeDeclaration(resolver, "NullExtension", "System.Windows.Markup", 0, true); + KnownTypeTable[0x1a9] = new TypeDeclaration(resolver, "NumberSubstitution", "System.Windows.Media", 1); + KnownTypeTable[0x1aa] = new TypeDeclaration(resolver, "Object", "System", 2); + KnownTypeTable[0x1ab] = new TypeDeclaration(resolver, "ObjectAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1ac] = new TypeDeclaration(resolver, "ObjectAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1ad] = new TypeDeclaration(resolver, "ObjectDataProvider", "System.Windows.Data", 0); + KnownTypeTable[430] = new TypeDeclaration(resolver, "ObjectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1af] = new TypeDeclaration(resolver, "ObjectKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1b0] = new TypeDeclaration(resolver, "OrthographicCamera", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1b1] = new TypeDeclaration(resolver, "OuterGlowBitmapEffect", "System.Windows.Media.Effects", 1); + KnownTypeTable[0x1b2] = new TypeDeclaration(resolver, "Page", "System.Windows.Controls", 0); + KnownTypeTable[0x1b3] = new TypeDeclaration(resolver, "PageContent", "System.Windows.Documents", 0); + KnownTypeTable[0x1b4] = new TypeDeclaration(resolver, "PageFunctionBase", "System.Windows.Navigation", 0); + KnownTypeTable[0x1b5] = new TypeDeclaration(resolver, "Panel", "System.Windows.Controls", 0); + KnownTypeTable[0x1b6] = new TypeDeclaration(resolver, "Paragraph", "System.Windows.Documents", 0); + KnownTypeTable[0x1b7] = new TypeDeclaration(resolver, "ParallelTimeline", "System.Windows.Media.Animation", 1); + KnownTypeTable[440] = new TypeDeclaration(resolver, "ParserContext", "System.Windows.Markup", 0); + KnownTypeTable[0x1b9] = new TypeDeclaration(resolver, "PasswordBox", "System.Windows.Controls", 0); + KnownTypeTable[0x1ba] = new TypeDeclaration(resolver, "Path", "System.Windows.Shapes", 0); + KnownTypeTable[0x1bb] = new TypeDeclaration(resolver, "PathFigure", "System.Windows.Media", 1); + KnownTypeTable[0x1bc] = new TypeDeclaration(resolver, "PathFigureCollection", "System.Windows.Media", 1); + KnownTypeTable[0x1bd] = new TypeDeclaration(resolver, "PathFigureCollectionConverter", "System.Windows.Media", 1); + KnownTypeTable[0x1be] = new TypeDeclaration(resolver, "PathGeometry", "System.Windows.Media", 1); + KnownTypeTable[0x1bf] = new TypeDeclaration(resolver, "PathSegment", "System.Windows.Media", 1); + KnownTypeTable[0x1c0] = new TypeDeclaration(resolver, "PathSegmentCollection", "System.Windows.Media", 1); + KnownTypeTable[0x1c1] = new TypeDeclaration(resolver, "PauseStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[450] = new TypeDeclaration(resolver, "Pen", "System.Windows.Media", 1); + KnownTypeTable[0x1c3] = new TypeDeclaration(resolver, "PerspectiveCamera", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1c4] = new TypeDeclaration(resolver, "PixelFormat", "System.Windows.Media", 1); + KnownTypeTable[0x1c5] = new TypeDeclaration(resolver, "PixelFormatConverter", "System.Windows.Media", 1); + KnownTypeTable[0x1c6] = new TypeDeclaration(resolver, "PngBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x1c7] = new TypeDeclaration(resolver, "PngBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x1c8] = new TypeDeclaration(resolver, "Point", "System.Windows", 4); + KnownTypeTable[0x1c9] = new TypeDeclaration(resolver, "Point3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1ca] = new TypeDeclaration(resolver, "Point3DAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1cb] = new TypeDeclaration(resolver, "Point3DAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[460] = new TypeDeclaration(resolver, "Point3DAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1cd] = new TypeDeclaration(resolver, "Point3DCollection", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1ce] = new TypeDeclaration(resolver, "Point3DCollectionConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1cf] = new TypeDeclaration(resolver, "Point3DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1d0] = new TypeDeclaration(resolver, "Point3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1d1] = new TypeDeclaration(resolver, "Point3DKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1d2] = new TypeDeclaration(resolver, "Point4D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1d3] = new TypeDeclaration(resolver, "Point4DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1d4] = new TypeDeclaration(resolver, "PointAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1d5] = new TypeDeclaration(resolver, "PointAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[470] = new TypeDeclaration(resolver, "PointAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1d7] = new TypeDeclaration(resolver, "PointAnimationUsingPath", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1d8] = new TypeDeclaration(resolver, "PointCollection", "System.Windows.Media", 1); + KnownTypeTable[0x1d9] = new TypeDeclaration(resolver, "PointCollectionConverter", "System.Windows.Media", 1); + KnownTypeTable[0x1da] = new TypeDeclaration(resolver, "PointConverter", "System.Windows", 4); + KnownTypeTable[0x1db] = new TypeDeclaration(resolver, "PointIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[0x1dc] = new TypeDeclaration(resolver, "PointKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1dd] = new TypeDeclaration(resolver, "PointKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1de] = new TypeDeclaration(resolver, "PointLight", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1df] = new TypeDeclaration(resolver, "PointLightBase", "System.Windows.Media.Media3D", 1); + KnownTypeTable[480] = new TypeDeclaration(resolver, "PolyBezierSegment", "System.Windows.Media", 1); + KnownTypeTable[0x1e3] = new TypeDeclaration(resolver, "Polygon", "System.Windows.Shapes", 0); + KnownTypeTable[0x1e4] = new TypeDeclaration(resolver, "Polyline", "System.Windows.Shapes", 0); + KnownTypeTable[0x1e1] = new TypeDeclaration(resolver, "PolyLineSegment", "System.Windows.Media", 1); + KnownTypeTable[0x1e2] = new TypeDeclaration(resolver, "PolyQuadraticBezierSegment", "System.Windows.Media", 1); + KnownTypeTable[0x1e5] = new TypeDeclaration(resolver, "Popup", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x1e6] = new TypeDeclaration(resolver, "PresentationSource", "System.Windows", 1); + KnownTypeTable[0x1e7] = new TypeDeclaration(resolver, "PriorityBinding", "System.Windows.Data", 0, true); + KnownTypeTable[0x1e8] = new TypeDeclaration(resolver, "PriorityBindingExpression", "System.Windows.Data", 0); + KnownTypeTable[0x1e9] = new TypeDeclaration(resolver, "ProgressBar", "System.Windows.Controls", 0); + KnownTypeTable[490] = new TypeDeclaration(resolver, "ProjectionCamera", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1eb] = new TypeDeclaration(resolver, "PropertyPath", "System.Windows", 0); + KnownTypeTable[0x1ec] = new TypeDeclaration(resolver, "PropertyPathConverter", "System.Windows", 0); + KnownTypeTable[0x1ed] = new TypeDeclaration(resolver, "QuadraticBezierSegment", "System.Windows.Media", 1); + KnownTypeTable[0x1ee] = new TypeDeclaration(resolver, "Quaternion", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1ef] = new TypeDeclaration(resolver, "QuaternionAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1f0] = new TypeDeclaration(resolver, "QuaternionAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1f1] = new TypeDeclaration(resolver, "QuaternionAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1f2] = new TypeDeclaration(resolver, "QuaternionConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1f3] = new TypeDeclaration(resolver, "QuaternionKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[500] = new TypeDeclaration(resolver, "QuaternionKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1f5] = new TypeDeclaration(resolver, "QuaternionRotation3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1f6] = new TypeDeclaration(resolver, "RadialGradientBrush", "System.Windows.Media", 1); + KnownTypeTable[0x1f7] = new TypeDeclaration(resolver, "RadioButton", "System.Windows.Controls", 0); + KnownTypeTable[0x1f8] = new TypeDeclaration(resolver, "RangeBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x1f9] = new TypeDeclaration(resolver, "Rect", "System.Windows", 1); + KnownTypeTable[0x1fa] = new TypeDeclaration(resolver, "Rect3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x1fb] = new TypeDeclaration(resolver, "Rect3DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x202] = new TypeDeclaration(resolver, "Rectangle", "System.Windows.Shapes", 0); + KnownTypeTable[0x203] = new TypeDeclaration(resolver, "RectangleGeometry", "System.Windows.Media", 1); + KnownTypeTable[0x1fc] = new TypeDeclaration(resolver, "RectAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1fd] = new TypeDeclaration(resolver, "RectAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[510] = new TypeDeclaration(resolver, "RectAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x1ff] = new TypeDeclaration(resolver, "RectConverter", "System.Windows", 4); + KnownTypeTable[0x200] = new TypeDeclaration(resolver, "RectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x201] = new TypeDeclaration(resolver, "RectKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x204] = new TypeDeclaration(resolver, "RelativeSource", "System.Windows.Data", 0, true); + KnownTypeTable[0x205] = new TypeDeclaration(resolver, "RemoveStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x206] = new TypeDeclaration(resolver, "RenderOptions", "System.Windows.Media", 1); + KnownTypeTable[0x207] = new TypeDeclaration(resolver, "RenderTargetBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[520] = new TypeDeclaration(resolver, "RepeatBehavior", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x209] = new TypeDeclaration(resolver, "RepeatBehaviorConverter", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x20a] = new TypeDeclaration(resolver, "RepeatButton", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x20b] = new TypeDeclaration(resolver, "ResizeGrip", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x20c] = new TypeDeclaration(resolver, "ResourceDictionary", "System.Windows", 0); + KnownTypeTable[0x20d] = new TypeDeclaration(resolver, "ResourceKey", "System.Windows", 0, true); + KnownTypeTable[0x20e] = new TypeDeclaration(resolver, "ResumeStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x20f] = new TypeDeclaration(resolver, "RichTextBox", "System.Windows.Controls", 0); + KnownTypeTable[0x210] = new TypeDeclaration(resolver, "RotateTransform", "System.Windows.Media", 1); + KnownTypeTable[0x211] = new TypeDeclaration(resolver, "RotateTransform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[530] = new TypeDeclaration(resolver, "Rotation3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x213] = new TypeDeclaration(resolver, "Rotation3DAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x214] = new TypeDeclaration(resolver, "Rotation3DAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x215] = new TypeDeclaration(resolver, "Rotation3DAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x216] = new TypeDeclaration(resolver, "Rotation3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x217] = new TypeDeclaration(resolver, "Rotation3DKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x218] = new TypeDeclaration(resolver, "RoutedCommand", "System.Windows.Input", 1); + KnownTypeTable[0x219] = new TypeDeclaration(resolver, "RoutedEvent", "System.Windows", 1); + KnownTypeTable[0x21a] = new TypeDeclaration(resolver, "RoutedEventConverter", "System.Windows.Markup", 0); + KnownTypeTable[0x21b] = new TypeDeclaration(resolver, "RoutedUICommand", "System.Windows.Input", 1); + KnownTypeTable[540] = new TypeDeclaration(resolver, "RoutingStrategy", "System.Windows", 1); + KnownTypeTable[0x21d] = new TypeDeclaration(resolver, "RowDefinition", "System.Windows.Controls", 0); + KnownTypeTable[0x21e] = new TypeDeclaration(resolver, "Run", "System.Windows.Documents", 0); + KnownTypeTable[0x21f] = new TypeDeclaration(resolver, "RuntimeNamePropertyAttribute", "System.Windows.Markup", 4); + KnownTypeTable[0x220] = new TypeDeclaration(resolver, "SByte", "System", 2); + KnownTypeTable[0x221] = new TypeDeclaration(resolver, "SByteConverter", "System.ComponentModel", 3); + KnownTypeTable[0x222] = new TypeDeclaration(resolver, "ScaleTransform", "System.Windows.Media", 1); + KnownTypeTable[0x223] = new TypeDeclaration(resolver, "ScaleTransform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x224] = new TypeDeclaration(resolver, "ScrollBar", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x225] = new TypeDeclaration(resolver, "ScrollContentPresenter", "System.Windows.Controls", 0); + KnownTypeTable[550] = new TypeDeclaration(resolver, "ScrollViewer", "System.Windows.Controls", 0); + KnownTypeTable[0x227] = new TypeDeclaration(resolver, "Section", "System.Windows.Documents", 0); + KnownTypeTable[0x228] = new TypeDeclaration(resolver, "SeekStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x229] = new TypeDeclaration(resolver, "Selector", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x22a] = new TypeDeclaration(resolver, "Separator", "System.Windows.Controls", 0); + KnownTypeTable[0x22b] = new TypeDeclaration(resolver, "SetStoryboardSpeedRatio", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x22c] = new TypeDeclaration(resolver, "Setter", "System.Windows", 0); + KnownTypeTable[0x22d] = new TypeDeclaration(resolver, "SetterBase", "System.Windows", 0); + KnownTypeTable[0x22e] = new TypeDeclaration(resolver, "Shape", "System.Windows.Shapes", 0); + KnownTypeTable[0x22f] = new TypeDeclaration(resolver, "Single", "System", 2); + KnownTypeTable[560] = new TypeDeclaration(resolver, "SingleAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x231] = new TypeDeclaration(resolver, "SingleAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x232] = new TypeDeclaration(resolver, "SingleAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x233] = new TypeDeclaration(resolver, "SingleConverter", "System.ComponentModel", 3); + KnownTypeTable[0x234] = new TypeDeclaration(resolver, "SingleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x235] = new TypeDeclaration(resolver, "SingleKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x236] = new TypeDeclaration(resolver, "Size", "System.Windows", 4); + KnownTypeTable[0x237] = new TypeDeclaration(resolver, "Size3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x238] = new TypeDeclaration(resolver, "Size3DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x239] = new TypeDeclaration(resolver, "SizeAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[570] = new TypeDeclaration(resolver, "SizeAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x23b] = new TypeDeclaration(resolver, "SizeAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x23c] = new TypeDeclaration(resolver, "SizeConverter", "System.Windows", 4); + KnownTypeTable[0x23d] = new TypeDeclaration(resolver, "SizeKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x23e] = new TypeDeclaration(resolver, "SizeKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x23f] = new TypeDeclaration(resolver, "SkewTransform", "System.Windows.Media", 1); + KnownTypeTable[0x240] = new TypeDeclaration(resolver, "SkipStoryboardToFill", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x241] = new TypeDeclaration(resolver, "Slider", "System.Windows.Controls", 0); + KnownTypeTable[0x242] = new TypeDeclaration(resolver, "SolidColorBrush", "System.Windows.Media", 1); + KnownTypeTable[0x243] = new TypeDeclaration(resolver, "SoundPlayerAction", "System.Windows.Controls", 0); + KnownTypeTable[580] = new TypeDeclaration(resolver, "Span", "System.Windows.Documents", 0); + KnownTypeTable[0x245] = new TypeDeclaration(resolver, "SpecularMaterial", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x246] = new TypeDeclaration(resolver, "SpellCheck", "System.Windows.Controls", 0); + KnownTypeTable[0x247] = new TypeDeclaration(resolver, "SplineByteKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x248] = new TypeDeclaration(resolver, "SplineColorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x249] = new TypeDeclaration(resolver, "SplineDecimalKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x24a] = new TypeDeclaration(resolver, "SplineDoubleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x24b] = new TypeDeclaration(resolver, "SplineInt16KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x24c] = new TypeDeclaration(resolver, "SplineInt32KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x24d] = new TypeDeclaration(resolver, "SplineInt64KeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[590] = new TypeDeclaration(resolver, "SplinePoint3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x24f] = new TypeDeclaration(resolver, "SplinePointKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x250] = new TypeDeclaration(resolver, "SplineQuaternionKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x251] = new TypeDeclaration(resolver, "SplineRectKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x252] = new TypeDeclaration(resolver, "SplineRotation3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x253] = new TypeDeclaration(resolver, "SplineSingleKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x254] = new TypeDeclaration(resolver, "SplineSizeKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x255] = new TypeDeclaration(resolver, "SplineThicknessKeyFrame", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x256] = new TypeDeclaration(resolver, "SplineVector3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x257] = new TypeDeclaration(resolver, "SplineVectorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[600] = new TypeDeclaration(resolver, "SpotLight", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x259] = new TypeDeclaration(resolver, "StackPanel", "System.Windows.Controls", 0); + KnownTypeTable[0x25a] = new TypeDeclaration(resolver, "StaticExtension", "System.Windows.Markup", 0); + KnownTypeTable[0x25b] = new TypeDeclaration(resolver, "StaticResourceExtension", "System.Windows", 0, true); + KnownTypeTable[0x25c] = new TypeDeclaration(resolver, "StatusBar", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x25d] = new TypeDeclaration(resolver, "StatusBarItem", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x25e] = new TypeDeclaration(resolver, "StickyNoteControl", "System.Windows.Controls", 0); + KnownTypeTable[0x25f] = new TypeDeclaration(resolver, "StopStoryboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x260] = new TypeDeclaration(resolver, "Storyboard", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x261] = new TypeDeclaration(resolver, "StreamGeometry", "System.Windows.Media", 1); + KnownTypeTable[610] = new TypeDeclaration(resolver, "StreamGeometryContext", "System.Windows.Media", 1); + KnownTypeTable[0x263] = new TypeDeclaration(resolver, "StreamResourceInfo", "System.Windows.Resources", 0); + KnownTypeTable[0x264] = new TypeDeclaration(resolver, "String", "System", 2); + KnownTypeTable[0x265] = new TypeDeclaration(resolver, "StringAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x266] = new TypeDeclaration(resolver, "StringAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x267] = new TypeDeclaration(resolver, "StringConverter", "System.ComponentModel", 3); + KnownTypeTable[0x268] = new TypeDeclaration(resolver, "StringKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x269] = new TypeDeclaration(resolver, "StringKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x26a] = new TypeDeclaration(resolver, "StrokeCollection", "System.Windows.Ink", 1); + KnownTypeTable[0x26b] = new TypeDeclaration(resolver, "StrokeCollectionConverter", "System.Windows", 1); + KnownTypeTable[620] = new TypeDeclaration(resolver, "Style", "System.Windows", 0); + KnownTypeTable[0x26d] = new TypeDeclaration(resolver, "Stylus", "System.Windows.Input", 1); + KnownTypeTable[0x26e] = new TypeDeclaration(resolver, "StylusDevice", "System.Windows.Input", 1); + KnownTypeTable[0x26f] = new TypeDeclaration(resolver, "TabControl", "System.Windows.Controls", 0); + KnownTypeTable[0x270] = new TypeDeclaration(resolver, "TabItem", "System.Windows.Controls", 0); + KnownTypeTable[0x272] = new TypeDeclaration(resolver, "Table", "System.Windows.Documents", 0); + KnownTypeTable[0x273] = new TypeDeclaration(resolver, "TableCell", "System.Windows.Documents", 0); + KnownTypeTable[0x274] = new TypeDeclaration(resolver, "TableColumn", "System.Windows.Documents", 0); + KnownTypeTable[0x275] = new TypeDeclaration(resolver, "TableRow", "System.Windows.Documents", 0); + KnownTypeTable[630] = new TypeDeclaration(resolver, "TableRowGroup", "System.Windows.Documents", 0); + KnownTypeTable[0x277] = new TypeDeclaration(resolver, "TabletDevice", "System.Windows.Input", 1); + KnownTypeTable[0x271] = new TypeDeclaration(resolver, "TabPanel", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x278] = new TypeDeclaration(resolver, "TemplateBindingExpression", "System.Windows", 0); + KnownTypeTable[0x279] = new TypeDeclaration(resolver, "TemplateBindingExpressionConverter", "System.Windows", 0); + KnownTypeTable[0x27a] = new TypeDeclaration(resolver, "TemplateBindingExtension", "System.Windows", 0); + KnownTypeTable[0x27b] = new TypeDeclaration(resolver, "TemplateBindingExtensionConverter", "System.Windows", 0); + KnownTypeTable[0x27c] = new TypeDeclaration(resolver, "TemplateKey", "System.Windows", 0, true); + KnownTypeTable[0x27d] = new TypeDeclaration(resolver, "TemplateKeyConverter", "System.Windows.Markup", 0); + KnownTypeTable[0x27e] = new TypeDeclaration(resolver, "TextBlock", "System.Windows.Controls", 0); + KnownTypeTable[0x27f] = new TypeDeclaration(resolver, "TextBox", "System.Windows.Controls", 0); + KnownTypeTable[640] = new TypeDeclaration(resolver, "TextBoxBase", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x281] = new TypeDeclaration(resolver, "TextComposition", "System.Windows.Input", 1); + KnownTypeTable[0x282] = new TypeDeclaration(resolver, "TextCompositionManager", "System.Windows.Input", 1); + KnownTypeTable[0x283] = new TypeDeclaration(resolver, "TextDecoration", "System.Windows", 1); + KnownTypeTable[0x284] = new TypeDeclaration(resolver, "TextDecorationCollection", "System.Windows", 1); + KnownTypeTable[0x285] = new TypeDeclaration(resolver, "TextDecorationCollectionConverter", "System.Windows", 1); + KnownTypeTable[0x286] = new TypeDeclaration(resolver, "TextEffect", "System.Windows.Media", 1); + KnownTypeTable[0x287] = new TypeDeclaration(resolver, "TextEffectCollection", "System.Windows.Media", 1); + KnownTypeTable[0x288] = new TypeDeclaration(resolver, "TextElement", "System.Windows.Documents", 0); + KnownTypeTable[0x289] = new TypeDeclaration(resolver, "TextSearch", "System.Windows.Controls", 0); + KnownTypeTable[650] = new TypeDeclaration(resolver, "ThemeDictionaryExtension", "System.Windows", 0, true); + KnownTypeTable[0x28b] = new TypeDeclaration(resolver, "Thickness", "System.Windows", 0); + KnownTypeTable[0x28c] = new TypeDeclaration(resolver, "ThicknessAnimation", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x28d] = new TypeDeclaration(resolver, "ThicknessAnimationBase", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x28e] = new TypeDeclaration(resolver, "ThicknessAnimationUsingKeyFrames", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x28f] = new TypeDeclaration(resolver, "ThicknessConverter", "System.Windows", 0); + KnownTypeTable[0x290] = new TypeDeclaration(resolver, "ThicknessKeyFrame", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x291] = new TypeDeclaration(resolver, "ThicknessKeyFrameCollection", "System.Windows.Media.Animation", 0); + KnownTypeTable[0x292] = new TypeDeclaration(resolver, "Thumb", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x293] = new TypeDeclaration(resolver, "TickBar", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[660] = new TypeDeclaration(resolver, "TiffBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x295] = new TypeDeclaration(resolver, "TiffBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x296] = new TypeDeclaration(resolver, "TileBrush", "System.Windows.Media", 1); + KnownTypeTable[0x299] = new TypeDeclaration(resolver, "Timeline", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x29a] = new TypeDeclaration(resolver, "TimelineCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x29b] = new TypeDeclaration(resolver, "TimelineGroup", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x297] = new TypeDeclaration(resolver, "TimeSpan", "System", 2); + KnownTypeTable[0x298] = new TypeDeclaration(resolver, "TimeSpanConverter", "System.ComponentModel", 3); + KnownTypeTable[0x29c] = new TypeDeclaration(resolver, "ToggleButton", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x29d] = new TypeDeclaration(resolver, "ToolBar", "System.Windows.Controls", 0); + KnownTypeTable[670] = new TypeDeclaration(resolver, "ToolBarOverflowPanel", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x29f] = new TypeDeclaration(resolver, "ToolBarPanel", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x2a0] = new TypeDeclaration(resolver, "ToolBarTray", "System.Windows.Controls", 0); + KnownTypeTable[0x2a1] = new TypeDeclaration(resolver, "ToolTip", "System.Windows.Controls", 0); + KnownTypeTable[0x2a2] = new TypeDeclaration(resolver, "ToolTipService", "System.Windows.Controls", 0); + KnownTypeTable[0x2a3] = new TypeDeclaration(resolver, "Track", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x2a4] = new TypeDeclaration(resolver, "Transform", "System.Windows.Media", 1); + KnownTypeTable[0x2a5] = new TypeDeclaration(resolver, "Transform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2a6] = new TypeDeclaration(resolver, "Transform3DCollection", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2a7] = new TypeDeclaration(resolver, "Transform3DGroup", "System.Windows.Media.Media3D", 1); + KnownTypeTable[680] = new TypeDeclaration(resolver, "TransformCollection", "System.Windows.Media", 1); + KnownTypeTable[0x2a9] = new TypeDeclaration(resolver, "TransformConverter", "System.Windows.Media", 1); + KnownTypeTable[0x2ab] = new TypeDeclaration(resolver, "TransformedBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x2aa] = new TypeDeclaration(resolver, "TransformGroup", "System.Windows.Media", 1); + KnownTypeTable[0x2ac] = new TypeDeclaration(resolver, "TranslateTransform", "System.Windows.Media", 1); + KnownTypeTable[0x2ad] = new TypeDeclaration(resolver, "TranslateTransform3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2ae] = new TypeDeclaration(resolver, "TreeView", "System.Windows.Controls", 0); + KnownTypeTable[0x2af] = new TypeDeclaration(resolver, "TreeViewItem", "System.Windows.Controls", 0); + KnownTypeTable[0x2b0] = new TypeDeclaration(resolver, "Trigger", "System.Windows", 0); + KnownTypeTable[0x2b1] = new TypeDeclaration(resolver, "TriggerAction", "System.Windows", 0); + KnownTypeTable[690] = new TypeDeclaration(resolver, "TriggerBase", "System.Windows", 0); + KnownTypeTable[0x2b3] = new TypeDeclaration(resolver, "TypeExtension", "System.Windows.Markup", 0, true); + KnownTypeTable[0x2b4] = new TypeDeclaration(resolver, "TypeTypeConverter", "System.Net.Configuration", 3); + KnownTypeTable[0x2b5] = new TypeDeclaration(resolver, "Typography", "System.Windows.Documents", 0); + KnownTypeTable[0x2b6] = new TypeDeclaration(resolver, "UIElement", "System.Windows", 1); + KnownTypeTable[0x2b7] = new TypeDeclaration(resolver, "UInt16", "System", 2); + KnownTypeTable[0x2b8] = new TypeDeclaration(resolver, "UInt16Converter", "System.ComponentModel", 3); + KnownTypeTable[0x2b9] = new TypeDeclaration(resolver, "UInt32", "System", 2); + KnownTypeTable[0x2ba] = new TypeDeclaration(resolver, "UInt32Converter", "System.ComponentModel", 3); + KnownTypeTable[0x2bb] = new TypeDeclaration(resolver, "UInt64", "System", 2); + KnownTypeTable[700] = new TypeDeclaration(resolver, "UInt64Converter", "System.ComponentModel", 3); + KnownTypeTable[0x2be] = new TypeDeclaration(resolver, "Underline", "System.Windows.Documents", 0); + KnownTypeTable[0x2bf] = new TypeDeclaration(resolver, "UniformGrid", "System.Windows.Controls.Primitives", 0); + KnownTypeTable[0x2c0] = new TypeDeclaration(resolver, "Uri", "System", 3); + KnownTypeTable[0x2c1] = new TypeDeclaration(resolver, "UriTypeConverter", "System", 3); + KnownTypeTable[0x2c2] = new TypeDeclaration(resolver, "UserControl", "System.Windows.Controls", 0); + KnownTypeTable[0x2bd] = new TypeDeclaration(resolver, "UShortIListConverter", "System.Windows.Media.Converters", 1); + KnownTypeTable[0x2c3] = new TypeDeclaration(resolver, "Validation", "System.Windows.Controls", 0); + KnownTypeTable[0x2c4] = new TypeDeclaration(resolver, "Vector", "System.Windows", 1); + KnownTypeTable[0x2c5] = new TypeDeclaration(resolver, "Vector3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[710] = new TypeDeclaration(resolver, "Vector3DAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2c7] = new TypeDeclaration(resolver, "Vector3DAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2c8] = new TypeDeclaration(resolver, "Vector3DAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2c9] = new TypeDeclaration(resolver, "Vector3DCollection", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2ca] = new TypeDeclaration(resolver, "Vector3DCollectionConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2cb] = new TypeDeclaration(resolver, "Vector3DConverter", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2cc] = new TypeDeclaration(resolver, "Vector3DKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2cd] = new TypeDeclaration(resolver, "Vector3DKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2ce] = new TypeDeclaration(resolver, "VectorAnimation", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2cf] = new TypeDeclaration(resolver, "VectorAnimationBase", "System.Windows.Media.Animation", 1); + KnownTypeTable[720] = new TypeDeclaration(resolver, "VectorAnimationUsingKeyFrames", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2d1] = new TypeDeclaration(resolver, "VectorCollection", "System.Windows.Media", 1); + KnownTypeTable[0x2d2] = new TypeDeclaration(resolver, "VectorCollectionConverter", "System.Windows.Media", 1); + KnownTypeTable[0x2d3] = new TypeDeclaration(resolver, "VectorConverter", "System.Windows", 4); + KnownTypeTable[0x2d4] = new TypeDeclaration(resolver, "VectorKeyFrame", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2d5] = new TypeDeclaration(resolver, "VectorKeyFrameCollection", "System.Windows.Media.Animation", 1); + KnownTypeTable[0x2d6] = new TypeDeclaration(resolver, "VideoDrawing", "System.Windows.Media", 1); + KnownTypeTable[0x2d7] = new TypeDeclaration(resolver, "ViewBase", "System.Windows.Controls", 0); + KnownTypeTable[0x2d8] = new TypeDeclaration(resolver, "Viewbox", "System.Windows.Controls", 0); + KnownTypeTable[0x2d9] = new TypeDeclaration(resolver, "Viewport3D", "System.Windows.Controls", 0); + KnownTypeTable[730] = new TypeDeclaration(resolver, "Viewport3DVisual", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2db] = new TypeDeclaration(resolver, "VirtualizingPanel", "System.Windows.Controls", 0); + KnownTypeTable[0x2dc] = new TypeDeclaration(resolver, "VirtualizingStackPanel", "System.Windows.Controls", 0); + KnownTypeTable[0x2dd] = new TypeDeclaration(resolver, "Visual", "System.Windows.Media", 1); + KnownTypeTable[0x2de] = new TypeDeclaration(resolver, "Visual3D", "System.Windows.Media.Media3D", 1); + KnownTypeTable[0x2df] = new TypeDeclaration(resolver, "VisualBrush", "System.Windows.Media", 1); + KnownTypeTable[0x2e0] = new TypeDeclaration(resolver, "VisualTarget", "System.Windows.Media", 1); + KnownTypeTable[0x2e1] = new TypeDeclaration(resolver, "WeakEventManager", "System.Windows", 4); + KnownTypeTable[0x2e2] = new TypeDeclaration(resolver, "WhitespaceSignificantCollectionAttribute", "System.Windows.Markup", 4); + KnownTypeTable[0x2e3] = new TypeDeclaration(resolver, "Window", "System.Windows", 0); + KnownTypeTable[740] = new TypeDeclaration(resolver, "WmpBitmapDecoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x2e5] = new TypeDeclaration(resolver, "WmpBitmapEncoder", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x2e6] = new TypeDeclaration(resolver, "WrapPanel", "System.Windows.Controls", 0); + KnownTypeTable[0x2e7] = new TypeDeclaration(resolver, "WriteableBitmap", "System.Windows.Media.Imaging", 1); + KnownTypeTable[0x2e8] = new TypeDeclaration(resolver, "XamlBrushSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2e9] = new TypeDeclaration(resolver, "XamlInt32CollectionSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2ea] = new TypeDeclaration(resolver, "XamlPathDataSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2eb] = new TypeDeclaration(resolver, "XamlPoint3DCollectionSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2ec] = new TypeDeclaration(resolver, "XamlPointCollectionSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2ed] = new TypeDeclaration(resolver, "XamlReader", "System.Windows.Markup", 0); + KnownTypeTable[750] = new TypeDeclaration(resolver, "XamlStyleSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2ef] = new TypeDeclaration(resolver, "XamlTemplateSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2f0] = new TypeDeclaration(resolver, "XamlVector3DCollectionSerializer", "System.Windows.Markup", 0); + KnownTypeTable[0x2f1] = new TypeDeclaration(resolver, "XamlWriter", "System.Windows.Markup", 0); + KnownTypeTable[0x2f2] = new TypeDeclaration(resolver, "XmlDataProvider", "System.Windows.Data", 0); + KnownTypeTable[0x2f3] = new TypeDeclaration(resolver, "XmlLangPropertyAttribute", "System.Windows.Markup", 4); + KnownTypeTable[0x2f4] = new TypeDeclaration(resolver, "XmlLanguage", "System.Windows.Markup", 1); + KnownTypeTable[0x2f5] = new TypeDeclaration(resolver, "XmlLanguageConverter", "System.Windows.Markup", 1); + KnownTypeTable[0x2f6] = new TypeDeclaration(resolver, "XmlNamespaceMapping", "System.Windows.Data", 0); + KnownTypeTable[0x2f7] = new TypeDeclaration(resolver, "ZoomPercentageConverter", "System.Windows.Documents", 0); + KnownPropertyTable = new PropertyDeclaration[0x10d]; + KnownPropertyTable[1] = new PropertyDeclaration("Text", KnownTypeTable[1]); + KnownPropertyTable[2] = new PropertyDeclaration("Storyboard", KnownTypeTable[0x11]); + KnownPropertyTable[3] = new PropertyDeclaration("Children", KnownTypeTable[0x1c]); + KnownPropertyTable[4] = new PropertyDeclaration("Background", KnownTypeTable[50]); + KnownPropertyTable[5] = new PropertyDeclaration("BorderBrush", KnownTypeTable[50]); + KnownPropertyTable[6] = new PropertyDeclaration("BorderThickness", KnownTypeTable[50]); + KnownPropertyTable[7] = new PropertyDeclaration("Command", KnownTypeTable[0x38]); + KnownPropertyTable[8] = new PropertyDeclaration("CommandParameter", KnownTypeTable[0x38]); + KnownPropertyTable[9] = new PropertyDeclaration("CommandTarget", KnownTypeTable[0x38]); + KnownPropertyTable[10] = new PropertyDeclaration("IsPressed", KnownTypeTable[0x38]); + KnownPropertyTable[11] = new PropertyDeclaration("MaxWidth", KnownTypeTable[90]); + KnownPropertyTable[12] = new PropertyDeclaration("MinWidth", KnownTypeTable[90]); + KnownPropertyTable[13] = new PropertyDeclaration("Width", KnownTypeTable[90]); + KnownPropertyTable[14] = new PropertyDeclaration("Content", KnownTypeTable[100]); + KnownPropertyTable[15] = new PropertyDeclaration("ContentTemplate", KnownTypeTable[100]); + KnownPropertyTable[0x10] = new PropertyDeclaration("ContentTemplateSelector", KnownTypeTable[100]); + KnownPropertyTable[0x11] = new PropertyDeclaration("HasContent", KnownTypeTable[100]); + KnownPropertyTable[0x12] = new PropertyDeclaration("Focusable", KnownTypeTable[0x65]); + KnownPropertyTable[0x13] = new PropertyDeclaration("Content", KnownTypeTable[0x66]); + KnownPropertyTable[20] = new PropertyDeclaration("ContentSource", KnownTypeTable[0x66]); + KnownPropertyTable[0x15] = new PropertyDeclaration("ContentTemplate", KnownTypeTable[0x66]); + KnownPropertyTable[0x16] = new PropertyDeclaration("ContentTemplateSelector", KnownTypeTable[0x66]); + KnownPropertyTable[0x17] = new PropertyDeclaration("RecognizesAccessKey", KnownTypeTable[0x66]); + KnownPropertyTable[0x18] = new PropertyDeclaration("Background", KnownTypeTable[0x6b]); + KnownPropertyTable[0x19] = new PropertyDeclaration("BorderBrush", KnownTypeTable[0x6b]); + KnownPropertyTable[0x1a] = new PropertyDeclaration("BorderThickness", KnownTypeTable[0x6b]); + KnownPropertyTable[0x1b] = new PropertyDeclaration("FontFamily", KnownTypeTable[0x6b]); + KnownPropertyTable[0x1c] = new PropertyDeclaration("FontSize", KnownTypeTable[0x6b]); + KnownPropertyTable[0x1d] = new PropertyDeclaration("FontStretch", KnownTypeTable[0x6b]); + KnownPropertyTable[30] = new PropertyDeclaration("FontStyle", KnownTypeTable[0x6b]); + KnownPropertyTable[0x1f] = new PropertyDeclaration("FontWeight", KnownTypeTable[0x6b]); + KnownPropertyTable[0x20] = new PropertyDeclaration("Foreground", KnownTypeTable[0x6b]); + KnownPropertyTable[0x21] = new PropertyDeclaration("HorizontalContentAlignment", KnownTypeTable[0x6b]); + KnownPropertyTable[0x22] = new PropertyDeclaration("IsTabStop", KnownTypeTable[0x6b]); + KnownPropertyTable[0x23] = new PropertyDeclaration("Padding", KnownTypeTable[0x6b]); + KnownPropertyTable[0x24] = new PropertyDeclaration("TabIndex", KnownTypeTable[0x6b]); + KnownPropertyTable[0x25] = new PropertyDeclaration("Template", KnownTypeTable[0x6b]); + KnownPropertyTable[0x26] = new PropertyDeclaration("VerticalContentAlignment", KnownTypeTable[0x6b]); + KnownPropertyTable[0x27] = new PropertyDeclaration("Dock", KnownTypeTable[0xa3]); + KnownPropertyTable[40] = new PropertyDeclaration("LastChildFill", KnownTypeTable[0xa3]); + KnownPropertyTable[0x29] = new PropertyDeclaration("Document", KnownTypeTable[0xa7]); + KnownPropertyTable[0x2a] = new PropertyDeclaration("Children", KnownTypeTable[0xb7]); + KnownPropertyTable[0x2b] = new PropertyDeclaration("Document", KnownTypeTable[0xd3]); + KnownPropertyTable[0x2c] = new PropertyDeclaration("Document", KnownTypeTable[0xd4]); + KnownPropertyTable[0x2d] = new PropertyDeclaration("Style", KnownTypeTable[0xe1]); + KnownPropertyTable[0x2e] = new PropertyDeclaration("FlowDirection", KnownTypeTable[0xe2]); + KnownPropertyTable[0x2f] = new PropertyDeclaration("Height", KnownTypeTable[0xe2]); + KnownPropertyTable[0x30] = new PropertyDeclaration("HorizontalAlignment", KnownTypeTable[0xe2]); + KnownPropertyTable[0x31] = new PropertyDeclaration("Margin", KnownTypeTable[0xe2]); + KnownPropertyTable[50] = new PropertyDeclaration("MaxHeight", KnownTypeTable[0xe2]); + KnownPropertyTable[0x33] = new PropertyDeclaration("MaxWidth", KnownTypeTable[0xe2]); + KnownPropertyTable[0x34] = new PropertyDeclaration("MinHeight", KnownTypeTable[0xe2]); + KnownPropertyTable[0x35] = new PropertyDeclaration("MinWidth", KnownTypeTable[0xe2]); + KnownPropertyTable[0x36] = new PropertyDeclaration("Name", KnownTypeTable[0xe2]); + KnownPropertyTable[0x37] = new PropertyDeclaration("Style", KnownTypeTable[0xe2]); + KnownPropertyTable[0x38] = new PropertyDeclaration("VerticalAlignment", KnownTypeTable[0xe2]); + KnownPropertyTable[0x39] = new PropertyDeclaration("Width", KnownTypeTable[0xe2]); + KnownPropertyTable[0x3a] = new PropertyDeclaration("Children", KnownTypeTable[0xec]); + KnownPropertyTable[0x3b] = new PropertyDeclaration("Children", KnownTypeTable[0xf2]); + KnownPropertyTable[60] = new PropertyDeclaration("GradientStops", KnownTypeTable[0xfb]); + KnownPropertyTable[0x3d] = new PropertyDeclaration("Column", KnownTypeTable[0xfe]); + KnownPropertyTable[0x3e] = new PropertyDeclaration("ColumnSpan", KnownTypeTable[0xfe]); + KnownPropertyTable[0x3f] = new PropertyDeclaration("Row", KnownTypeTable[0xfe]); + KnownPropertyTable[0x40] = new PropertyDeclaration("RowSpan", KnownTypeTable[0xfe]); + KnownPropertyTable[0x41] = new PropertyDeclaration("Header", KnownTypeTable[0x103]); + KnownPropertyTable[0x42] = new PropertyDeclaration("HasHeader", KnownTypeTable[0x10d]); + KnownPropertyTable[0x43] = new PropertyDeclaration("Header", KnownTypeTable[0x10d]); + KnownPropertyTable[0x44] = new PropertyDeclaration("HeaderTemplate", KnownTypeTable[0x10d]); + KnownPropertyTable[0x45] = new PropertyDeclaration("HeaderTemplateSelector", KnownTypeTable[0x10d]); + KnownPropertyTable[70] = new PropertyDeclaration("HasHeader", KnownTypeTable[270]); + KnownPropertyTable[0x47] = new PropertyDeclaration("Header", KnownTypeTable[270]); + KnownPropertyTable[0x48] = new PropertyDeclaration("HeaderTemplate", KnownTypeTable[270]); + KnownPropertyTable[0x49] = new PropertyDeclaration("HeaderTemplateSelector", KnownTypeTable[270]); + KnownPropertyTable[0x4a] = new PropertyDeclaration("NavigateUri", KnownTypeTable[0x111]); + KnownPropertyTable[0x4b] = new PropertyDeclaration("Source", KnownTypeTable[0x119]); + KnownPropertyTable[0x4c] = new PropertyDeclaration("Stretch", KnownTypeTable[0x119]); + KnownPropertyTable[0x4d] = new PropertyDeclaration("ItemContainerStyle", KnownTypeTable[0x149]); + KnownPropertyTable[0x4e] = new PropertyDeclaration("ItemContainerStyleSelector", KnownTypeTable[0x149]); + KnownPropertyTable[0x4f] = new PropertyDeclaration("ItemTemplate", KnownTypeTable[0x149]); + KnownPropertyTable[80] = new PropertyDeclaration("ItemTemplateSelector", KnownTypeTable[0x149]); + KnownPropertyTable[0x51] = new PropertyDeclaration("ItemsPanel", KnownTypeTable[0x149]); + KnownPropertyTable[0x52] = new PropertyDeclaration("ItemsSource", KnownTypeTable[0x149]); + KnownPropertyTable[0x53] = new PropertyDeclaration("Children", KnownTypeTable[0x180]); + KnownPropertyTable[0x54] = new PropertyDeclaration("Children", KnownTypeTable[0x198]); + KnownPropertyTable[0x55] = new PropertyDeclaration("Content", KnownTypeTable[0x1b2]); + KnownPropertyTable[0x56] = new PropertyDeclaration("Background", KnownTypeTable[0x1b5]); + KnownPropertyTable[0x57] = new PropertyDeclaration("Data", KnownTypeTable[0x1ba]); + KnownPropertyTable[0x58] = new PropertyDeclaration("Segments", KnownTypeTable[0x1bb]); + KnownPropertyTable[0x59] = new PropertyDeclaration("Figures", KnownTypeTable[0x1be]); + KnownPropertyTable[90] = new PropertyDeclaration("Child", KnownTypeTable[0x1e5]); + KnownPropertyTable[0x5b] = new PropertyDeclaration("IsOpen", KnownTypeTable[0x1e5]); + KnownPropertyTable[0x5c] = new PropertyDeclaration("Placement", KnownTypeTable[0x1e5]); + KnownPropertyTable[0x5d] = new PropertyDeclaration("PopupAnimation", KnownTypeTable[0x1e5]); + KnownPropertyTable[0x5e] = new PropertyDeclaration("Height", KnownTypeTable[0x21d]); + KnownPropertyTable[0x5f] = new PropertyDeclaration("MaxHeight", KnownTypeTable[0x21d]); + KnownPropertyTable[0x60] = new PropertyDeclaration("MinHeight", KnownTypeTable[0x21d]); + KnownPropertyTable[0x61] = new PropertyDeclaration("CanContentScroll", KnownTypeTable[550]); + KnownPropertyTable[0x62] = new PropertyDeclaration("HorizontalScrollBarVisibility", KnownTypeTable[550]); + KnownPropertyTable[0x63] = new PropertyDeclaration("VerticalScrollBarVisibility", KnownTypeTable[550]); + KnownPropertyTable[100] = new PropertyDeclaration("Fill", KnownTypeTable[0x22e]); + KnownPropertyTable[0x65] = new PropertyDeclaration("Stroke", KnownTypeTable[0x22e]); + KnownPropertyTable[0x66] = new PropertyDeclaration("StrokeThickness", KnownTypeTable[0x22e]); + KnownPropertyTable[0x67] = new PropertyDeclaration("Background", KnownTypeTable[0x27e]); + KnownPropertyTable[0x68] = new PropertyDeclaration("FontFamily", KnownTypeTable[0x27e]); + KnownPropertyTable[0x69] = new PropertyDeclaration("FontSize", KnownTypeTable[0x27e]); + KnownPropertyTable[0x6a] = new PropertyDeclaration("FontStretch", KnownTypeTable[0x27e]); + KnownPropertyTable[0x6b] = new PropertyDeclaration("FontStyle", KnownTypeTable[0x27e]); + KnownPropertyTable[0x6c] = new PropertyDeclaration("FontWeight", KnownTypeTable[0x27e]); + KnownPropertyTable[0x6d] = new PropertyDeclaration("Foreground", KnownTypeTable[0x27e]); + KnownPropertyTable[110] = new PropertyDeclaration("Text", KnownTypeTable[0x27e]); + KnownPropertyTable[0x6f] = new PropertyDeclaration("TextDecorations", KnownTypeTable[0x27e]); + KnownPropertyTable[0x70] = new PropertyDeclaration("TextTrimming", KnownTypeTable[0x27e]); + KnownPropertyTable[0x71] = new PropertyDeclaration("TextWrapping", KnownTypeTable[0x27e]); + KnownPropertyTable[0x72] = new PropertyDeclaration("Text", KnownTypeTable[0x27f]); + KnownPropertyTable[0x73] = new PropertyDeclaration("Background", KnownTypeTable[0x288]); + KnownPropertyTable[0x74] = new PropertyDeclaration("FontFamily", KnownTypeTable[0x288]); + KnownPropertyTable[0x75] = new PropertyDeclaration("FontSize", KnownTypeTable[0x288]); + KnownPropertyTable[0x76] = new PropertyDeclaration("FontStretch", KnownTypeTable[0x288]); + KnownPropertyTable[0x77] = new PropertyDeclaration("FontStyle", KnownTypeTable[0x288]); + KnownPropertyTable[120] = new PropertyDeclaration("FontWeight", KnownTypeTable[0x288]); + KnownPropertyTable[0x79] = new PropertyDeclaration("Foreground", KnownTypeTable[0x288]); + KnownPropertyTable[0x7a] = new PropertyDeclaration("Children", KnownTypeTable[0x29b]); + KnownPropertyTable[0x7b] = new PropertyDeclaration("IsDirectionReversed", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x7c] = new PropertyDeclaration("Maximum", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x7d] = new PropertyDeclaration("Minimum", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x7e] = new PropertyDeclaration("Orientation", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x7f] = new PropertyDeclaration("Value", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x80] = new PropertyDeclaration("ViewportSize", KnownTypeTable[0x2a3]); + KnownPropertyTable[0x81] = new PropertyDeclaration("Children", KnownTypeTable[0x2a7]); + KnownPropertyTable[130] = new PropertyDeclaration("Children", KnownTypeTable[0x2aa]); + KnownPropertyTable[0x83] = new PropertyDeclaration("ClipToBounds", KnownTypeTable[0x2b6]); + KnownPropertyTable[0x84] = new PropertyDeclaration("Focusable", KnownTypeTable[0x2b6]); + KnownPropertyTable[0x85] = new PropertyDeclaration("IsEnabled", KnownTypeTable[0x2b6]); + KnownPropertyTable[0x86] = new PropertyDeclaration("RenderTransform", KnownTypeTable[0x2b6]); + KnownPropertyTable[0x87] = new PropertyDeclaration("Visibility", KnownTypeTable[0x2b6]); + KnownPropertyTable[0x88] = new PropertyDeclaration("Children", KnownTypeTable[0x2d9]); + KnownPropertyTable[0x8a] = new PropertyDeclaration("Child", KnownTypeTable[2]); + KnownPropertyTable[0x8b] = new PropertyDeclaration("Child", KnownTypeTable[4]); + KnownPropertyTable[140] = new PropertyDeclaration("Blocks", KnownTypeTable[8]); + KnownPropertyTable[0x8d] = new PropertyDeclaration("Items", KnownTypeTable[14]); + KnownPropertyTable[0x8e] = new PropertyDeclaration("Child", KnownTypeTable[0x25]); + KnownPropertyTable[0x8f] = new PropertyDeclaration("Inlines", KnownTypeTable[0x29]); + KnownPropertyTable[0x90] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x2d]); + KnownPropertyTable[0x91] = new PropertyDeclaration("Child", KnownTypeTable[50]); + KnownPropertyTable[0x92] = new PropertyDeclaration("Child", KnownTypeTable[0x36]); + KnownPropertyTable[0x93] = new PropertyDeclaration("Content", KnownTypeTable[0x37]); + KnownPropertyTable[0x94] = new PropertyDeclaration("Content", KnownTypeTable[0x38]); + KnownPropertyTable[0x95] = new PropertyDeclaration("KeyFrames", KnownTypeTable[60]); + KnownPropertyTable[150] = new PropertyDeclaration("Children", KnownTypeTable[0x42]); + KnownPropertyTable[0x97] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x45]); + KnownPropertyTable[0x98] = new PropertyDeclaration("Content", KnownTypeTable[0x4a]); + KnownPropertyTable[0x99] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x54]); + KnownPropertyTable[0x9a] = new PropertyDeclaration("Items", KnownTypeTable[0x5c]); + KnownPropertyTable[0x9b] = new PropertyDeclaration("Content", KnownTypeTable[0x5d]); + KnownPropertyTable[0x9c] = new PropertyDeclaration("Items", KnownTypeTable[0x69]); + KnownPropertyTable[0x9d] = new PropertyDeclaration("VisualTree", KnownTypeTable[0x6c]); + KnownPropertyTable[0x9e] = new PropertyDeclaration("VisualTree", KnownTypeTable[120]); + KnownPropertyTable[0x9f] = new PropertyDeclaration("Setters", KnownTypeTable[0x7a]); + KnownPropertyTable[160] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x81]); + KnownPropertyTable[0xa1] = new PropertyDeclaration("Child", KnownTypeTable[0x85]); + KnownPropertyTable[0xa2] = new PropertyDeclaration("Children", KnownTypeTable[0xa3]); + KnownPropertyTable[0xa3] = new PropertyDeclaration("Document", KnownTypeTable[0xa6]); + KnownPropertyTable[0xa4] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0xab]); + KnownPropertyTable[0xa5] = new PropertyDeclaration("Actions", KnownTypeTable[0xc6]); + KnownPropertyTable[0xa6] = new PropertyDeclaration("Content", KnownTypeTable[0xc7]); + KnownPropertyTable[0xa7] = new PropertyDeclaration("Blocks", KnownTypeTable[0xca]); + KnownPropertyTable[0xa8] = new PropertyDeclaration("Pages", KnownTypeTable[0xcd]); + KnownPropertyTable[0xa9] = new PropertyDeclaration("References", KnownTypeTable[0xce]); + KnownPropertyTable[170] = new PropertyDeclaration("Children", KnownTypeTable[0xcf]); + KnownPropertyTable[0xab] = new PropertyDeclaration("Blocks", KnownTypeTable[0xd0]); + KnownPropertyTable[0xac] = new PropertyDeclaration("Blocks", KnownTypeTable[0xd1]); + KnownPropertyTable[0xad] = new PropertyDeclaration("Document", KnownTypeTable[210]); + KnownPropertyTable[0xae] = new PropertyDeclaration("VisualTree", KnownTypeTable[0xe7]); + KnownPropertyTable[0xaf] = new PropertyDeclaration("Children", KnownTypeTable[0xfe]); + KnownPropertyTable[0xb0] = new PropertyDeclaration("Columns", KnownTypeTable[0x102]); + KnownPropertyTable[0xb1] = new PropertyDeclaration("Content", KnownTypeTable[260]); + KnownPropertyTable[0xb2] = new PropertyDeclaration("Content", KnownTypeTable[0x108]); + KnownPropertyTable[0xb3] = new PropertyDeclaration("Content", KnownTypeTable[0x109]); + KnownPropertyTable[180] = new PropertyDeclaration("Content", KnownTypeTable[0x10d]); + KnownPropertyTable[0xb5] = new PropertyDeclaration("Items", KnownTypeTable[270]); + KnownPropertyTable[0xb6] = new PropertyDeclaration("VisualTree", KnownTypeTable[0x10f]); + KnownPropertyTable[0xb7] = new PropertyDeclaration("Inlines", KnownTypeTable[0x111]); + KnownPropertyTable[0xb8] = new PropertyDeclaration("Children", KnownTypeTable[0x120]); + KnownPropertyTable[0xb9] = new PropertyDeclaration("Child", KnownTypeTable[0x121]); + KnownPropertyTable[0xba] = new PropertyDeclaration("Child", KnownTypeTable[0x124]); + KnownPropertyTable[0xbb] = new PropertyDeclaration("NameValue", KnownTypeTable[300]); + KnownPropertyTable[0xbc] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x131]); + KnownPropertyTable[0xbd] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x138]); + KnownPropertyTable[190] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x143]); + KnownPropertyTable[0xbf] = new PropertyDeclaration("Inlines", KnownTypeTable[0x147]); + KnownPropertyTable[0xc0] = new PropertyDeclaration("Items", KnownTypeTable[0x149]); + KnownPropertyTable[0xc1] = new PropertyDeclaration("VisualTree", KnownTypeTable[330]); + KnownPropertyTable[0xc2] = new PropertyDeclaration("Content", KnownTypeTable[0x15a]); + KnownPropertyTable[0xc3] = new PropertyDeclaration("GradientStops", KnownTypeTable[0x166]); + KnownPropertyTable[0xc4] = new PropertyDeclaration("ListItems", KnownTypeTable[0x174]); + KnownPropertyTable[0xc5] = new PropertyDeclaration("Items", KnownTypeTable[0x175]); + KnownPropertyTable[0xc6] = new PropertyDeclaration("Content", KnownTypeTable[0x176]); + KnownPropertyTable[0xc7] = new PropertyDeclaration("Blocks", KnownTypeTable[0x178]); + KnownPropertyTable[200] = new PropertyDeclaration("Items", KnownTypeTable[0x179]); + KnownPropertyTable[0xc9] = new PropertyDeclaration("Content", KnownTypeTable[0x17a]); + KnownPropertyTable[0xca] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x185]); + KnownPropertyTable[0xcb] = new PropertyDeclaration("Items", KnownTypeTable[0x191]); + KnownPropertyTable[0xcc] = new PropertyDeclaration("Items", KnownTypeTable[0x192]); + KnownPropertyTable[0xcd] = new PropertyDeclaration("Items", KnownTypeTable[0x193]); + KnownPropertyTable[0xce] = new PropertyDeclaration("Children", KnownTypeTable[0x199]); + KnownPropertyTable[0xcf] = new PropertyDeclaration("Bindings", KnownTypeTable[0x1a0]); + KnownPropertyTable[0xd0] = new PropertyDeclaration("Setters", KnownTypeTable[0x1a2]); + KnownPropertyTable[0xd1] = new PropertyDeclaration("Setters", KnownTypeTable[0x1a3]); + KnownPropertyTable[210] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x1ac]); + KnownPropertyTable[0xd3] = new PropertyDeclaration("Child", KnownTypeTable[0x1b3]); + KnownPropertyTable[0xd4] = new PropertyDeclaration("Content", KnownTypeTable[0x1b4]); + KnownPropertyTable[0xd5] = new PropertyDeclaration("Children", KnownTypeTable[0x1b5]); + KnownPropertyTable[0xd6] = new PropertyDeclaration("Inlines", KnownTypeTable[0x1b6]); + KnownPropertyTable[0xd7] = new PropertyDeclaration("Children", KnownTypeTable[0x1b7]); + KnownPropertyTable[0xd8] = new PropertyDeclaration("KeyFrames", KnownTypeTable[460]); + KnownPropertyTable[0xd9] = new PropertyDeclaration("KeyFrames", KnownTypeTable[470]); + KnownPropertyTable[0xda] = new PropertyDeclaration("Bindings", KnownTypeTable[0x1e7]); + KnownPropertyTable[0xdb] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x1f1]); + KnownPropertyTable[220] = new PropertyDeclaration("GradientStops", KnownTypeTable[0x1f6]); + KnownPropertyTable[0xdd] = new PropertyDeclaration("Content", KnownTypeTable[0x1f7]); + KnownPropertyTable[0xde] = new PropertyDeclaration("KeyFrames", KnownTypeTable[510]); + KnownPropertyTable[0xdf] = new PropertyDeclaration("Content", KnownTypeTable[0x20a]); + KnownPropertyTable[0xe0] = new PropertyDeclaration("Document", KnownTypeTable[0x20f]); + KnownPropertyTable[0xe1] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x215]); + KnownPropertyTable[0xe2] = new PropertyDeclaration("Text", KnownTypeTable[0x21e]); + KnownPropertyTable[0xe3] = new PropertyDeclaration("Content", KnownTypeTable[550]); + KnownPropertyTable[0xe4] = new PropertyDeclaration("Blocks", KnownTypeTable[0x227]); + KnownPropertyTable[0xe5] = new PropertyDeclaration("Items", KnownTypeTable[0x229]); + KnownPropertyTable[230] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x232]); + KnownPropertyTable[0xe7] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x23b]); + KnownPropertyTable[0xe8] = new PropertyDeclaration("Inlines", KnownTypeTable[580]); + KnownPropertyTable[0xe9] = new PropertyDeclaration("Children", KnownTypeTable[0x259]); + KnownPropertyTable[0xea] = new PropertyDeclaration("Items", KnownTypeTable[0x25c]); + KnownPropertyTable[0xeb] = new PropertyDeclaration("Content", KnownTypeTable[0x25d]); + KnownPropertyTable[0xec] = new PropertyDeclaration("Children", KnownTypeTable[0x260]); + KnownPropertyTable[0xed] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x266]); + KnownPropertyTable[0xee] = new PropertyDeclaration("Setters", KnownTypeTable[620]); + KnownPropertyTable[0xef] = new PropertyDeclaration("Items", KnownTypeTable[0x26f]); + KnownPropertyTable[240] = new PropertyDeclaration("Content", KnownTypeTable[0x270]); + KnownPropertyTable[0xf1] = new PropertyDeclaration("Children", KnownTypeTable[0x271]); + KnownPropertyTable[0xf2] = new PropertyDeclaration("RowGroups", KnownTypeTable[0x272]); + KnownPropertyTable[0xf3] = new PropertyDeclaration("Blocks", KnownTypeTable[0x273]); + KnownPropertyTable[0xf4] = new PropertyDeclaration("Cells", KnownTypeTable[0x275]); + KnownPropertyTable[0xf5] = new PropertyDeclaration("Rows", KnownTypeTable[630]); + KnownPropertyTable[0xf6] = new PropertyDeclaration("Inlines", KnownTypeTable[0x27e]); + KnownPropertyTable[0xf7] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x28e]); + KnownPropertyTable[0xf8] = new PropertyDeclaration("Content", KnownTypeTable[0x29c]); + KnownPropertyTable[0xf9] = new PropertyDeclaration("Items", KnownTypeTable[0x29d]); + KnownPropertyTable[250] = new PropertyDeclaration("Children", KnownTypeTable[670]); + KnownPropertyTable[0xfb] = new PropertyDeclaration("Children", KnownTypeTable[0x29f]); + KnownPropertyTable[0xfc] = new PropertyDeclaration("ToolBars", KnownTypeTable[0x2a0]); + KnownPropertyTable[0xfd] = new PropertyDeclaration("Content", KnownTypeTable[0x2a1]); + KnownPropertyTable[0xfe] = new PropertyDeclaration("Items", KnownTypeTable[0x2ae]); + KnownPropertyTable[0xff] = new PropertyDeclaration("Items", KnownTypeTable[0x2af]); + KnownPropertyTable[0x100] = new PropertyDeclaration("Setters", KnownTypeTable[0x2b0]); + KnownPropertyTable[0x101] = new PropertyDeclaration("Inlines", KnownTypeTable[0x2be]); + KnownPropertyTable[0x102] = new PropertyDeclaration("Children", KnownTypeTable[0x2bf]); + KnownPropertyTable[0x103] = new PropertyDeclaration("Content", KnownTypeTable[0x2c2]); + KnownPropertyTable[260] = new PropertyDeclaration("KeyFrames", KnownTypeTable[0x2c8]); + KnownPropertyTable[0x105] = new PropertyDeclaration("KeyFrames", KnownTypeTable[720]); + KnownPropertyTable[0x106] = new PropertyDeclaration("Child", KnownTypeTable[0x2d8]); + KnownPropertyTable[0x107] = new PropertyDeclaration("Children", KnownTypeTable[730]); + KnownPropertyTable[0x108] = new PropertyDeclaration("Children", KnownTypeTable[0x2db]); + KnownPropertyTable[0x109] = new PropertyDeclaration("Children", KnownTypeTable[0x2dc]); + KnownPropertyTable[0x10a] = new PropertyDeclaration("Content", KnownTypeTable[0x2e3]); + KnownPropertyTable[0x10b] = new PropertyDeclaration("Children", KnownTypeTable[0x2e6]); + KnownPropertyTable[0x10c] = new PropertyDeclaration("XmlSerializer", KnownTypeTable[0x2f2]); + KnownResourceTable.Add(1, new ResourceName("SystemColors.ActiveBorderBrush")); + KnownResourceTable.Add(0x1f, new ResourceName("SystemColors.ActiveBorderColor")); + KnownResourceTable.Add(2, new ResourceName("SystemColors.ActiveCaptionBrush")); + KnownResourceTable.Add(0x20, new ResourceName("SystemColors.ActiveCaptionColor")); + KnownResourceTable.Add(3, new ResourceName("SystemColors.ActiveCaptionTextBrush")); + KnownResourceTable.Add(0x21, new ResourceName("SystemColors.ActiveCaptionTextColor")); + KnownResourceTable.Add(4, new ResourceName("SystemColors.AppWorkspaceBrush")); + KnownResourceTable.Add(0x22, new ResourceName("SystemParameters.AppWorkspaceColor")); + KnownResourceTable.Add(0xc6, new ResourceName("SystemParameters.Border")); + KnownResourceTable.Add(0xca, new ResourceName("SystemParameters.BorderWidth")); + KnownResourceTable.Add(0x40, new ResourceName("SystemFonts.CaptionFontFamily")); + KnownResourceTable.Add(0x3f, new ResourceName("SystemFonts.CaptionFontSize")); + KnownResourceTable.Add(0x41, new ResourceName("SystemFonts.CaptionFontStyle")); + KnownResourceTable.Add(0x43, new ResourceName("SystemFonts.CaptionFontTextDecorations")); + KnownResourceTable.Add(0x42, new ResourceName("SystemFonts.CaptionFontWeight")); + KnownResourceTable.Add(0xce, new ResourceName("SystemParameters.CaptionHeight")); + KnownResourceTable.Add(0xcd, new ResourceName("SystemParameters.CaptionWidth")); + KnownResourceTable.Add(0xc7, new ResourceName("SystemParameters.CaretWidth")); + KnownResourceTable.Add(0xba, new ResourceName("SystemParameters.ClientAreaAnimation")); + KnownResourceTable.Add(0xb9, new ResourceName("SystemParameters.ComboBoxAnimation")); + KnownResourceTable.Add(210, new ResourceName("SystemParameters.ComboBoxPopupAnimation")); + KnownResourceTable.Add(5, new ResourceName("SystemColors.ControlBrush")); + KnownResourceTable.Add(0x23, new ResourceName("SystemColors.ControlColor")); + KnownResourceTable.Add(6, new ResourceName("SystemColors.ControlDarkBrush")); + KnownResourceTable.Add(0x24, new ResourceName("SystemColors.ControlDarkColor")); + KnownResourceTable.Add(7, new ResourceName("SystemColors.ControlDarkDarkBrush")); + KnownResourceTable.Add(0x25, new ResourceName("SystemColors.ControlDarkDarkColor")); + KnownResourceTable.Add(8, new ResourceName("SystemColors.ControlLightBrush")); + KnownResourceTable.Add(0x26, new ResourceName("SystemColors.ControlLightColor")); + KnownResourceTable.Add(9, new ResourceName("SystemColors.ControlLightLightBrush")); + KnownResourceTable.Add(0x27, new ResourceName("SystemColors.ControlLightLightColor")); + KnownResourceTable.Add(10, new ResourceName("SystemColors.ControlTextBrush")); + KnownResourceTable.Add(40, new ResourceName("SystemColors.ControlTextColor")); + KnownResourceTable.Add(0x62, new ResourceName("SystemParameters.CursorHeight")); + KnownResourceTable.Add(0xbb, new ResourceName("SystemParameters.CursorShadow")); + KnownResourceTable.Add(0x61, new ResourceName("SystemParameters.CursorWidth")); + KnownResourceTable.Add(11, new ResourceName("SystemColors.DesktopBrush")); + KnownResourceTable.Add(0x29, new ResourceName("SystemColors.DesktopColor")); + KnownResourceTable.Add(0xc9, new ResourceName("SystemParameters.DragFullWindows")); + KnownResourceTable.Add(0xa7, new ResourceName("SystemParameters.DropShadow")); + KnownResourceTable.Add(0x65, new ResourceName("SystemParameters.FixedFrameHorizontalBorderHeight")); + KnownResourceTable.Add(0x66, new ResourceName("SystemParameters.FixedFrameVerticalBorderWidth")); + KnownResourceTable.Add(0xa8, new ResourceName("SystemParameters.FlatMenu")); + KnownResourceTable.Add(0xa5, new ResourceName("SystemParameters.FocusBorderHeight")); + KnownResourceTable.Add(0xa4, new ResourceName("SystemParameters.FocusBorderWidth")); + KnownResourceTable.Add(0x67, new ResourceName("SystemParameters.FocusHorizontalBorderHeight")); + KnownResourceTable.Add(0x68, new ResourceName("SystemParameters.FocusVerticalBorderWidth")); + KnownResourceTable.Add(0xd7, new ResourceName("SystemParameters.FocusVisualStyle")); + KnownResourceTable.Add(200, new ResourceName("SystemParameters.ForegroundFlashCount")); + KnownResourceTable.Add(0x6a, new ResourceName("SystemParameters.FullPrimaryScreenHeight")); + KnownResourceTable.Add(0x69, new ResourceName("SystemParameters.FullPrimaryScreenWidth")); + KnownResourceTable.Add(12, new ResourceName("SystemColors.GradientActiveCaptionBrush")); + KnownResourceTable.Add(0x2a, new ResourceName("SystemColors.GradientActiveCaptionColor")); + KnownResourceTable.Add(0xbc, new ResourceName("SystemColors.GradientCaptions")); + KnownResourceTable.Add(13, new ResourceName("SystemColors.GradientInactiveCaptionBrush")); + KnownResourceTable.Add(0x2b, new ResourceName("SystemColors.GradientInactiveCaptionColor")); + KnownResourceTable.Add(14, new ResourceName("SystemColors.GrayTextBrush")); + KnownResourceTable.Add(0x2c, new ResourceName("SystemColors.GrayTextColor")); + KnownResourceTable.Add(0xde, new ResourceName("GridView.GridViewItemContainerStyle")); + KnownResourceTable.Add(220, new ResourceName("GridView.GridViewScrollViewerStyle")); + KnownResourceTable.Add(0xdd, new ResourceName("GridView.GridViewStyle")); + KnownResourceTable.Add(0xa6, new ResourceName("SystemParameters.HighContrast")); + KnownResourceTable.Add(15, new ResourceName("SystemColors.HighlightBrush")); + KnownResourceTable.Add(0x2d, new ResourceName("SystemColors.HighlightColor")); + KnownResourceTable.Add(0x10, new ResourceName("SystemColors.HighlightTextBrush")); + KnownResourceTable.Add(0x2e, new ResourceName("SystemColors.HighlightTextColor")); + KnownResourceTable.Add(0x6b, new ResourceName("SystemParameters.HorizontalScrollBarButtonWidth")); + KnownResourceTable.Add(0x6c, new ResourceName("SystemParameters.HorizontalScrollBarHeight")); + KnownResourceTable.Add(0x6d, new ResourceName("SystemParameters.HorizontalScrollBarThumbWidth")); + KnownResourceTable.Add(0x11, new ResourceName("SystemColors.HotTrackBrush")); + KnownResourceTable.Add(0x2f, new ResourceName("SystemColors.HotTrackColor")); + KnownResourceTable.Add(0xbd, new ResourceName("SystemParameters.HotTracking")); + KnownResourceTable.Add(0x59, new ResourceName("SystemParameters.IconFontFamily")); + KnownResourceTable.Add(0x58, new ResourceName("SystemParameters.IconFontSize")); + KnownResourceTable.Add(90, new ResourceName("SystemParameters.IconFontStyle")); + KnownResourceTable.Add(0x5c, new ResourceName("SystemParameters.IconFontTextDecorations")); + KnownResourceTable.Add(0x5b, new ResourceName("SystemParameters.IconFontWeight")); + KnownResourceTable.Add(0x71, new ResourceName("SystemParameters.IconGridHeight")); + KnownResourceTable.Add(0x70, new ResourceName("SystemParameters.IconGridWidth")); + KnownResourceTable.Add(0x6f, new ResourceName("SystemParameters.IconHeight")); + KnownResourceTable.Add(170, new ResourceName("SystemParameters.IconHorizontalSpacing")); + KnownResourceTable.Add(0xac, new ResourceName("SystemParameters.IconTitleWrap")); + KnownResourceTable.Add(0xab, new ResourceName("SystemParameters.IconVerticalSpacing")); + KnownResourceTable.Add(110, new ResourceName("SystemParameters.IconWidth")); + KnownResourceTable.Add(0x12, new ResourceName("SystemColors.InactiveBorderBrush")); + KnownResourceTable.Add(0x30, new ResourceName("SystemColors.InactiveBorderColor")); + KnownResourceTable.Add(0x13, new ResourceName("SystemColors.InactiveCaptionBrush")); + KnownResourceTable.Add(0x31, new ResourceName("SystemColors.InactiveCaptionColor")); + KnownResourceTable.Add(20, new ResourceName("SystemColors.InactiveCaptionTextBrush")); + KnownResourceTable.Add(50, new ResourceName("SystemColors.InactiveCaptionTextColor")); + KnownResourceTable.Add(0x15, new ResourceName("SystemColors.InfoBrush")); + KnownResourceTable.Add(0x33, new ResourceName("SystemColors.InfoColor")); + KnownResourceTable.Add(0x16, new ResourceName("SystemColors.InfoTextBrush")); + KnownResourceTable.Add(0x34, new ResourceName("SystemColors.InfoTextColor")); + KnownResourceTable.Add(0x3d, new ResourceName("SystemColors.InternalSystemColorsEnd")); + KnownResourceTable.Add(0, new ResourceName("InternalSystemColorsStart")); + KnownResourceTable.Add(0x5d, new ResourceName("InternalSystemFontsEnd")); + KnownResourceTable.Add(0x3e, new ResourceName("InternalSystemFontsStart")); + KnownResourceTable.Add(0xda, new ResourceName("InternalSystemParametersEnd")); + KnownResourceTable.Add(0x5e, new ResourceName("InternalSystemParametersStart")); + KnownResourceTable.Add(0xe8, new ResourceName("InternalSystemThemeStylesEnd")); + KnownResourceTable.Add(0xd6, new ResourceName("InternalSystemThemeStylesStart")); + KnownResourceTable.Add(0x95, new ResourceName("SystemParameters.IsImmEnabled")); + KnownResourceTable.Add(150, new ResourceName("SystemParameters.IsMediaCenter")); + KnownResourceTable.Add(0x97, new ResourceName("SystemParameters.IsMenuDropRightAligned")); + KnownResourceTable.Add(0x98, new ResourceName("SystemParameters.IsMiddleEastEnabled")); + KnownResourceTable.Add(0x99, new ResourceName("SystemParameters.IsMousePresent")); + KnownResourceTable.Add(0x9a, new ResourceName("SystemParameters.IsMouseWheelPresent")); + KnownResourceTable.Add(0x9b, new ResourceName("SystemParameters.IsPenWindows")); + KnownResourceTable.Add(0x9c, new ResourceName("SystemParameters.IsRemotelyControlled")); + KnownResourceTable.Add(0x9d, new ResourceName("SystemParameters.IsRemoteSession")); + KnownResourceTable.Add(0x9f, new ResourceName("SystemParameters.IsSlowMachine")); + KnownResourceTable.Add(0xa1, new ResourceName("SystemParameters.IsTabletPC")); + KnownResourceTable.Add(0x91, new ResourceName("SystemParameters.KanjiWindowHeight")); + KnownResourceTable.Add(0xad, new ResourceName("SystemParameters.KeyboardCues")); + KnownResourceTable.Add(0xae, new ResourceName("SystemParameters.KeyboardDelay")); + KnownResourceTable.Add(0xaf, new ResourceName("SystemParameters.KeyboardPreference")); + KnownResourceTable.Add(0xb0, new ResourceName("SystemParameters.KeyboardSpeed")); + KnownResourceTable.Add(190, new ResourceName("SystemParameters.ListBoxSmoothScrolling")); + KnownResourceTable.Add(0x73, new ResourceName("SystemParameters.MaximizedPrimaryScreenHeight")); + KnownResourceTable.Add(0x72, new ResourceName("SystemParameters.MaximizedPrimaryScreenWidth")); + KnownResourceTable.Add(0x75, new ResourceName("SystemParameters.MaximumWindowTrackHeight")); + KnownResourceTable.Add(0x74, new ResourceName("SystemParameters.MaximumWindowTrackWidth")); + KnownResourceTable.Add(0xbf, new ResourceName("SystemParameters.MenuAnimation")); + KnownResourceTable.Add(0x18, new ResourceName("SystemColors.MenuBarBrush")); + KnownResourceTable.Add(0x36, new ResourceName("SystemColors.MenuBarColor")); + KnownResourceTable.Add(0x92, new ResourceName("SystemParameters.MenuBarHeight")); + KnownResourceTable.Add(0x17, new ResourceName("SystemColors.MenuBrush")); + KnownResourceTable.Add(0x79, new ResourceName("SystemParameters.MenuButtonHeight")); + KnownResourceTable.Add(120, new ResourceName("SystemParameters.MenuButtonWidth")); + KnownResourceTable.Add(0x77, new ResourceName("SystemParameters.MenuCheckmarkHeight")); + KnownResourceTable.Add(0x76, new ResourceName("SystemParameters.MenuCheckmarkWidth")); + KnownResourceTable.Add(0x35, new ResourceName("SystemColors.MenuColor")); + KnownResourceTable.Add(0xb6, new ResourceName("SystemParameters.MenuDropAlignment")); + KnownResourceTable.Add(0xb7, new ResourceName("SystemParameters.MenuFade")); + KnownResourceTable.Add(0x4a, new ResourceName("SystemFonts.MenuFontFamily")); + KnownResourceTable.Add(0x49, new ResourceName("SystemFonts.MenuFontSize")); + KnownResourceTable.Add(0x4b, new ResourceName("SystemFonts.MenuFontStyle")); + KnownResourceTable.Add(0x4d, new ResourceName("SystemFonts.MenuFontTextDecorations")); + KnownResourceTable.Add(0x4c, new ResourceName("SystemFonts.MenuFontWeight")); + KnownResourceTable.Add(0xd1, new ResourceName("SystemParameters.MenuHeight")); + KnownResourceTable.Add(0x19, new ResourceName("SystemColors.MenuHighlightBrush")); + KnownResourceTable.Add(0x37, new ResourceName("SystemColors.MenuHighlightColor")); + KnownResourceTable.Add(0xdb, new ResourceName("MenuItem.MenuItemSeparatorStyle")); + KnownResourceTable.Add(0xd3, new ResourceName("SystemParameters.MenuPopupAnimation")); + KnownResourceTable.Add(0xb8, new ResourceName("SystemParameters.MenuShowDelay")); + KnownResourceTable.Add(0x1a, new ResourceName("SystemColors.MenuTextBrush")); + KnownResourceTable.Add(0x38, new ResourceName("SystemColors.MenuTextColor")); + KnownResourceTable.Add(0xd0, new ResourceName("SystemParameters.MenuWidth")); + KnownResourceTable.Add(0x54, new ResourceName("SystemFonts.MessageFontFamily")); + KnownResourceTable.Add(0x53, new ResourceName("SystemFonts..MessageFontSize")); + KnownResourceTable.Add(0x55, new ResourceName("SystemFonts.MessageFontStyle")); + KnownResourceTable.Add(0x57, new ResourceName("SystemFonts.MessageFontTextDecorations")); + KnownResourceTable.Add(0x56, new ResourceName("SystemFonts.MessageFontWeight")); + KnownResourceTable.Add(0xc5, new ResourceName("SystemParameters.MinimizeAnimation")); + KnownResourceTable.Add(0x7f, new ResourceName("SystemParameters.MinimizedGridHeight")); + KnownResourceTable.Add(0x7e, new ResourceName("SystemParameters.MinimizedGridWidth")); + KnownResourceTable.Add(0x7d, new ResourceName("SystemParameters.MinimizedWindowHeight")); + KnownResourceTable.Add(0x7c, new ResourceName("SystemParameters.MinimizedWindowWidth")); + KnownResourceTable.Add(0x7b, new ResourceName("SystemParameters.MinimumWindowHeight")); + KnownResourceTable.Add(0x81, new ResourceName("SystemParameters.MinimumWindowTrackHeight")); + KnownResourceTable.Add(0x80, new ResourceName("SystemParameters.MinimumWindowTrackWidth")); + KnownResourceTable.Add(0x7a, new ResourceName("SystemParameters.MinimumWindowWidth")); + KnownResourceTable.Add(180, new ResourceName("SystemParameters.MouseHoverHeight")); + KnownResourceTable.Add(0xb3, new ResourceName("SystemParameters.MouseHoverTime")); + KnownResourceTable.Add(0xb5, new ResourceName("SystemParameters.MouseHoverWidth")); + KnownResourceTable.Add(0xd8, new ResourceName("SystemParameters.NavigationChromeDownLevelStyle")); + KnownResourceTable.Add(0xd9, new ResourceName("SystemParameters.NavigationChromeStyle")); + KnownResourceTable.Add(0xd5, new ResourceName("SystemParameters.PowerLineStatus")); + KnownResourceTable.Add(0x83, new ResourceName("SystemParameters.PrimaryScreenHeight")); + KnownResourceTable.Add(130, new ResourceName("SystemParameters.PrimaryScreenWidth")); + KnownResourceTable.Add(0x86, new ResourceName("SystemParameters.ResizeFrameHorizontalBorderHeight")); + KnownResourceTable.Add(0x87, new ResourceName("SystemParameters.ResizeFrameVerticalBorderWidth")); + KnownResourceTable.Add(0x1b, new ResourceName("SystemColors.ScrollBarBrush")); + KnownResourceTable.Add(0x39, new ResourceName("SystemColors.ScrollBarColor")); + KnownResourceTable.Add(0xcc, new ResourceName("SystemParameters.ScrollHeight")); + KnownResourceTable.Add(0xcb, new ResourceName("SystemParameters.ScrollWidth")); + KnownResourceTable.Add(0xc0, new ResourceName("SystemParameters.SelectionFade")); + KnownResourceTable.Add(0x9e, new ResourceName("SystemParameters.ShowSounds")); + KnownResourceTable.Add(0x45, new ResourceName("SystemFonts.SmallCaptionFontFamily")); + KnownResourceTable.Add(0x44, new ResourceName("SystemFonts.SmallCaptionFontSize")); + KnownResourceTable.Add(70, new ResourceName("SystemFonts.SmallCaptionFontStyle")); + KnownResourceTable.Add(0x48, new ResourceName("SystemFonts.SmallCaptionFontTextDecorations")); + KnownResourceTable.Add(0x47, new ResourceName("SystemFonts.SmallCaptionFontWeight")); + KnownResourceTable.Add(0x93, new ResourceName("SystemParameters.SmallCaptionHeight")); + KnownResourceTable.Add(0xcf, new ResourceName("SystemParameters.SmallCaptionWidth")); + KnownResourceTable.Add(0x89, new ResourceName("SystemParameters.SmallIconHeight")); + KnownResourceTable.Add(0x88, new ResourceName("SystemParameters.SmallIconWidth")); + KnownResourceTable.Add(0x8b, new ResourceName("SystemParameters.SmallWindowCaptionButtonHeight")); + KnownResourceTable.Add(0x8a, new ResourceName("SystemParameters.SmallWindowCaptionButtonWidth")); + KnownResourceTable.Add(0xb1, new ResourceName("SystemParameters.SnapToDefaultButton")); + KnownResourceTable.Add(0xdf, new ResourceName("StatusBar.StatusBarSeparatorStyle")); + KnownResourceTable.Add(0x4f, new ResourceName("SystemFonts.StatusFontFamily")); + KnownResourceTable.Add(0x4e, new ResourceName("SystemFonts.StatusFontSize")); + KnownResourceTable.Add(80, new ResourceName("SystemFonts.StatusFontStyle")); + KnownResourceTable.Add(0x52, new ResourceName("SystemFonts.StatusFontTextDecorations")); + KnownResourceTable.Add(0x51, new ResourceName("SystemFonts.StatusFontWeight")); + KnownResourceTable.Add(0xc1, new ResourceName("SystemParameters.StylusHotTracking")); + KnownResourceTable.Add(160, new ResourceName("SystemParameters.SwapButtons")); + KnownResourceTable.Add(0x63, new ResourceName("SystemParameters.ThickHorizontalBorderHeight")); + KnownResourceTable.Add(100, new ResourceName("SystemParameters.ThickVerticalBorderWidth")); + KnownResourceTable.Add(0x5f, new ResourceName("SystemParameters.ThinHorizontalBorderHeight")); + KnownResourceTable.Add(0x60, new ResourceName("SystemParameters.ThinVerticalBorderWidth")); + KnownResourceTable.Add(0xe0, new ResourceName("ToolBar.ButtonStyle")); + KnownResourceTable.Add(0xe3, new ResourceName("ToolBar.CheckBoxStyle")); + KnownResourceTable.Add(0xe5, new ResourceName("ToolBar.ComboBoxStyle")); + KnownResourceTable.Add(0xe7, new ResourceName("ToolBar.MenuStyle")); + KnownResourceTable.Add(0xe4, new ResourceName("ToolBar.RadioButtonStyle")); + KnownResourceTable.Add(0xe2, new ResourceName("ToolBar.SeparatorStyle")); + KnownResourceTable.Add(230, new ResourceName("ToolBar.TextBoxStyle")); + KnownResourceTable.Add(0xe1, new ResourceName("ToolBar.ToggleButtonStyle")); + KnownResourceTable.Add(0xc2, new ResourceName("SystemParameters.ToolTipAnimation")); + KnownResourceTable.Add(0xc3, new ResourceName("SystemParameters.ToolTipFade")); + KnownResourceTable.Add(0xd4, new ResourceName("SystemParameters.ToolTipPopupAnimation")); + KnownResourceTable.Add(0xc4, new ResourceName("SystemParameters.UIEffects")); + KnownResourceTable.Add(0x8f, new ResourceName("SystemParameters.VerticalScrollBarButtonHeight")); + KnownResourceTable.Add(0x94, new ResourceName("SystemParameters.VerticalScrollBarThumbHeight")); + KnownResourceTable.Add(0x8e, new ResourceName("SystemParameters.VerticalScrollBarWidth")); + KnownResourceTable.Add(0x8d, new ResourceName("SystemParameters.VirtualScreenHeight")); + KnownResourceTable.Add(0xa2, new ResourceName("SystemParameters.VirtualScreenLeft")); + KnownResourceTable.Add(0xa3, new ResourceName("SystemParameters.VirtualScreenTop")); + KnownResourceTable.Add(140, new ResourceName("SystemParameters.VirtualScreenWidth")); + KnownResourceTable.Add(0xb2, new ResourceName("SystemParameters.WheelScrollLines")); + KnownResourceTable.Add(0x1c, new ResourceName("SystemColors.WindowBrush")); + KnownResourceTable.Add(0x85, new ResourceName("SystemParameters.WindowCaptionButtonHeight")); + KnownResourceTable.Add(0x84, new ResourceName("SystemParameters.WindowCaptionButtonWidth")); + KnownResourceTable.Add(0x90, new ResourceName("SystemParameters.WindowCaptionHeight")); + KnownResourceTable.Add(0x3a, new ResourceName("SystemColors.WindowColor")); + KnownResourceTable.Add(0x1d, new ResourceName("SystemColors.WindowFrameBrush")); + KnownResourceTable.Add(0x3b, new ResourceName("SystemColors.WindowFrameColor")); + KnownResourceTable.Add(30, new ResourceName("SystemColors.WindowTextBrush")); + KnownResourceTable.Add(60, new ResourceName("SystemColors.WindowTextColor")); + KnownResourceTable.Add(0xa9, new ResourceName("SystemParameters.WorkArea")); + } + + #endregion + + public bool IsKnownType(string type) + { + foreach (TypeDeclaration td in KnownTypeTable) + if (String.CompareOrdinal(td.Name, type) == 0) + return true; + + return false; + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/PropertyDeclaration.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/PropertyDeclaration.cs new file mode 100644 index 000000000..fcb7f6ba4 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/PropertyDeclaration.cs @@ -0,0 +1,58 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class PropertyDeclaration + { + private TypeDeclaration declaringType; + private string name; + + // Methods + public PropertyDeclaration(string name) + { + this.name = name; + this.declaringType = null; + } + + public PropertyDeclaration(string name, TypeDeclaration declaringType) + { + this.name = name; + this.declaringType = declaringType; + } + + public override string ToString() + { + if (((this.DeclaringType != null) && (this.DeclaringType.Name == "XmlNamespace")) && ((this.DeclaringType.Namespace == null) && (this.DeclaringType.Assembly == null))) + { + if ((this.Name == null) || (this.Name.Length == 0)) + { + return "xmlns"; + } + return ("xmlns:" + this.Name); + } + return this.Name; + } + + // Properties + public TypeDeclaration DeclaringType + { + get + { + return this.declaringType; + } + } + + public string Name + { + get + { + return this.name; + } + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ResourceName.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ResourceName.cs new file mode 100644 index 000000000..a8b0b37d2 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/ResourceName.cs @@ -0,0 +1,32 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class ResourceName + { + private string name; + + public ResourceName(string name) + { + this.name = name; + } + + public override string ToString() + { + return this.Name; + } + + public string Name + { + get + { + return this.name; + } + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs new file mode 100644 index 000000000..2efaab843 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/TypeDeclaration.cs @@ -0,0 +1,137 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class TypeDeclaration + { + private readonly XmlBamlReader reader; + + private readonly short _assemblyId; + private readonly bool _isKnown; + private readonly string _name; + private readonly string _namespaceName; + private readonly bool _isExtension; + private IType _type; + private bool _typeLoaded; + private readonly ITypeResolver resolver; + + public TypeDeclaration(ITypeResolver resolver, string name, string namespaceName, short assemblyId) + : this(null, resolver, name, namespaceName, assemblyId, true) + { + + } + + public TypeDeclaration(ITypeResolver resolver, string name, string namespaceName, short assemblyId, bool isExtension) + : this(null, resolver, name, namespaceName, assemblyId, true) + { + _isExtension = isExtension; + } + + public TypeDeclaration(XmlBamlReader reader, ITypeResolver resolver, string name, string namespaceName, short assemblyId) + : this(reader, resolver, name, namespaceName, assemblyId, true) + { + } + + public TypeDeclaration(XmlBamlReader reader, ITypeResolver resolver, string name, string namespaceName, short assemblyId, bool isKnown) + { + this.reader = reader; + this.resolver = resolver; + this._name = name; + this._namespaceName = namespaceName; + this._assemblyId = assemblyId; + this._isKnown = isKnown; + + if (!_isExtension) + _isExtension = name.EndsWith("Extension"); + } + + public override string ToString() + { + return this._name; + } + + public bool IsExtension + { + get { return _isExtension; } + } + + public string Assembly + { + get + { + if (reader != null) + return this.reader.GetAssembly(this.AssemblyId); + else + return KnownInfo.KnownAssemblyTable[this.AssemblyId]; + } + } + + public short AssemblyId + { + get { return _assemblyId; } + } + + public string Name + { + get + { + return this._name; + } + } + + public bool IsKnown + { + get { return _isKnown; } + } + + //public Type DotNetType + //{ + // get + // { + // if (!_typeLoaded) + // { + // _type = Type.GetType(String.Format("{0}.{1}, {2}", this.Namespace, this.Name, this.Assembly), false, true); + // _typeLoaded = true; + // } + + // return _type; + // } + //} + + public IType Type + { + get + { + if (!_typeLoaded) + { + if (this.Name.Length > 0) + _type = resolver.GetTypeByAssemblyQualifiedName(String.Format("{0}.{1}, {2}", this.Namespace, this.Name, this.Assembly)); + _typeLoaded = true; + } + + return _type; + } + } + + public string Namespace + { + get + { + return this._namespaceName; + } + } + + public override bool Equals(object obj) + { + TypeDeclaration td = obj as TypeDeclaration; + if (td != null) + return (this.Name == td.Name && this.Namespace == td.Namespace && this.AssemblyId == td.AssemblyId); + else + return false; + } + } + +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/WpfDependencyPropertyDescriptor.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/WpfDependencyPropertyDescriptor.cs new file mode 100644 index 000000000..2ac19f1a5 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/WpfDependencyPropertyDescriptor.cs @@ -0,0 +1,35 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class WpfDependencyPropertyDescriptor : MarshalByRefObject, IDependencyPropertyDescriptor + { + private readonly DependencyPropertyDescriptor _propertyDescriptor; + + public WpfDependencyPropertyDescriptor(DependencyPropertyDescriptor propertyDescriptor) + { + if (propertyDescriptor == null) throw new ArgumentNullException("propertyDescriptor"); + _propertyDescriptor = propertyDescriptor; + } + + #region IDependencyPropertyDescriptor Members + + public bool IsAttached + { + get { return _propertyDescriptor.IsAttached; } + } + + #endregion + + public override object InitializeLifetimeService() + { + return null; + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlElement.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlElement.cs new file mode 100644 index 000000000..393ac5c70 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlElement.cs @@ -0,0 +1,193 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlBamlElement : XmlBamlNode + { + private ArrayList _arguments = new ArrayList(); + private XmlNamespaceCollection _namespaces = new XmlNamespaceCollection(); + private TypeDeclaration _typeDeclaration; + private KeysResourcesCollection _keysResources = new KeysResourcesCollection(); + private long _position; + + public XmlBamlElement() + { + } + + + public XmlBamlElement(XmlBamlElement parent) + { + this.Namespaces.AddRange(parent.Namespaces); + } + + public XmlNamespaceCollection Namespaces + { + get { return _namespaces; } + } + + public TypeDeclaration TypeDeclaration + { + get + { + return this._typeDeclaration; + } + set + { + this._typeDeclaration = value; + } + } + + public override XmlNodeType NodeType + { + get + { + return XmlNodeType.Element; + } + } + + public long Position + { + get { return _position; } + set { _position = value; } + } + + public override string ToString() + { + return String.Format("Element: {0}", TypeDeclaration.Name); + } + } + + internal class XmlBamlEndElement : XmlBamlElement + { + public XmlBamlEndElement(XmlBamlElement start) + { + this.TypeDeclaration = start.TypeDeclaration; + this.Namespaces.AddRange(start.Namespaces); + } + + public override XmlNodeType NodeType + { + get + { + return XmlNodeType.EndElement; + } + } + + public override string ToString() + { + return String.Format("EndElement: {0}", TypeDeclaration.Name); + } + } + + internal class KeyMapping + { + private string _key; + private TypeDeclaration _declaration; + private string _trueKey; + + public KeyMapping(string key, TypeDeclaration declaration, string trueKey) + { + _key = key; + _declaration = declaration; + _trueKey = trueKey; + } + + public string Key + { + get { return _key; } + } + + public TypeDeclaration Declaration + { + get { return _declaration; } + } + + public string TrueKey + { + get { return _trueKey; } + } + + public override string ToString() + { + return String.Format("{0} - {1} - {2}", Key, Declaration, TrueKey); + } + } + + internal class KeysResourcesCollection : List + { + public KeysResource Last + { + get + { + if (this.Count == 0) + return null; + return this[this.Count - 1]; + } + } + + public KeysResource First + { + get + { + if (this.Count == 0) + return null; + return this[0]; + } + } + } + + internal class KeysResource + { + private KeysTable _keys = new KeysTable(); + private ArrayList _staticResources = new ArrayList(); + + public KeysTable Keys + { + get { return _keys; } + } + + public ArrayList StaticResources + { + get { return _staticResources; } + } + } + + internal class KeysTable + { + private Hashtable table = new Hashtable(); + + public String this[long position] + { + get + { + return (string)this.table[position]; + } + set + { + this.table[position] = value; + } + } + + public int Count + { + get { return this.table.Count; } + } + + public void Remove(long position) + { + this.table.Remove(position); + } + + public bool HasKey(long position) + { + return this.table.ContainsKey(position); + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlNode.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlNode.cs new file mode 100644 index 000000000..1f27846b8 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlNode.cs @@ -0,0 +1,21 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlBamlNode + { + public virtual XmlNodeType NodeType + { + get { return XmlNodeType.None;} + } + } + + internal class XmlBamlNodeCollection : List + {} +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlProperty.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlProperty.cs new file mode 100644 index 000000000..2da34dd90 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlProperty.cs @@ -0,0 +1,86 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlBamlProperty : XmlBamlNode + { + private PropertyDeclaration propertyDeclaration; + private PropertyType propertyType; + private object value; + + public XmlBamlProperty(PropertyType propertyType) + { + this.propertyType = propertyType; + } + + public XmlBamlProperty(PropertyType propertyType, PropertyDeclaration propertyDeclaration) + { + this.propertyDeclaration = propertyDeclaration; + this.propertyType = propertyType; + } + + public override string ToString() + { + return this.PropertyDeclaration.Name; + } + + public PropertyDeclaration PropertyDeclaration + { + get + { + return this.propertyDeclaration; + } + set + { + this.propertyDeclaration = value; + } + } + + public PropertyType PropertyType + { + get + { + return this.propertyType; + } + } + + public object Value + { + get + { + return this.value; + } + set + { + this.value = value; + } + } + + public override XmlNodeType NodeType + { + get + { + return XmlNodeType.Attribute; + } + } + } + + internal enum PropertyType + { + Key, + Value, + Content, + List, + Dictionary, + Complex + } + + internal class XmlBamlPropertyCollection : List + { } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlPropertyElement.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlPropertyElement.cs new file mode 100644 index 000000000..fbb312cf0 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlPropertyElement.cs @@ -0,0 +1,48 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlBamlPropertyElement : XmlBamlElement + { + private readonly PropertyType _propertyType; + private PropertyDeclaration propertyDeclaration; + + + public XmlBamlPropertyElement(PropertyType propertyType, PropertyDeclaration propertyDeclaration) + { + _propertyType = propertyType; + this.propertyDeclaration = propertyDeclaration; + } + + public XmlBamlPropertyElement(XmlBamlElement parent, PropertyType propertyType, PropertyDeclaration propertyDeclaration) + : base(parent) + { + _propertyType = propertyType; + this.propertyDeclaration = propertyDeclaration; + this.TypeDeclaration = propertyDeclaration.DeclaringType; + } + + public PropertyDeclaration PropertyDeclaration + { + get + { + return this.propertyDeclaration; + } + } + + public PropertyType PropertyType + { + get { return _propertyType; } + } + + public override string ToString() + { + return String.Format("PropertyElement: {0}.{1}", TypeDeclaration.Name, PropertyDeclaration.Name); + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs new file mode 100644 index 000000000..ceb8b0f15 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs @@ -0,0 +1,1939 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Text; +using System.Xml; +using System.Windows.Media; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + public class XmlBamlReader : XmlReader, IXmlNamespaceResolver + { + + #region Variables + + private BamlBinaryReader reader; + private Hashtable assemblyTable = new Hashtable(); + private Hashtable stringTable = new Hashtable(); + private Hashtable typeTable = new Hashtable(); + private Hashtable propertyTable = new Hashtable(); + + private readonly ITypeResolver _resolver; + + private BamlRecordType currentType; + + private Stack elements = new Stack(); + private Stack readingElements = new Stack(); + private Stack keysResources = new Stack(); + private NodesCollection nodes = new NodesCollection(); + private List _mappings = new List(); + private XmlBamlNode _currentNode; + + private readonly KnownInfo KnownInfo; + + private int complexPropertyOpened = 0; + + private bool intoAttribute = false; + private bool initialized; + private bool _eof; + + private bool isPartialDefKeysClosed = true; + private bool isDefKeysClosed = true; + + private int bytesToSkip; + + private static readonly MethodInfo staticConvertCustomBinaryToObjectMethod = Type.GetType("System.Windows.Markup.XamlPathDataSerializer,PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35").GetMethod("StaticConvertCustomBinaryToObject", BindingFlags.Static | BindingFlags.Public); + private readonly TypeDeclaration XamlTypeDeclaration; + private readonly XmlNameTable _nameTable = new NameTable(); + private IDictionary _rootNamespaces; + + #endregion + + public XmlBamlReader(Stream stream) : this (stream, AppDomainTypeResolver.GetIntoNewAppDomain(Environment.CurrentDirectory)) + { + + } + + public XmlBamlReader(Stream stream, ITypeResolver resolver) + { + if (stream == null) + throw new ArgumentNullException("stream"); + if (resolver == null) + throw new ArgumentNullException("resolver"); + + _resolver = resolver; + reader = new BamlBinaryReader(stream); + + XamlTypeDeclaration = new TypeDeclaration(this.Resolver, "", "System.Windows.Markup", 0); + KnownInfo = new KnownInfo(resolver); + } + + /// + ///When overridden in a derived class, gets the value of the attribute with the specified . + /// + /// + /// + ///The value of the specified attribute. If the attribute is not found, null is returned. + /// + /// + ///The qualified name of the attribute. + public override string GetAttribute(string name) + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, gets the value of the attribute with the specified and . + /// + /// + /// + ///The value of the specified attribute. If the attribute is not found, null is returned. This method does not move the reader. + /// + /// + ///The namespace URI of the attribute. + ///The local name of the attribute. + public override string GetAttribute(string name, string namespaceURI) + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, gets the value of the attribute with the specified index. + /// + /// + /// + ///The value of the specified attribute. This method does not move the reader. + /// + /// + ///The index of the attribute. The index is zero-based. (The first attribute has index 0.) + public override string GetAttribute(int i) + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, moves to the attribute with the specified . + /// + /// + /// + ///true if the attribute is found; otherwise, false. If false, the reader's position does not change. + /// + /// + ///The qualified name of the attribute. + public override bool MoveToAttribute(string name) + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, moves to the attribute with the specified and . + /// + /// + /// + ///true if the attribute is found; otherwise, false. If false, the reader's position does not change. + /// + /// + ///The local name of the attribute. + ///The namespace URI of the attribute. + public override bool MoveToAttribute(string name, string ns) + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, moves to the first attribute. + /// + /// + /// + ///true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change). + /// + /// + public override bool MoveToFirstAttribute() + { + intoAttribute = false; + if (nodes.Count > 0 && nodes.Peek() is XmlBamlProperty) + { + _currentNode = nodes.Dequeue(); + return true; + } + return false; + } + + /// + ///When overridden in a derived class, moves to the next attribute. + /// + /// + /// + ///true if there is a next attribute; false if there are no more attributes. + /// + /// + public override bool MoveToNextAttribute() + { + intoAttribute = false; + if (nodes.Count > 0 && nodes.Peek() is XmlBamlProperty) + { + _currentNode = nodes.Dequeue(); + return true; + } + return false; + } + + /// + ///When overridden in a derived class, moves to the element that contains the current attribute node. + /// + /// + /// + ///true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change). + /// + /// + public override bool MoveToElement() + { + while (nodes.Peek() is XmlBamlProperty) + { + nodes.Dequeue(); + } + + return true; + } + + /// + ///When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. + /// + /// + /// + ///true if there are nodes to return.false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read.An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty. + /// + /// + public override bool ReadAttributeValue() + { + if (!intoAttribute) + { + intoAttribute = true; + return true; + } + return false; + } + + /// + ///When overridden in a derived class, reads the next node from the stream. + /// + /// + /// + ///true if the next node was read successfully; false if there are no more nodes to read. + /// + /// + ///An error occurred while parsing the XML. + public override bool Read() + { + return ReadInternal(); + } + + private bool ReadInternal() + { + EnsureInit(); + + if (SetNextNode()) + return true; + + try + { + do + { + currentType = (BamlRecordType)reader.ReadByte(); + //Debug.WriteLine(currentType); + if (currentType == BamlRecordType.DocumentEnd) break; + + long position = reader.BaseStream.Position; + + ComputeBytesToSkip(); + ProcessNext(); + + if (bytesToSkip > 0) + { + reader.BaseStream.Position = position + bytesToSkip; + } + } + //while (currentType != BamlRecordType.DocumentEnd); + while (nodes.Count == 0 || (currentType != BamlRecordType.ElementEnd) || complexPropertyOpened > 0); + + return SetNextNode(); + } + catch (EndOfStreamException) + { + _eof = true; + return false; + } + } + + private bool SetNextNode() + { + while (nodes.Count > 0) + { + _currentNode = nodes.Dequeue(); + + if ((_currentNode is XmlBamlProperty)) continue; + + if (this.NodeType == XmlNodeType.EndElement) + { + if (readingElements.Count == 1) + _rootNamespaces = ((IXmlNamespaceResolver)this).GetNamespacesInScope(XmlNamespaceScope.All); + readingElements.Pop(); + } + else if (this.NodeType == XmlNodeType.Element) + readingElements.Push((XmlBamlElement)_currentNode); + + return true; + } + + return false; + } + + private void ProcessNext() + { + switch (currentType) + { + case BamlRecordType.DocumentStart: + { + reader.ReadBoolean(); + reader.ReadInt32(); + reader.ReadBoolean(); + break; + } + case BamlRecordType.DocumentEnd: + break; + case BamlRecordType.ElementStart: + this.ReadElementStart(); + break; + case BamlRecordType.ElementEnd: + this.ReadElementEnd(); + break; + case BamlRecordType.AssemblyInfo: + this.ReadAssemblyInfo(); + break; + case BamlRecordType.StringInfo: + this.ReadStringInfo(); + break; + case BamlRecordType.LineNumberAndPosition: + reader.ReadInt32(); + reader.ReadInt32(); + break; + case BamlRecordType.LinePosition: + reader.ReadInt32(); + break; + case BamlRecordType.XmlnsProperty: + this.ReadXmlnsProperty(); + break; + case BamlRecordType.ConnectionId: + reader.ReadInt32(); + break; + case BamlRecordType.DeferableContentStart: + reader.ReadInt32(); + break; + case BamlRecordType.DefAttribute: + this.ReadDefAttribute(); + break; + case BamlRecordType.DefAttributeKeyType: + this.ReadDefAttributeKeyType(); + break; + case BamlRecordType.DefAttributeKeyString: + this.ReadDefAttributeKeyString(); + break; + case BamlRecordType.AttributeInfo: + this.ReadAttributeInfo(); + break; + case BamlRecordType.PropertyListStart: + this.ReadPropertyListStart(); + break; + case BamlRecordType.PropertyListEnd: + this.ReadPropertyListEnd(); + break; + case BamlRecordType.Property: + this.ReadProperty(); + break; + case BamlRecordType.PropertyWithConverter: + this.ReadPropertyWithConverter(); + break; + case BamlRecordType.PropertyWithExtension: + this.ReadPropertyWithExtension(); + break; + case BamlRecordType.PropertyDictionaryStart: + this.ReadPropertyDictionaryStart(); + break; + case BamlRecordType.PropertyCustom: + this.ReadPropertyCustom(); + break; + case BamlRecordType.PropertyDictionaryEnd: + this.ReadPropertyDictionaryEnd(); + break; + case BamlRecordType.PropertyComplexStart: + this.ReadPropertyComplexStart(); + break; + case BamlRecordType.PropertyComplexEnd: + this.ReadPropertyComplexEnd(); + break; + case BamlRecordType.PIMapping: + this.ReadPIMapping(); + break; + case BamlRecordType.TypeInfo: + this.ReadTypeInfo(); + break; + case BamlRecordType.ContentProperty: + this.ReadContentProperty(); + break; + case BamlRecordType.ConstructorParametersStart: + ReadConstructorParametersStart(); + break; + case BamlRecordType.ConstructorParametersEnd: + ReadConstructorParametersEnd(); + break; + case BamlRecordType.ConstructorParameterType: + this.ReadConstructorParameterType(); + break; + case BamlRecordType.Text: + this.ReadText(); + break; + case BamlRecordType.TextWithConverter: + this.ReadTextWithConverter(); + break; + case BamlRecordType.PropertyWithStaticResourceId: + this.ReadPropertyWithStaticResourceIdentifier(); + break; + case BamlRecordType.OptimizedStaticResource: + this.ReadOptimizedStaticResource(); + break; + case BamlRecordType.KeyElementStart: + this.ReadKeyElementStart(); + break; + case BamlRecordType.KeyElementEnd: + this.ReadKeyElementEnd(); + break; + case BamlRecordType.PropertyTypeReference: + this.ReadPropertyTypeReference(); + break; + case BamlRecordType.StaticResourceStart: + ReadStaticResourceStart(); + break; + case BamlRecordType.StaticResourceEnd: + ReadStaticResourceEnd(); + break; + case BamlRecordType.StaticResourceId: + ReadStaticResourceId(); + break; + case BamlRecordType.PresentationOptionsAttribute: + this.ReadPresentationOptionsAttribute(); + break; + default: + break; + } + } + + private void ComputeBytesToSkip() + { + bytesToSkip = 0; + switch (currentType) + { + case BamlRecordType.PropertyWithConverter: + case BamlRecordType.DefAttributeKeyString: + case BamlRecordType.PresentationOptionsAttribute: + case BamlRecordType.Property: + case BamlRecordType.PropertyCustom: + case BamlRecordType.Text: + case BamlRecordType.TextWithConverter: + case BamlRecordType.XmlnsProperty: + case BamlRecordType.DefAttribute: + case BamlRecordType.PIMapping: + case BamlRecordType.AssemblyInfo: + case BamlRecordType.TypeInfo: + case BamlRecordType.AttributeInfo: + case BamlRecordType.StringInfo: + bytesToSkip = reader.ReadCompressedInt32(); + break; + } + } + + private void EnsureInit() + { + if (!initialized) + { + int startChars = reader.ReadInt32(); + String type = new String(new BinaryReader(this.reader.BaseStream, Encoding.Unicode).ReadChars(startChars >> 1)); + if (type != "MSBAML") + throw new NotSupportedException("Not a MS BAML"); + + int r = reader.ReadInt32(); + int s = reader.ReadInt32(); + int t = reader.ReadInt32(); + if (((r != 0x600000) || (s != 0x600000)) || (t != 0x600000)) + throw new NotSupportedException(); + + initialized = true; + } + } + + /// + ///When overridden in a derived class, changes the to Closed. + /// + /// + public override void Close() + { + //if (reader != null) + // reader.Close(); + reader = null; + } + + /// + ///When overridden in a derived class, resolves a namespace prefix in the current element's scope. + /// + /// + /// + ///The namespace URI to which the prefix maps or null if no matching prefix is found. + /// + /// + ///The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string. + public override string LookupNamespace(string prefix) + { + if (readingElements.Count == 0) return null; + + XmlNamespaceCollection namespaces = readingElements.Peek().Namespaces; + + for (int x = 0; x < namespaces.Count; x++) + { + if (String.CompareOrdinal(namespaces[x].Prefix, prefix) == 0) + return namespaces[x].Namespace; + } + + return null; + } + + /// + ///When overridden in a derived class, resolves the entity reference for EntityReference nodes. + /// + /// + ///The reader is not positioned on an EntityReference node; this implementation of the reader cannot resolve entities ( returns false). + public override void ResolveEntity() + { + throw new NotImplementedException(); + } + + /// + ///When overridden in a derived class, gets the type of the current node. + /// + /// + /// + ///One of the values representing the type of the current node. + /// + /// + public override XmlNodeType NodeType + { + get + { + if (intoAttribute) return XmlNodeType.Text; + + return this.CurrentNode.NodeType; + } + } + + /// + ///When overridden in a derived class, gets the local name of the current node. + /// + /// + /// + ///The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>.For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty. + /// + /// + public override string LocalName + { + get + { + if (intoAttribute) return String.Empty; + + String localName = String.Empty; + + XmlBamlNode node = this.CurrentNode; + if (node is XmlBamlProperty) + { + PropertyDeclaration pd = ((XmlBamlProperty)node).PropertyDeclaration; + localName = FormatPropertyDeclaration(pd, false, true, true); + } + else if (node is XmlBamlPropertyElement) + { + XmlBamlPropertyElement property = (XmlBamlPropertyElement)node; + localName = String.Format("{0}.{1}", property.TypeDeclaration.Name, property.PropertyDeclaration.Name); + } + else if (node is XmlBamlElement) + localName = ((XmlBamlElement)node).TypeDeclaration.Name; + + localName = this.NameTable.Add(localName); + + return localName; + } + } + + private PropertyDeclaration GetPropertyDeclaration(short identifier) + { + PropertyDeclaration declaration; + if (identifier >= 0) + { + declaration = (PropertyDeclaration)this.propertyTable[identifier]; + } + else + { + declaration = KnownInfo.KnownPropertyTable[-identifier]; + } + if (declaration == null) + { + throw new NotSupportedException(); + } + return declaration; + } + + private object GetResourceName(short identifier) + { + if (identifier >= 0) + { + PropertyDeclaration declaration = (PropertyDeclaration)this.propertyTable[identifier]; + return declaration; + } + else + { + identifier = (short)-identifier; + bool isNotKey = (identifier > 0xe8); + if (isNotKey) + identifier = (short)(identifier - 0xe8); + ResourceName resource = (ResourceName) KnownInfo.KnownResourceTable[(int)identifier]; + if (!isNotKey) + return new ResourceName(resource.Name + "Key"); + return resource; + } + } + + private void ReadPropertyDictionaryStart() + { + short identifier = reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + XmlBamlElement element = elements.Peek(); + XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.Dictionary, pd); + elements.Push(property); + nodes.Enqueue(property); + + isDefKeysClosed = true; + isPartialDefKeysClosed = true; + } + + private void ReadPropertyDictionaryEnd() + { + keysResources.Pop(); + + CloseElement(); + } + + private void ReadPropertyCustom() + { + short identifier = reader.ReadInt16(); + short serializerTypeId = reader.ReadInt16(); + bool isValueTypeId = (serializerTypeId & 0x4000) == 0x4000; + if (isValueTypeId) + serializerTypeId = (short)(serializerTypeId & ~0x4000); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + string value; + switch (serializerTypeId) + { + case 0x2e8: + value = new BrushConverter().ConvertToString(SolidColorBrush.DeserializeFrom(reader)); + break; + case 0x2e9: + value = new Int32CollectionConverter().ConvertToString(DeserializeInt32CollectionFrom(reader)); + break; + case 0x89: + + short typeIdentifier = reader.ReadInt16(); + if (isValueTypeId) + { + TypeDeclaration typeDeclaration = this.GetTypeDeclaration(typeIdentifier); + string name = reader.ReadString(); + value = FormatPropertyDeclaration(new PropertyDeclaration(name, typeDeclaration), true, false, true); + } + else + value = FormatPropertyDeclaration(this.GetPropertyDeclaration(typeIdentifier), true, false, true); + break; + + case 0x2ea: + value = ((IFormattable)staticConvertCustomBinaryToObjectMethod.Invoke(null, new object[] { this.reader })).ToString("G", CultureInfo.InvariantCulture); + break; + case 0x2eb: + case 0x2f0: + value = Deserialize3DPoints(); + break; + case 0x2ec: + value = DeserializePoints(); + break; + case 0xc3: + // Enum + uint num = reader.ReadUInt32(); + value = num.ToString(); + break; + case 0x2e: + int b = reader.ReadByte(); + value = (b == 1) ? Boolean.TrueString : Boolean.FalseString; + break; + default: + return; + } + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = value; + + nodes.Enqueue(property); + } + + private string DeserializePoints() + { + using (StringWriter writer = new StringWriter()) + { + int num10 = reader.ReadInt32(); + for (int k = 0; k < num10; k++) + { + if (k != 0) + writer.Write(" "); + for (int m = 0; m < 2; m++) + { + if (m != 0) + writer.Write(","); + writer.Write(reader.ReadCompressedDouble().ToString()); + } + } + return writer.ToString(); + } + } + + private String Deserialize3DPoints() + { + using (StringWriter writer = new StringWriter()) + { + int num14 = reader.ReadInt32(); + for (int i = 0; i < num14; i++) + { + if (i != 0) + { + writer.Write(" "); + } + for (int j = 0; j < 3; j++) + { + if (j != 0) + { + writer.Write(","); + } + writer.Write(reader.ReadCompressedDouble().ToString()); + } + } + return writer.ToString(); + } + } + + private static Int32Collection DeserializeInt32CollectionFrom(BinaryReader reader) + { + IntegerCollectionType type = (IntegerCollectionType)reader.ReadByte(); + int capacity = reader.ReadInt32(); + if (capacity < 0) + throw new ArgumentException(); + + Int32Collection ints = new Int32Collection(capacity); + switch (type) + { + case IntegerCollectionType.Byte: + for (int i = 0; i < capacity; i++) + { + ints.Add(reader.ReadByte()); + } + return ints; + + case IntegerCollectionType.UShort: + for (int j = 0; j < capacity; j++) + { + ints.Add(reader.ReadUInt16()); + } + return ints; + + case IntegerCollectionType.Integer: + for (int k = 0; k < capacity; k++) + { + int num7 = reader.ReadInt32(); + ints.Add(num7); + } + return ints; + + case IntegerCollectionType.Consecutive: + for (int m = reader.ReadInt32(); m < capacity; m++) + { + ints.Add(m); + } + return ints; + } + throw new ArgumentException(); + } + + private void ReadPropertyWithExtension() + { + short identifier = reader.ReadInt16(); + short x = reader.ReadInt16(); + short valueIdentifier = reader.ReadInt16(); + bool isValueType = (x & 0x4000) == 0x4000; + bool isStaticType = (x & 0x2000) == 0x2000; + x = (short)(x & 0xfff); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + short extensionIdentifier = (short)-(x & 0xfff); + string value = String.Empty; + + switch (x) + { + case 0x25a: + // StaticExtension + object resource = this.GetResourceName(valueIdentifier); + if (resource is ResourceName) + value = this.GetStaticExtension(((ResourceName)resource).Name); + else if (resource is PropertyDeclaration) + value = this.GetStaticExtension(FormatPropertyDeclaration(((PropertyDeclaration)resource), true, false, false)); + break; + case 0x25b: // StaticResource + case 0xbd: // DynamicResource + if (isValueType) + { + value = this.GetTypeExtension(valueIdentifier); + } + else if (isStaticType) + { + TypeDeclaration extensionDeclaration = this.GetTypeDeclaration(extensionIdentifier); + value = GetExtension(extensionDeclaration, GetStaticExtension(GetResourceName(valueIdentifier).ToString())); + } + else + { + TypeDeclaration extensionDeclaration = this.GetTypeDeclaration(extensionIdentifier); + value = GetExtension(extensionDeclaration, (string)this.stringTable[valueIdentifier]); + } + break; + + case 0x27a: + // TemplateBinding + PropertyDeclaration pdValue = this.GetPropertyDeclaration(valueIdentifier); + value = GetTemplateBindingExtension(pdValue); + break; + default: + throw new NotSupportedException("Unknown property with extension"); + } + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = value; + + nodes.Enqueue(property); + } + + private void ReadProperty() + { + short identifier = reader.ReadInt16(); + string text = reader.ReadString(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = text; + + nodes.Enqueue(property); + } + + private void ReadPropertyWithConverter() + { + short identifier = reader.ReadInt16(); + string text = reader.ReadString(); + reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = text; + + nodes.Enqueue(property); + } + + private void ReadAttributeInfo() + { + short key = reader.ReadInt16(); + short identifier = reader.ReadInt16(); + reader.ReadByte(); + string name = reader.ReadString(); + TypeDeclaration declaringType = this.GetTypeDeclaration(identifier); + PropertyDeclaration declaration2 = new PropertyDeclaration(name, declaringType); + this.propertyTable.Add(key, declaration2); + } + + private void ReadDefAttributeKeyType() + { + short typeIdentifier = reader.ReadInt16(); + reader.ReadByte(); + int position = reader.ReadInt32(); + // TODO: shared + bool shared = reader.ReadBoolean(); + bool sharedSet = reader.ReadBoolean(); + + // TODO: handle shared + AddDefKey(position, this.GetTypeExtension(typeIdentifier)); + } + + private void ReadDefAttribute() + { + string text = reader.ReadString(); + short identifier = reader.ReadInt16(); + + PropertyDeclaration pd; + switch (identifier) + { + case -2: + pd = new PropertyDeclaration("Uid", XamlTypeDeclaration); + break; + case -1: + pd = new PropertyDeclaration("Name", XamlTypeDeclaration); + break; + default: + string recordName = (string)this.stringTable[identifier]; + if (recordName != "Key") throw new NotSupportedException(recordName); + pd = new PropertyDeclaration(recordName, XamlTypeDeclaration); + + AddDefKey(-1, text); + break; + } + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Key, pd); + property.Value = text; + + nodes.Enqueue(property); + } + + private void ReadDefAttributeKeyString() + { + short num = reader.ReadInt16(); + int position = reader.ReadInt32(); + //bool shared = reader.ReadBoolean(); + //bool sharedSet = reader.ReadBoolean(); + string text = (string)this.stringTable[num]; + if (text == null) + throw new NotSupportedException(); + + AddDefKey(position, text); + } + + private void AddDefKey(long position, string text) + { + // Guardo se la dichiarazione delle chiavi risulta chiusa + // Se è aperta c'è un sotto ResourceDictionary oppure è il root ResourceDictionary + if (isDefKeysClosed) + { + keysResources.Push(new KeysResourcesCollection()); + } + + // Guardo se è stata chiusa la dichiarazione parziale (mediante dichiarazione OptimizedStaticResource) + // Si chiude il ciclo di chiavi + if (isPartialDefKeysClosed) + { + keysResources.Peek().Add(new KeysResource()); + } + isDefKeysClosed = false; + isPartialDefKeysClosed = false; + + // TODO: handle shared + if (position >= 0) + keysResources.Peek().Last.Keys[position] = text; + } + + private void ReadXmlnsProperty() + { + string prefix = reader.ReadString(); + string @namespace = reader.ReadString(); + string[] textArray = new string[(uint)reader.ReadInt16()]; + for (int i = 0; i < textArray.Length; i++) + { + textArray[i] = (string)this.assemblyTable[reader.ReadInt16()]; + } + + XmlNamespaceCollection namespaces = elements.Peek().Namespaces; + // Mapping locale, ci aggiunto l'assembly + if (@namespace.StartsWith("clr-namespace:") && @namespace.IndexOf("assembly=") < 0) + { + XmlPIMapping mappingToChange = null; + foreach (XmlPIMapping mapping in this.Mappings) + { + if (String.CompareOrdinal(mapping.XmlNamespace, @namespace) == 0) + { + mappingToChange = mapping; + break; + } + } + if (mappingToChange == null) + throw new InvalidOperationException("Cannot find mapping"); + + @namespace = String.Format("{0};assembly={1}", @namespace, GetAssembly(mappingToChange.AssemblyId).Replace(" ", "")); + mappingToChange.XmlNamespace = @namespace; + } + namespaces.Add(new XmlNamespace(prefix, @namespace)); + } + + private void ReadElementEnd() + { + CloseElement(); + + // Provvedo all'eliminazione del gruppo di chiavi se sono sul root ResourceDictionary + // e si è chiuso uno degli elementi di primo livello e tutte le chiavi sono state usate + // Passo alla prossima lista + KeysResource keysResource = (elements.Count == 1 && keysResources.Count > 0) ? keysResources.Peek().First : null; + if (keysResource != null && keysResource.Keys.Count == 0) + keysResources.Peek().RemoveAt(0); + } + + private void ReadPropertyComplexStart() + { + short identifier = reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + XmlBamlElement element = FindXmlBamlElement(); + + XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.Complex, pd); + elements.Push(property); + nodes.Enqueue(property); + complexPropertyOpened++; + } + + private XmlBamlElement FindXmlBamlElement() + { + return elements.Peek(); + + //XmlBamlElement element; + //int x = nodes.Count - 1; + //do + //{ + // element = nodes[x] as XmlBamlElement; + // x--; + //} while (element == null); + //return element; + } + + private void ReadPropertyListStart() + { + short identifier = reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + XmlBamlElement element = FindXmlBamlElement(); + XmlBamlPropertyElement property = new XmlBamlPropertyElement(element, PropertyType.List, pd); + elements.Push(property); + nodes.Enqueue(property); + } + + private void ReadPropertyListEnd() + { + CloseElement(); + } + + private void ReadPropertyComplexEnd() + { + XmlBamlPropertyElement propertyElement = (XmlBamlPropertyElement) elements.Peek(); + + CloseElement(); + + complexPropertyOpened--; + // Valuto se contiene tutte extension + int start = nodes.IndexOf(propertyElement) + 1; + IEnumerator enumerator = nodes.GetEnumerator(); + + int c = 0; + while (c < start && enumerator.MoveNext()) + c++; + + if (IsExtension(enumerator)) + { + start--; + nodes.RemoveAt(start); + nodes.RemoveLast(); + + StringBuilder sb = new StringBuilder(); + FormatElementExtension((XmlBamlElement) nodes[start], sb); + + XmlBamlProperty property = + new XmlBamlProperty(PropertyType.Complex, propertyElement.PropertyDeclaration); + property.Value = sb.ToString(); + nodes.Add(property); + + return; + } + } + + private void FormatElementExtension(XmlBamlElement element, StringBuilder sb) + { + sb.Append("{"); + sb.Append(FormatTypeDeclaration(element.TypeDeclaration)); + + int start = nodes.IndexOf(element); + nodes.RemoveAt(start); + + string sep = " "; + while (nodes.Count > start) + { + XmlBamlNode node = nodes[start]; + + if (node is XmlBamlEndElement) + { + sb.Append("}"); + nodes.RemoveAt(start); + break; + } + else if (node is XmlBamlPropertyElement) + { + nodes.RemoveAt(start); + + sb.Append(sep); + XmlBamlPropertyElement property = (XmlBamlPropertyElement)node; + sb.Append(property.PropertyDeclaration.Name); + sb.Append("="); + + node = nodes[start]; + nodes.RemoveLast(); + FormatElementExtension((XmlBamlElement)node, sb); + } + else if (node is XmlBamlElement) + { + sb.Append(sep); + FormatElementExtension((XmlBamlElement)node, sb); + } + else if (node is XmlBamlProperty) + { + nodes.RemoveAt(start); + + sb.Append(sep); + XmlBamlProperty property = (XmlBamlProperty)node; + sb.Append(property.PropertyDeclaration.Name); + sb.Append("="); + sb.Append(property.Value); + } + else if (node is XmlBamlText) + { + nodes.RemoveAt(start); + + sb.Append(sep); + sb.Append(((XmlBamlText)node).Text); + } + sep = ","; + } + } + + private static bool IsExtension(IEnumerator enumerator) + { + bool r = true; + while (enumerator.MoveNext() && r) + { + object node = enumerator.Current; + if (node is XmlBamlElement && !(node is XmlBamlEndElement) && !((XmlBamlElement)node).TypeDeclaration.IsExtension) + { + r = false; + } + } + + return r; + } + + private void CloseElement() + { + nodes.Enqueue(new XmlBamlEndElement(elements.Pop())); + } + + private void ReadElementStart() + { + short identifier = reader.ReadInt16(); + reader.ReadByte(); + TypeDeclaration declaration = GetTypeDeclaration(identifier); + + XmlBamlElement element; + XmlBamlElement parentElement = null; + if (elements.Count > 0) + { + parentElement = elements.Peek(); + element = new XmlBamlElement(parentElement); + element.Position = this.reader.BaseStream.Position; + + // Porto l'inizio del padre all'inizio del primo figlio + if (parentElement.Position == 0 && complexPropertyOpened == 0) + parentElement.Position = element.Position; + } + else + element = new XmlBamlElement(); + + element.TypeDeclaration = declaration; + elements.Push(element); + nodes.Enqueue(element); + + if (parentElement != null && complexPropertyOpened == 0) + { + // Calcolo la posizione dell'elemento rispetto al padre + long position = element.Position - parentElement.Position; + KeysResource keysResource = (keysResources.Count > 0) ? keysResources.Peek().First : null; + if (keysResource != null && keysResource.Keys.HasKey(position)) + { + string key = keysResource.Keys[position]; + // Rimuovo la chiave perché è stata usata + keysResource.Keys.Remove(position); + + AddKeyToElement(key); + } + } + } + + private void AddKeyToElement(string key) + { + PropertyDeclaration pd = new PropertyDeclaration("Key", XamlTypeDeclaration); + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Key, pd); + + property.Value = key; + + nodes.Enqueue(property); + } + + private XmlPIMapping FindByClrNamespaceAndAssemblyId(TypeDeclaration declaration) + { + return FindByClrNamespaceAndAssemblyId(declaration.Namespace, declaration.AssemblyId); + } + + private XmlPIMapping FindByClrNamespaceAndAssemblyId(string clrNamespace, int assemblyId) + { + if (clrNamespace == XamlTypeDeclaration.Namespace && assemblyId == XamlTypeDeclaration.AssemblyId) + return new XmlPIMapping(XmlPIMapping.XamlNamespace, 0, clrNamespace); + + for (int x = 0; x < Mappings.Count; x++) + { + XmlPIMapping xp = Mappings[x]; + if (xp.AssemblyId == assemblyId && String.CompareOrdinal(xp.ClrNamespace, clrNamespace) == 0) + return xp; + } + + return null; + } + + private void ReadPIMapping() + { + string xmlNamespace = reader.ReadString(); + string clrNamespace = reader.ReadString(); + short assemblyId = reader.ReadInt16(); + + Mappings.Add(new XmlPIMapping(xmlNamespace, assemblyId, clrNamespace)); + } + + private void ReadContentProperty() + { + reader.ReadInt16(); + + // Non serve aprire niente, è il default + } + + private static void ReadConstructorParametersStart() + { + //this.constructorParameterTable.Add(this.elements.Peek()); + //PromoteDataToComplexProperty(); + } + + private static void ReadConstructorParametersEnd() + { + //this.constructorParameterTable.Remove(this.elements.Peek()); + //properties.Pop(); + } + + private void ReadConstructorParameterType() + { + short identifier = reader.ReadInt16(); + + //TypeDeclaration declaration = GetTypeDeclaration(identifier); + nodes.Enqueue(new XmlBamlText(GetTypeExtension(identifier))); + } + + private void ReadText() + { + string text = reader.ReadString(); + + nodes.Enqueue(new XmlBamlText(text)); + } + + private void ReadKeyElementStart() + { + short typeIdentifier = reader.ReadInt16(); + byte valueIdentifier = reader.ReadByte(); + // TODO: handle shared + //bool shared = (valueIdentifier & 1) != 0; + //bool sharedSet = (valueIdentifier & 2) != 0; + int position = reader.ReadInt32(); + reader.ReadBoolean(); + reader.ReadBoolean(); + + TypeDeclaration declaration = this.GetTypeDeclaration(typeIdentifier); + + XmlBamlPropertyElement property = new XmlBamlPropertyElement(elements.Peek(), PropertyType.Key, new PropertyDeclaration("Key", declaration)); + property.Position = position; + elements.Push(property); + nodes.Enqueue(property); + complexPropertyOpened++; + } + + private void ReadKeyElementEnd() + { + XmlBamlPropertyElement propertyElement = (XmlBamlPropertyElement)elements.Peek(); + + CloseElement(); + complexPropertyOpened--; + if (complexPropertyOpened == 0) + { + + int start = nodes.IndexOf(propertyElement); + + StringBuilder sb = new StringBuilder(); + FormatElementExtension((XmlBamlElement)nodes[start], sb); + AddDefKey(propertyElement.Position, sb.ToString()); + } + } + + private static void ReadStaticResourceStart() + { + //short identifier = reader.ReadInt16(); + //byte n = reader.ReadByte(); + //TypeDeclaration declaration = this.GetTypeDeclaration(identifier); + //this.staticResourceTable.Add(declaration); + + throw new NotImplementedException("StaticResourceStart"); + } + + private static void ReadStaticResourceEnd() + { + throw new NotImplementedException("ReadStaticResourceEnd"); + } + + private static void ReadStaticResourceId() + { + //short identifier = reader.ReadInt16(); + //object staticResource = this.GetStaticResource(identifier); + //TypeDeclaration declaration = this.GetTypeDeclaration(-603); + + throw new NotImplementedException("StaticResourceId"); + } + + private void ReadPresentationOptionsAttribute() + { + string text = reader.ReadString(); + short valueIdentifier = reader.ReadInt16(); + + PropertyDeclaration pd = new PropertyDeclaration(this.stringTable[valueIdentifier].ToString()); + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = text; + } + + private void ReadPropertyTypeReference() + { + short identifier = reader.ReadInt16(); + short typeIdentifier = reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + string value = this.GetTypeExtension(typeIdentifier); + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = value; + + nodes.Enqueue(property); + } + + private void ReadOptimizedStaticResource() + { + byte num = reader.ReadByte(); + short typeIdentifier = reader.ReadInt16(); + bool isValueType = (num & 1) == 1; + bool isStaticType = (num & 2) == 2; + object resource; + + if (isValueType) + resource = this.GetTypeExtension(typeIdentifier); + else if (isStaticType) + { + ResourceName resourceName = (ResourceName)this.GetResourceName(typeIdentifier); + resource = GetStaticExtension(resourceName.Name); + } + else + { + resource = this.stringTable[typeIdentifier]; + } + + //this.staticResourceTable.Add(resource); + isPartialDefKeysClosed = true; + // Aggiungo la risorsa nell'ultimo gruppo + keysResources.Peek().Last.StaticResources.Add(resource); + } + + private string GetTemplateBindingExtension(PropertyDeclaration propertyDeclaration) + { + return String.Format("{{TemplateBinding {0}}}", FormatPropertyDeclaration(propertyDeclaration, true, false, false)); + } + + private string GetStaticExtension(string name) + { + string prefix = this.LookupPrefix(XmlPIMapping.XamlNamespace, false); + if (String.IsNullOrEmpty(prefix)) + return String.Format("{{Static {0}}}", name); + else + return String.Format("{{{0}:Static {1}}}", prefix, name); + } + + private string GetExtension(TypeDeclaration declaration, string value) + { + return String.Format("{{{0} {1}}}", FormatTypeDeclaration(declaration), value); + } + + private string GetTypeExtension(short typeIdentifier) + { + string prefix = this.LookupPrefix(XmlPIMapping.XamlNamespace, false); + if (String.IsNullOrEmpty(prefix)) + return String.Format("{{Type {0}}}", FormatTypeDeclaration(GetTypeDeclaration(typeIdentifier))); + else + return String.Format("{{{0}:Type {1}}}", prefix, FormatTypeDeclaration(GetTypeDeclaration(typeIdentifier))); + } + + private string FormatTypeDeclaration(TypeDeclaration typeDeclaration) + { + XmlPIMapping mapping = FindByClrNamespaceAndAssemblyId(typeDeclaration.Namespace, typeDeclaration.AssemblyId); + string prefix = (mapping != null) ? this.LookupPrefix(mapping.XmlNamespace, false) : null; + string name = typeDeclaration.Name; + if (name.EndsWith("Extension")) + name = name.Substring(0, name.Length - 9); + if (String.IsNullOrEmpty(prefix)) + return name; + else + return String.Format("{0}:{1}", prefix, name); + } + + + + private string FormatPropertyDeclaration(PropertyDeclaration propertyDeclaration, bool withPrefix, bool useReading, bool checkType) + { + StringBuilder sb = new StringBuilder(); + + TypeDeclaration elementDeclaration = (useReading) ? readingElements.Peek().TypeDeclaration : elements.Peek().TypeDeclaration; + + IDependencyPropertyDescriptor descriptor = null; + bool areValidTypes = elementDeclaration.Type != null && propertyDeclaration.DeclaringType.Type != null; + if (areValidTypes) + descriptor = this.Resolver.GetDependencyPropertyDescriptor(propertyDeclaration.Name, elementDeclaration.Type, propertyDeclaration.DeclaringType.Type); + + bool isDescendant = (areValidTypes && (propertyDeclaration.DeclaringType.Type.Equals(elementDeclaration.Type) || elementDeclaration.Type.IsSubclassOf(propertyDeclaration.DeclaringType.Type))); + bool isAttached = (descriptor != null && descriptor.IsAttached); + bool differentType = ((propertyDeclaration.DeclaringType != propertyDeclaration.DeclaringType || !isDescendant)); + + if (withPrefix) + { + XmlPIMapping mapping = FindByClrNamespaceAndAssemblyId(propertyDeclaration.DeclaringType.Namespace, propertyDeclaration.DeclaringType.AssemblyId); + string prefix = (mapping != null) ? this.LookupPrefix(mapping.XmlNamespace, false) : null; + + if (!String.IsNullOrEmpty(prefix)) + { + sb.Append(prefix); + sb.Append(":"); + } + } + if ((differentType || isAttached || !checkType) && propertyDeclaration.DeclaringType.Name.Length > 0) + { + sb.Append(propertyDeclaration.DeclaringType.Name); + sb.Append("."); + } + sb.Append(propertyDeclaration.Name); + + return sb.ToString(); + } + + private void ReadPropertyWithStaticResourceIdentifier() + { + short identifier = reader.ReadInt16(); + short staticIdentifier = reader.ReadInt16(); + + PropertyDeclaration pd = this.GetPropertyDeclaration(identifier); + object staticResource = this.GetStaticResource(staticIdentifier); + + string prefix = this.LookupPrefix(XmlPIMapping.PresentationNamespace, false); + string value = String.Format("{{{0}{1}StaticResource {2}}}", prefix, (String.IsNullOrEmpty(prefix)) ? String.Empty : ":", staticResource); + + XmlBamlProperty property = new XmlBamlProperty(PropertyType.Value, pd); + property.Value = value; + + nodes.Enqueue(property); + } + + + private object GetStaticResource(short identifier) + { + // Recupero la risorsa nel gruppo corrente + foreach (KeysResourcesCollection resource in keysResources) + { + // TODO: controllare. Se non lo trova nel gruppo corrente, va in quello successivo + for (int x = 0; x < resource.Count; x++) + { + KeysResource resourceGroup = resource[x]; + if (resourceGroup.StaticResources.Count > identifier) + if (x > 0) + break; + //return "%" + resourceGroup.StaticResources[identifier] + "%"; + else + return resourceGroup.StaticResources[identifier]; + } + } + + //return "???"; + throw new ArgumentException("Cannot find StaticResource", "identifier"); + } + + private void ReadTextWithConverter() + { + string text = reader.ReadString(); + reader.ReadInt16(); + + nodes.Enqueue(new XmlBamlText(text)); + } + + private void ReadTypeInfo() + { + short typeId = reader.ReadInt16(); + short assemblyId = reader.ReadInt16(); + string fullName = reader.ReadString(); + assemblyId = (short)(assemblyId & 0xfff); + TypeDeclaration declaration; + int length = fullName.LastIndexOf('.'); + if (length != -1) + { + string name = fullName.Substring(length + 1); + string namespaceName = fullName.Substring(0, length); + declaration = new TypeDeclaration(this, this.Resolver, name, namespaceName, assemblyId, false); + } + else + { + declaration = new TypeDeclaration(this, this.Resolver, fullName, string.Empty, assemblyId, false); + } + this.typeTable.Add(typeId, declaration); + } + + private void ReadAssemblyInfo() + { + short key = reader.ReadInt16(); + string text = reader.ReadString(); + this.assemblyTable.Add(key, text); + } + + private void ReadStringInfo() + { + short key = reader.ReadInt16(); + string text = reader.ReadString(); + this.stringTable.Add(key, text); + } + + private TypeDeclaration GetTypeDeclaration(short identifier) + { + TypeDeclaration declaration; + if (identifier >= 0) + declaration = (TypeDeclaration)this.typeTable[identifier]; + else + declaration = KnownInfo.KnownTypeTable[-identifier]; + + if (declaration == null) + throw new NotSupportedException(); + + return declaration; + } + + internal string GetAssembly(short identifier) + { + return this.assemblyTable[identifier].ToString(); + } + + private XmlBamlNode CurrentNode + { + get + { + return _currentNode; + } + } + + /// + ///When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned. + /// + /// + /// + ///The namespace URI of the current node; otherwise an empty string. + /// + /// + public override string NamespaceURI + { + get + { + if (intoAttribute) return String.Empty; + + TypeDeclaration declaration; + XmlBamlNode node = this.CurrentNode; + if (node is XmlBamlProperty) + { + declaration = ((XmlBamlProperty)node).PropertyDeclaration.DeclaringType; + TypeDeclaration elementDeclaration = this.readingElements.Peek().TypeDeclaration; + + XmlPIMapping propertyMapping = FindByClrNamespaceAndAssemblyId(declaration) ?? XmlPIMapping.Presentation; + XmlPIMapping elementMapping = FindByClrNamespaceAndAssemblyId(elementDeclaration) ?? XmlPIMapping.Presentation; + if (String.CompareOrdinal(propertyMapping.XmlNamespace, elementMapping.XmlNamespace) == 0 + || (elementDeclaration.Type != null && declaration.Type != null && elementDeclaration.Type.IsSubclassOf(declaration.Type))) + return String.Empty; + } + else if (node is XmlBamlElement) + declaration = ((XmlBamlElement)node).TypeDeclaration; + else + return String.Empty; + + XmlPIMapping mapping = FindByClrNamespaceAndAssemblyId(declaration); + if (mapping == null) + mapping = XmlPIMapping.Presentation; + + return mapping.XmlNamespace; + } + } + + /// + ///When overridden in a derived class, gets the namespace prefix associated with the current node. + /// + /// + /// + ///The namespace prefix associated with the current node. + /// + /// + public override string Prefix + { + get + { + if (!intoAttribute) + return ((IXmlNamespaceResolver)this).LookupPrefix(this.NamespaceURI) ?? String.Empty; + return String.Empty; + } + } + + /// + ///When overridden in a derived class, gets a value indicating whether the current node can have a . + /// + /// + /// + ///true if the node on which the reader is currently positioned can have a Value; otherwise, false. If false, the node has a value of String.Empty. + /// + /// + public override bool HasValue + { + get { return this.Value != null; } + } + + /// + /// Returns object used to resolve types + /// + public ITypeResolver Resolver + { + get { return _resolver; } + } + + /// + ///When overridden in a derived class, gets the text value of the current node. + /// + /// + /// + ///The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty.Node type Value AttributeThe value of the attribute. CDATAThe content of the CDATA section. CommentThe content of the comment. DocumentTypeThe internal subset. ProcessingInstructionThe entire content, excluding the target. SignificantWhitespaceThe white space between markup in a mixed content model. TextThe content of the text node. WhitespaceThe white space between markup. XmlDeclarationThe content of the declaration. + /// + /// + public override string Value + { + get + { + XmlBamlNode node = this.CurrentNode; + if (node is XmlBamlProperty) + return ((XmlBamlProperty)node).Value.ToString(); + else if (node is XmlBamlText) + return ((XmlBamlText)node).Text; + else if (node is XmlBamlElement) + return String.Empty; + + return String.Empty; + } + } + + /// + /// Return root namespaces + /// + public IDictionary RootNamespaces + { + get { return _rootNamespaces; } + } + + /// + ///When overridden in a derived class, gets the depth of the current node in the XML document. + /// + /// + /// + ///The depth of the current node in the XML document. + /// + /// + public override int Depth + { + get { return this.readingElements.Count; } + } + + /// + ///When overridden in a derived class, gets the base URI of the current node. + /// + /// + /// + ///The base URI of the current node. + /// + /// + public override string BaseURI + { + get { return String.Empty; } + } + + /// + ///When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, <MyElement/>). + /// + /// + /// + ///true if the current node is an element ( equals XmlNodeType.Element) that ends with />; otherwise, false. + /// + /// + public override bool IsEmptyElement + { + get { return false; } + } + + //public override bool IsDefault + //{ + // get + // { + // return this.NamespaceURI == null; + // } + //} + + /// + ///When overridden in a derived class, gets the number of attributes on the current node. + /// + /// + /// + ///The number of attributes on the current node. + /// + /// + public override int AttributeCount + { + get { throw new NotImplementedException(); } + } + + /// + ///When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream. + /// + /// + /// + ///true if the reader is positioned at the end of the stream; otherwise, false. + /// + /// + public override bool EOF + { + get { return _eof; } + } + + /// + ///When overridden in a derived class, gets the state of the reader. + /// + /// + /// + ///One of the values. + /// + /// + public override ReadState ReadState + { + get + { + if (!initialized) + return ReadState.Initial; + else if (reader == null) + return ReadState.Closed; + else if (this.EOF) + return ReadState.EndOfFile; + else + return ReadState.Interactive; + } + } + + public List Mappings + { + get { return _mappings; } + } + + /// + ///When overridden in a derived class, gets the associated with this implementation. + /// + /// + /// + ///The XmlNameTable enabling you to get the atomized version of a string within the node. + /// + /// + public override XmlNameTable NameTable + { + get { return _nameTable; } + } + + #region IXmlNamespaceResolver Members + + /// + ///Gets a collection of defined prefix-namespace Mappings that are currently in scope. + /// + /// + /// + ///An that contains the current in-scope namespaces. + /// + /// + ///An value that specifies the type of namespace nodes to return. + IDictionary IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope) + { + XmlNamespaceCollection namespaces = readingElements.Peek().Namespaces; + Dictionary list = new Dictionary(); + foreach (XmlNamespace ns in namespaces) + { + list.Add(ns.Prefix, ns.Namespace); + } + + return list; + } + + /// + ///Gets the namespace URI mapped to the specified prefix. + /// + /// + /// + ///The namespace URI that is mapped to the prefix; null if the prefix is not mapped to a namespace URI. + /// + /// + ///The prefix whose namespace URI you wish to find. + string IXmlNamespaceResolver.LookupNamespace(string prefix) + { + return this.LookupNamespace(prefix); + } + + /// + ///Gets the prefix that is mapped to the specified namespace URI. + /// + /// + /// + ///The prefix that is mapped to the namespace URI; null if the namespace URI is not mapped to a prefix. + /// + /// + ///The namespace URI whose prefix you wish to find. + string IXmlNamespaceResolver.LookupPrefix(string namespaceName) + { + return this.LookupPrefix(namespaceName, true); + } + + private string LookupPrefix(string namespaceName, bool useReading) + { + Stack elements; + if (useReading) + elements = readingElements; + else + elements = this.elements; + + if (elements.Count == 0) return null; + XmlNamespaceCollection namespaces = elements.Peek().Namespaces; + + return LookupPrefix(namespaceName, namespaces); + } + + private static string LookupPrefix(string namespaceName, XmlNamespaceCollection namespaces) + { + for (int x = 0; x < namespaces.Count; x++) + { + if (String.CompareOrdinal(namespaces[x].Namespace, namespaceName) == 0) + return namespaces[x].Prefix; + } + + return null; + } + + #endregion + + #region IntegerCollectionType + + internal enum IntegerCollectionType : byte + { + Byte = 2, + Consecutive = 1, + Integer = 4, + Unknown = 0, + UShort = 3 + } + + #endregion + + #region NodesCollection + + internal class NodesCollection : List + { + public XmlBamlNode Last + { + get + { + if (this.Count > 0) + { + int i = this.Count - 1; + return this[i]; + } + return null; + } + } + + public void RemoveLast() + { + if (this.Count > 0) + this.Remove(this.Last); + } + + public XmlBamlNode Dequeue() + { + return DequeueInternal(true); + } + + public XmlBamlNode Peek() + { + return DequeueInternal(false); + } + + private XmlBamlNode DequeueInternal(bool remove) + { + if (this.Count > 0) + { + XmlBamlNode node = this[0]; + if (remove) + this.RemoveAt(0); + return node; + } + else + return null; + } + + + public void Enqueue(XmlBamlNode node) + { + this.Add(node); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlText.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlText.cs new file mode 100644 index 000000000..56114cac3 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlText.cs @@ -0,0 +1,33 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlBamlText : XmlBamlNode + { + private string _text; + + public XmlBamlText(string text) + { + _text = text; + } + + public string Text + { + get { return _text; } + } + + public override System.Xml.XmlNodeType NodeType + { + get + { + return XmlNodeType.Text; + } + } + } +} diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlNamespace.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlNamespace.cs new file mode 100644 index 000000000..c064931b5 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlNamespace.cs @@ -0,0 +1,47 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System.Collections.Generic; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + internal class XmlNamespace + { + private string _prefix; + private string _namespace; + + public XmlNamespace(string prefix, string ns) + { + _prefix = prefix; + _namespace = ns; + } + + public string Prefix + { + get { return _prefix; } + } + + public string Namespace + { + get { return _namespace; } + } + + public override bool Equals(object obj) + { + if (obj is XmlNamespace) + { + XmlNamespace o = (XmlNamespace)obj; + return (o.Prefix.Equals(this.Prefix) && o.Namespace.Equals(this.Namespace)); + } + return base.Equals(obj); + } + + public override int GetHashCode() + { + return _prefix.GetHashCode() + _namespace.GetHashCode() >> 20; + } + } + + internal class XmlNamespaceCollection : List + {} +} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlPIMapping.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlPIMapping.cs new file mode 100644 index 000000000..3c321c8f1 --- /dev/null +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlPIMapping.cs @@ -0,0 +1,63 @@ +// Copyright (c) Cristian Civera (cristian@aspitalia.com) +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; + +namespace Ricciolo.StylesExplorer.MarkupReflection +{ + /// + /// Rappresenta la mappatura tra namespace XML e namespace CLR con relativo assembly + /// + public class XmlPIMapping + { + private string _xmlNamespace; + private short _assemblyId; + private string _clrNamespace; + private static XmlPIMapping _default = new XmlPIMapping(PresentationNamespace, 0, String.Empty); + + public const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml"; + public const string PresentationNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"; + public const string PresentationOptionsNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"; + public const string McNamespace = "http://schemas.openxmlformats.org/markup-compatibility/2006"; + + public XmlPIMapping(string xmlNamespace, short assemblyId, string clrNamespace) + { + _xmlNamespace = xmlNamespace; + _assemblyId = assemblyId; + _clrNamespace = clrNamespace; + } + + /// + /// Restituisce o imposta il namespace XML + /// + public string XmlNamespace + { + get { return _xmlNamespace; } + set { _xmlNamespace = value;} + } + + /// + /// Restituisce l'id dell'assembly + /// + public short AssemblyId + { + get { return _assemblyId; } + } + + /// + /// Restituisce il namespace clr + /// + public string ClrNamespace + { + get { return _clrNamespace; } + } + + /// + /// Restituisce il mapping di default di WPF + /// + public static XmlPIMapping Presentation + { + get { return _default; } + } + } +} \ No newline at end of file From d3f31d054ea26ead91c7c95bbd13865fe7424ddf Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 May 2011 18:08:36 +0200 Subject: [PATCH 05/12] implement basic plug-in --- ILSpy.BamlDecompiler/BamlResourceEntryNode.cs | 61 +++ .../BamlResourceNodeFactory.cs | 29 ++ .../ILSpy.BamlDecompiler.csproj | 63 ++- ILSpy.BamlDecompiler/MyClass.cs | 16 - .../Properties/AssemblyInfo.cs | 4 +- ILSpy/BamlDecompiler.cs | 445 ------------------ ILSpy/CSharpLanguage.cs | 23 +- ILSpy/ILSpy.csproj | 1 - ILSpy/TreeNodes/ILSpyTreeNode.cs | 2 +- ILSpy/TreeNodes/ResourceEntryNode.cs | 2 +- ILSpy/TreeNodes/ResourceTreeNode.cs | 2 +- ILSpy/TreeNodes/XamlResourceNode.cs | 2 +- 12 files changed, 165 insertions(+), 485 deletions(-) create mode 100644 ILSpy.BamlDecompiler/BamlResourceEntryNode.cs create mode 100644 ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs delete mode 100644 ILSpy.BamlDecompiler/MyClass.cs delete mode 100644 ILSpy/BamlDecompiler.cs diff --git a/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs b/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs new file mode 100644 index 000000000..40d850c4a --- /dev/null +++ b/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs @@ -0,0 +1,61 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Xml.Linq; + +using ICSharpCode.AvalonEdit.Highlighting; +using ICSharpCode.ILSpy.TextView; +using ICSharpCode.ILSpy.TreeNodes; +using Ricciolo.StylesExplorer.MarkupReflection; + +namespace ILSpy.BamlDecompiler +{ + public sealed class BamlResourceEntryNode : ResourceEntryNode + { + public BamlResourceEntryNode(string key, Stream data) : base(key, data) + { + } + + public override bool View(DecompilerTextView textView) + { + AvalonEditTextOutput output = new AvalonEditTextOutput(); + IHighlightingDefinition highlighting = null; + + textView.RunWithCancellation( + token => Task.Factory.StartNew( + () => { + try { + if (LoadBaml(output)) + highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml"); + } catch (Exception ex) { + output.Write(ex.ToString()); + } + return output; + }), + t => textView.ShowNode(t.Result, this, highlighting) + ); + return true; + } + + bool LoadBaml(AvalonEditTextOutput output) + { + var asm = this.Ancestors().OfType().FirstOrDefault().LoadedAssembly; + MemoryStream bamlStream = new MemoryStream(); + Data.Position = 0; + Data.CopyTo(bamlStream); + bamlStream.Position = 0; + + XDocument xamlDocument; + using (XmlBamlReader reader = new XmlBamlReader(bamlStream)) + xamlDocument = XDocument.Load(reader); + + output.Write(xamlDocument.ToString()); + return true; + } + } +} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs b/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs new file mode 100644 index 000000000..a1b77fb6b --- /dev/null +++ b/ILSpy.BamlDecompiler/BamlResourceNodeFactory.cs @@ -0,0 +1,29 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.IO; + +using ICSharpCode.ILSpy.TreeNodes; + +namespace ILSpy.BamlDecompiler +{ + [Export(typeof(IResourceNodeFactory))] + public sealed class BamlResourceNodeFactory : IResourceNodeFactory + { + public ILSpyTreeNode CreateNode(Mono.Cecil.Resource resource) + { + return null; + } + + public ILSpyTreeNode CreateNode(string key, Stream data) + { + if (key.EndsWith(".baml", StringComparison.OrdinalIgnoreCase)) + return new BamlResourceEntryNode(key, data); + else + return null; + } + } +} diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj index 7424fec6f..587959be6 100644 --- a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj +++ b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj @@ -6,42 +6,66 @@ x86 Library ILSpy.BamlDecompiler - ILSpy.BamlDecompiler + ILSpy.BamlDecompiler.Plugin v4.0 Client Properties + False + False + 4 + false x86 + False + Auto + 4194304 + 4096 - bin\Debug\ - True + ..\ILSpy\bin\Debug\ + true Full False True DEBUG;TRACE - bin\Release\ - False + ..\ILSpy\bin\Release\ + false None True False TRACE + + 3.0 + + + 3.0 + + + 4.0 + 3.5 + + 4.0 + 3.5 + + 3.0 + - + + @@ -69,5 +93,32 @@ + + + {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} + ICSharpCode.AvalonEdit + False + + + {984CC812-9470-4A13-AFF9-CC44068D666C} + ICSharpCode.Decompiler + False + + + {1E85EFF9-E370-4683-83E4-8A3D063FF791} + ILSpy + False + + + {D68133BD-1E63-496E-9EDE-4FBDBF77B486} + Mono.Cecil + False + + + {DDE2A481-8271-4EAC-A330-8FA6A38D13D1} + ICSharpCode.TreeView + False + + \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/MyClass.cs b/ILSpy.BamlDecompiler/MyClass.cs deleted file mode 100644 index f89c0f24e..000000000 --- a/ILSpy.BamlDecompiler/MyClass.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) - -using System; -using System.Collections.Generic; - -namespace ILSpy.BamlDecompiler -{ - /// - /// Description of MyClass. - /// - public class MyClass - { - - } -} \ No newline at end of file diff --git a/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs b/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs index 54a525812..f28440c93 100644 --- a/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs +++ b/ILSpy.BamlDecompiler/Properties/AssemblyInfo.cs @@ -9,11 +9,11 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("ILSpy.BamlDecompiler")] +[assembly: AssemblyTitle("ILSpy.BamlDecompiler.Plugin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ILSpy.BamlDecompiler")] +[assembly: AssemblyProduct("ILSpy.BamlDecompiler.Plugin")] [assembly: AssemblyCopyright("Copyright 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/ILSpy/BamlDecompiler.cs b/ILSpy/BamlDecompiler.cs deleted file mode 100644 index 07c60b13e..000000000 --- a/ILSpy/BamlDecompiler.cs +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; -using System.ComponentModel.Composition; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using System.Windows.Baml2006; -using System.Xaml; -using System.Xaml.Schema; -using System.Xml; -using System.Xml.Linq; -using ICSharpCode.AvalonEdit.Highlighting; -using ICSharpCode.ILSpy.TextView; -using ICSharpCode.ILSpy.TreeNodes; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; - -namespace ICSharpCode.ILSpy.Baml -{ - /// Caution: use in separate AppDomain only! - sealed class BamlDecompiler : MarshalByRefObject - { - public BamlDecompiler() - { - } - - abstract class XamlNode - { - public readonly List Children = new List(); - - public abstract void WriteTo(XamlWriter writer); - } - - [Conditional("DEBUG")] - static void Log(string format, params object[] args) - { - Debug.WriteLine(format, args); - } - - sealed class XamlObjectNode : XamlNode - { - public readonly XamlType Type; - - public XamlObjectNode(XamlType type) - { - this.Type = type; - } - - public override void WriteTo(XamlWriter writer) - { - Log("StartObject {0}", this.Type); - writer.WriteStartObject(this.Type); - Debug.Indent(); - foreach (XamlNode node in this.Children) - node.WriteTo(writer); - Debug.Unindent(); - Log("EndObject"); - writer.WriteEndObject(); - } - } - - sealed class XamlGetObjectNode : XamlNode - { - public override void WriteTo(XamlWriter writer) - { - Log("GetObject"); - writer.WriteGetObject(); - Debug.Indent(); - foreach (XamlNode node in this.Children) - node.WriteTo(writer); - Debug.Unindent(); - Log("EndObject"); - writer.WriteEndObject(); - } - } - - sealed class XamlMemberNode : XamlNode - { - public XamlMember Member; - - public XamlMemberNode(XamlMember member) - { - this.Member = member; - } - - public override void WriteTo(XamlWriter writer) - { - Log("StartMember {0}", this.Member); - writer.WriteStartMember(this.Member); - Debug.Indent(); - foreach (XamlNode node in this.Children) - node.WriteTo(writer); - Debug.Unindent(); - Log("EndMember"); - writer.WriteEndMember(); - } - } - - sealed class XamlValueNode : XamlNode - { - public readonly object Value; - - public XamlValueNode(object value) - { - this.Value = value; - } - - public override void WriteTo(XamlWriter writer) - { - Log("Value {0}", this.Value); - Debug.Assert(this.Children.Count == 0); - // requires XamlReaderSettings.ValuesMustBeString = true to work properly - writer.WriteValue(this.Value); - } - } - - sealed class XamlNamespaceDeclarationNode : XamlNode - { - public readonly NamespaceDeclaration Namespace; - - public XamlNamespaceDeclarationNode(NamespaceDeclaration @namespace) - { - this.Namespace = @namespace; - } - - public override void WriteTo(XamlWriter writer) - { - Log("NamespaceDeclaration {0}", this.Namespace); - Debug.Assert(this.Children.Count == 0); - writer.WriteNamespace(this.Namespace); - } - } - - static List Parse(XamlReader reader) - { - List currentList = new List(); - Stack> stack = new Stack>(); - while (reader.Read()) { - switch (reader.NodeType) { - case XamlNodeType.None: - break; - case XamlNodeType.StartObject: - XamlObjectNode obj = new XamlObjectNode(reader.Type); - currentList.Add(obj); - stack.Push(currentList); - currentList = obj.Children; - break; - case XamlNodeType.GetObject: - XamlGetObjectNode getObject = new XamlGetObjectNode(); - currentList.Add(getObject); - stack.Push(currentList); - currentList = getObject.Children; - break; - case XamlNodeType.StartMember: - XamlMemberNode member = new XamlMemberNode(reader.Member); - currentList.Add(member); - stack.Push(currentList); - currentList = member.Children; - break; - case XamlNodeType.Value: - currentList.Add(new XamlValueNode(reader.Value)); - break; - case XamlNodeType.NamespaceDeclaration: - currentList.Add(new XamlNamespaceDeclarationNode(reader.Namespace)); - break; - case XamlNodeType.EndObject: - case XamlNodeType.EndMember: - currentList = stack.Pop(); - break; - default: - throw new InvalidOperationException("Invalid value for XamlNodeType"); - } - } - if (stack.Count != 0) - throw new InvalidOperationException("Imbalanced stack"); - return currentList; - } - - void AvoidContentProperties(XamlNode node) - { - foreach (XamlNode child in node.Children) - AvoidContentProperties(child); - - - XamlObjectNode obj = node as XamlObjectNode; - if (obj != null) { - // Visit all except for the last child: - for (int i = 0; i < obj.Children.Count - 1; i++) { - // Avoids using content property syntax for simple string values, if the content property is not the last member. - // Without this, we cannot decompile <GridViewColumn Header="Culture" DisplayMemberBinding="{Binding Culture}" />, - // because the Header property is the content property, but there is no way to represent the Binding as an element. - XamlMemberNode memberNode = obj.Children[i] as XamlMemberNode; - if (memberNode != null && memberNode.Member == obj.Type.ContentProperty) { - if (memberNode.Children.Count == 1 && memberNode.Children[0] is XamlValueNode) { - // By creating a clone of the XamlMember, we prevent WPF from knowing that it's the content property. - XamlMember member = memberNode.Member; - memberNode.Member = new XamlMember(member.Name, member.DeclaringType, member.IsAttachable); - } - } - } - // We also need to avoid using content properties that have a markup extension as value, as the XamlXmlWriter would always expand those: - for (int i = 0; i < obj.Children.Count; i++) { - XamlMemberNode memberNode = obj.Children[i] as XamlMemberNode; - if (memberNode != null && memberNode.Member == obj.Type.ContentProperty && memberNode.Children.Count == 1) { - XamlObjectNode me = memberNode.Children[0] as XamlObjectNode; - if (me != null && me.Type.IsMarkupExtension) { - // By creating a clone of the XamlMember, we prevent WPF from knowing that it's the content property. - XamlMember member = memberNode.Member; - memberNode.Member = new XamlMember(member.Name, member.DeclaringType, member.IsAttachable); - } - } - } - } - } - - /// - /// It seems like BamlReader will always output 'x:Key' as last property. However, it must be specified as attribute in valid .xaml, so we move it to the front - /// of the attribute list. - /// - void MoveXKeyToFront(XamlNode node) - { - foreach (XamlNode child in node.Children) - MoveXKeyToFront(child); - - XamlObjectNode obj = node as XamlObjectNode; - if (obj != null && obj.Children.Count > 0) { - XamlMemberNode memberNode = obj.Children[obj.Children.Count - 1] as XamlMemberNode; - if (memberNode != null && memberNode.Member == XamlLanguage.Key) { - // move memberNode in front of the first member node: - for (int i = 0; i < obj.Children.Count; i++) { - if (obj.Children[i] is XamlMemberNode) { - obj.Children.Insert(i, memberNode); - obj.Children.RemoveAt(obj.Children.Count - 1); - break; - } - } - } - } - } - - AssemblyResolver asmResolver; - - Assembly AssemblyResolve(object sender, ResolveEventArgs args) - { - string path = asmResolver.FindAssembly(args.Name); - - if (path == null) - return null; - - return Assembly.LoadFile(path); - } - - public string DecompileBaml(MemoryStream bamlCode, string containingAssemblyFile, ConnectMethodDecompiler connectMethodDecompiler, AssemblyResolver asmResolver) - { - this.asmResolver = asmResolver; - AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve; - - bamlCode.Position = 0; - TextWriter w = new StringWriter(); - - Assembly assembly = Assembly.LoadFile(containingAssemblyFile); - - Baml2006Reader reader = new Baml2006Reader(bamlCode, new XamlReaderSettings() { ValuesMustBeString = true, LocalAssembly = assembly }); - var xamlDocument = Parse(reader); - - string bamlTypeName = xamlDocument.OfType().First().Type.UnderlyingType.FullName; - - var eventMappings = connectMethodDecompiler.DecompileEventMappings(bamlTypeName); - - foreach (var xamlNode in xamlDocument) { - RemoveConnectionIds(xamlNode, eventMappings, reader.SchemaContext); - AvoidContentProperties(xamlNode); - MoveXKeyToFront(xamlNode); - } - - XDocument doc = new XDocument(); - XamlXmlWriter writer = new XamlXmlWriter(doc.CreateWriter(), reader.SchemaContext, new XamlXmlWriterSettings { AssumeValidInput = true }); - foreach (var xamlNode in xamlDocument) - xamlNode.WriteTo(writer); - writer.Close(); - - // Fix namespace references - string suffixToRemove = ";assembly=" + assembly.GetName().Name; - foreach (XAttribute attrib in doc.Root.Attributes()) { - if (attrib.Name.Namespace == XNamespace.Xmlns) { - if (attrib.Value.EndsWith(suffixToRemove, StringComparison.Ordinal)) { - string newNamespace = attrib.Value.Substring(0, attrib.Value.Length - suffixToRemove.Length); - ChangeXmlNamespace(doc, attrib.Value, newNamespace); - attrib.Value = newNamespace; - } - } - } - - return doc.ToString(); - } - - void RemoveConnectionIds(XamlNode node, Dictionary eventMappings, XamlSchemaContext context) - { - foreach (XamlNode child in node.Children) - RemoveConnectionIds(child, eventMappings, context); - - XamlObjectNode obj = node as XamlObjectNode; - if (obj != null && obj.Children.Count > 0) { - var removableNodes = new List(); - var addableNodes = new List(); - foreach (XamlMemberNode memberNode in obj.Children.OfType()) { - if (memberNode.Member == XamlLanguage.ConnectionId && memberNode.Children.Single() is XamlValueNode) { - var value = memberNode.Children.Single() as XamlValueNode; - int id; - if (value.Value is string && int.TryParse(value.Value as string, out id) && eventMappings.ContainsKey(id)) { - var map = eventMappings[id]; - foreach (var entry in map) { - if (entry.IsAttached) { - var type = context.GetXamlType(Type.GetType(entry.AttachSourceType)); - var member = new XamlMemberNode(new XamlMember(entry.EventName, type, true)); - member.Children.Add(new XamlValueNode(entry.MethodName)); - addableNodes.Add(member); - } else { - var member = new XamlMemberNode(obj.Type.GetMember(entry.EventName)); - member.Children.Add(new XamlValueNode(entry.MethodName)); - addableNodes.Add(member); - } - } - removableNodes.Add(memberNode); - } - } - } - foreach (var rnode in removableNodes) - node.Children.Remove(rnode); - node.Children.InsertRange(node.Children.Count > 1 ? node.Children.Count - 1 : 0, addableNodes); - } - } - - /// - /// Changes all references from oldNamespace to newNamespace in the document. - /// - void ChangeXmlNamespace(XDocument doc, XNamespace oldNamespace, XNamespace newNamespace) - { - foreach (XElement e in doc.Descendants()) { - if (e.Name.Namespace == oldNamespace) - e.Name = newNamespace + e.Name.LocalName; - } - } - } - - [Export(typeof(IResourceNodeFactory))] - sealed class BamlResourceNodeFactory : IResourceNodeFactory - { - public ILSpyTreeNode CreateNode(Mono.Cecil.Resource resource) - { - return null; - } - - public ILSpyTreeNode CreateNode(string key, Stream data) - { - if (key.EndsWith(".baml", StringComparison.OrdinalIgnoreCase)) - return new BamlResourceEntryNode(key, data); - else - return null; - } - } - - sealed class BamlResourceEntryNode : ResourceEntryNode - { - public BamlResourceEntryNode(string key, Stream data) : base(key, data) - { - } - - internal override bool View(DecompilerTextView textView) - { - AvalonEditTextOutput output = new AvalonEditTextOutput(); - IHighlightingDefinition highlighting = null; - - textView.RunWithCancellation( - token => Task.Factory.StartNew( - () => { - try { - if (LoadBaml(output)) - highlighting = HighlightingManager.Instance.GetDefinitionByExtension(".xml"); - } catch (Exception ex) { - output.Write(ex.ToString()); - } - return output; - }), - t => textView.ShowNode(t.Result, this, highlighting) - ); - return true; - } - - bool LoadBaml(AvalonEditTextOutput output) - { - var asm = this.Ancestors().OfType().FirstOrDefault().LoadedAssembly; - - AppDomain bamlDecompilerAppDomain = null; - try { - BamlDecompiler decompiler = CreateBamlDecompilerInAppDomain(ref bamlDecompilerAppDomain, asm.FileName); - - MemoryStream bamlStream = new MemoryStream(); - Data.Position = 0; - Data.CopyTo(bamlStream); - - output.Write(decompiler.DecompileBaml(bamlStream, asm.FileName, new ConnectMethodDecompiler(asm), new AssemblyResolver(asm))); - return true; - } finally { - if (bamlDecompilerAppDomain != null) - AppDomain.Unload(bamlDecompilerAppDomain); - } - } - - public static BamlDecompiler CreateBamlDecompilerInAppDomain(ref AppDomain appDomain, string assemblyFileName) - { - if (appDomain == null) { - // Construct and initialize settings for a second AppDomain. - AppDomainSetup bamlDecompilerAppDomainSetup = new AppDomainSetup(); -// bamlDecompilerAppDomainSetup.ApplicationBase = "file:///" + Path.GetDirectoryName(assemblyFileName); - bamlDecompilerAppDomainSetup.DisallowBindingRedirects = false; - bamlDecompilerAppDomainSetup.DisallowCodeDownload = true; - bamlDecompilerAppDomainSetup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; - - // Create the second AppDomain. - appDomain = AppDomain.CreateDomain("BamlDecompiler AD", null, bamlDecompilerAppDomainSetup); - } - return (BamlDecompiler)appDomain.CreateInstanceAndUnwrap(typeof(BamlDecompiler).Assembly.FullName, typeof(BamlDecompiler).FullName); - } - } -} \ No newline at end of file diff --git a/ILSpy/CSharpLanguage.cs b/ILSpy/CSharpLanguage.cs index 2408055fc..ad3ee5ae1 100644 --- a/ILSpy/CSharpLanguage.cs +++ b/ILSpy/CSharpLanguage.cs @@ -437,17 +437,18 @@ namespace ICSharpCode.ILSpy if (fileName.EndsWith(".baml", StringComparison.OrdinalIgnoreCase)) { MemoryStream ms = new MemoryStream(); entryStream.CopyTo(ms); - var decompiler = Baml.BamlResourceEntryNode.CreateBamlDecompilerInAppDomain(ref bamlDecompilerAppDomain, assembly.FileName); - string xaml = null; - try { - xaml = decompiler.DecompileBaml(ms, assembly.FileName, new ConnectMethodDecompiler(assembly), new AssemblyResolver(assembly)); - } - catch (XamlXmlWriterException) { } // ignore XAML writer exceptions - if (xaml != null) { - File.WriteAllText(Path.Combine(options.SaveAsProjectDirectory, Path.ChangeExtension(fileName, ".xaml")), xaml); - yield return Tuple.Create("Page", Path.ChangeExtension(fileName, ".xaml")); - continue; - } + // TODO implement extension point +// var decompiler = Baml.BamlResourceEntryNode.CreateBamlDecompilerInAppDomain(ref bamlDecompilerAppDomain, assembly.FileName); +// string xaml = null; +// try { +// xaml = decompiler.DecompileBaml(ms, assembly.FileName, new ConnectMethodDecompiler(assembly), new AssemblyResolver(assembly)); +// } +// catch (XamlXmlWriterException) { } // ignore XAML writer exceptions +// if (xaml != null) { +// File.WriteAllText(Path.Combine(options.SaveAsProjectDirectory, Path.ChangeExtension(fileName, ".xaml")), xaml); +// yield return Tuple.Create("Page", Path.ChangeExtension(fileName, ".xaml")); +// continue; +// } } using (FileStream fs = new FileStream(Path.Combine(options.SaveAsProjectDirectory, fileName), FileMode.Create, FileAccess.Write)) { entryStream.CopyTo(fs); diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 0bda1e382..3eaca83ce 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -93,7 +93,6 @@ - diff --git a/ILSpy/TreeNodes/ILSpyTreeNode.cs b/ILSpy/TreeNodes/ILSpyTreeNode.cs index 0ead7be94..ea92d8f22 100644 --- a/ILSpy/TreeNodes/ILSpyTreeNode.cs +++ b/ILSpy/TreeNodes/ILSpyTreeNode.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.ILSpy.TreeNodes /// This method is called on the main thread when only a single item is selected. /// If it returns false, normal decompilation is used to view the item. /// - internal virtual bool View(TextView.DecompilerTextView textView) + public virtual bool View(TextView.DecompilerTextView textView) { return false; } diff --git a/ILSpy/TreeNodes/ResourceEntryNode.cs b/ILSpy/TreeNodes/ResourceEntryNode.cs index 43638064d..cddab8326 100644 --- a/ILSpy/TreeNodes/ResourceEntryNode.cs +++ b/ILSpy/TreeNodes/ResourceEntryNode.cs @@ -132,7 +132,7 @@ namespace ICSharpCode.ILSpy.TreeNodes get { return Images.ResourceImage; } } - internal override bool View(DecompilerTextView textView) + public override bool View(DecompilerTextView textView) { try { AvalonEditTextOutput output = new AvalonEditTextOutput(); diff --git a/ILSpy/TreeNodes/ResourceTreeNode.cs b/ILSpy/TreeNodes/ResourceTreeNode.cs index 5e79845ba..1c1a1f08a 100644 --- a/ILSpy/TreeNodes/ResourceTreeNode.cs +++ b/ILSpy/TreeNodes/ResourceTreeNode.cs @@ -78,7 +78,7 @@ namespace ICSharpCode.ILSpy.TreeNodes } } - internal override bool View(DecompilerTextView textView) + public override bool View(DecompilerTextView textView) { EmbeddedResource er = r as EmbeddedResource; if (er != null) { diff --git a/ILSpy/TreeNodes/XamlResourceNode.cs b/ILSpy/TreeNodes/XamlResourceNode.cs index 0ed226a1d..13912e348 100644 --- a/ILSpy/TreeNodes/XamlResourceNode.cs +++ b/ILSpy/TreeNodes/XamlResourceNode.cs @@ -52,7 +52,7 @@ namespace ICSharpCode.ILSpy.Xaml { } - internal override bool View(DecompilerTextView textView) + public override bool View(DecompilerTextView textView) { AvalonEditTextOutput output = new AvalonEditTextOutput(); IHighlightingDefinition highlighting = null; From 1bd14655d07583ae251ca62783b8e12d82f34f05 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 May 2011 18:11:55 +0200 Subject: [PATCH 06/12] Ricciolo.StylesExplorer.MarkupReflection FIX: properly set _eof when reaching end of file --- .../XmlBamlReader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs index ceb8b0f15..615c02d4d 100644 --- a/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs +++ b/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs @@ -264,7 +264,11 @@ namespace Ricciolo.StylesExplorer.MarkupReflection //while (currentType != BamlRecordType.DocumentEnd); while (nodes.Count == 0 || (currentType != BamlRecordType.ElementEnd) || complexPropertyOpened > 0); - return SetNextNode(); + if (!SetNextNode()) { + _eof = true; + return false; + } + return true; } catch (EndOfStreamException) { From 7843a5b95f9f27ff8d4e6f65d276d190f9f54e69 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 23 May 2011 20:54:42 +0200 Subject: [PATCH 07/12] implement ITypeResolver based on Cecil to avoid loading of assemblies using reflection --- ILSpy.BamlDecompiler/BamlResourceEntryNode.cs | 2 +- .../CecilDependencyPropertyDescriptor.cs | 34 +++++++++ ILSpy.BamlDecompiler/CecilType.cs | 71 +++++++++++++++++++ ILSpy.BamlDecompiler/CecilTypeResolver.cs | 51 +++++++++++++ .../ILSpy.BamlDecompiler.csproj | 3 + 5 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 ILSpy.BamlDecompiler/CecilDependencyPropertyDescriptor.cs create mode 100644 ILSpy.BamlDecompiler/CecilType.cs create mode 100644 ILSpy.BamlDecompiler/CecilTypeResolver.cs diff --git a/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs b/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs index 40d850c4a..cce7182f9 100644 --- a/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs +++ b/ILSpy.BamlDecompiler/BamlResourceEntryNode.cs @@ -51,7 +51,7 @@ namespace ILSpy.BamlDecompiler bamlStream.Position = 0; XDocument xamlDocument; - using (XmlBamlReader reader = new XmlBamlReader(bamlStream)) + using (XmlBamlReader reader = new XmlBamlReader(bamlStream, new CecilTypeResolver(asm))) xamlDocument = XDocument.Load(reader); output.Write(xamlDocument.ToString()); diff --git a/ILSpy.BamlDecompiler/CecilDependencyPropertyDescriptor.cs b/ILSpy.BamlDecompiler/CecilDependencyPropertyDescriptor.cs new file mode 100644 index 000000000..9a0e1e559 --- /dev/null +++ b/ILSpy.BamlDecompiler/CecilDependencyPropertyDescriptor.cs @@ -0,0 +1,34 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Linq; +using ICSharpCode.ILSpy; +using Mono.Cecil; +using Ricciolo.StylesExplorer.MarkupReflection; + +namespace ILSpy.BamlDecompiler +{ + public class CecilDependencyPropertyDescriptor : IDependencyPropertyDescriptor + { + string member; + TypeDefinition type; + + public CecilDependencyPropertyDescriptor(string member, TypeDefinition type) + { + this.member = member; + this.type = type; + } + + public bool IsAttached { + get { + return type.Methods.Any(m => m.Name == "Get" + member); + } + } + + public override string ToString() + { + return string.Format("[CecilDependencyPropertyDescriptor Member={0}, Type={1}]", member, type); + } + } +} diff --git a/ILSpy.BamlDecompiler/CecilType.cs b/ILSpy.BamlDecompiler/CecilType.cs new file mode 100644 index 000000000..41a0fc203 --- /dev/null +++ b/ILSpy.BamlDecompiler/CecilType.cs @@ -0,0 +1,71 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Linq; +using ICSharpCode.ILSpy; +using Mono.Cecil; +using Ricciolo.StylesExplorer.MarkupReflection; + +namespace ILSpy.BamlDecompiler +{ + public class CecilType : IType + { + internal readonly TypeDefinition type; + + public CecilType(TypeDefinition type) + { + this.type = type; + } + + public string AssemblyQualifiedName { + get { + return type.FullName + + ", " + type.Module.Assembly.FullName; + } + } + + public bool IsSubclassOf(IType type) + { + if (type == null) + throw new ArgumentNullException("type"); + if (!(type is CecilType)) + throw new ArgumentException("type has to be a CecilType"); + + CecilType ct = (CecilType)type; + + var t = ct.type; + + while (t != null) { + if (t == ct.type) + return true; + foreach (var @interface in t.Interfaces) { + var resolved = @interface.Resolve(); + if (resolved == ct.type) + return true; + } + if (t.BaseType == null) + break; + + t = t.BaseType.Resolve(); + } + + return false; + } + + public bool Equals(IType type) + { + if (type == null) + throw new ArgumentNullException("type"); + if (!(type is CecilType)) + throw new ArgumentException("type has to be a CecilType"); + + return this.type == ((CecilType)type).type; + } + + public override string ToString() + { + return string.Format("[CecilType Type={0}]", type); + } + } +} diff --git a/ILSpy.BamlDecompiler/CecilTypeResolver.cs b/ILSpy.BamlDecompiler/CecilTypeResolver.cs new file mode 100644 index 000000000..35d17c9d2 --- /dev/null +++ b/ILSpy.BamlDecompiler/CecilTypeResolver.cs @@ -0,0 +1,51 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt) + +using System; +using System.Linq; +using ICSharpCode.ILSpy; +using Mono.Cecil; +using Ricciolo.StylesExplorer.MarkupReflection; + +namespace ILSpy.BamlDecompiler +{ + /// + /// Description of CecilTypeResolver. + /// + public class CecilTypeResolver : ITypeResolver + { + LoadedAssembly assembly; + + public CecilTypeResolver(LoadedAssembly assembly) + { + this.assembly = assembly; + } + + public IType GetTypeByAssemblyQualifiedName(string name) + { + int comma = name.IndexOf(','); + + if (comma == -1) + throw new ArgumentException("invalid name"); + + string fullName = name.Substring(0, comma); + string assemblyName = name.Substring(comma + 1).Trim(); + + var type = assembly.AssemblyDefinition.MainModule.GetType(fullName); + if (type == null) { + var otherAssembly = assembly.LookupReferencedAssembly(assemblyName); + type = otherAssembly.AssemblyDefinition.MainModule.GetType(fullName); + } + + return new CecilType(type); + } + + public IDependencyPropertyDescriptor GetDependencyPropertyDescriptor(string name, IType ownerType, IType targetType) + { + if (!(ownerType is CecilType)) + throw new ArgumentException(); + + return new CecilDependencyPropertyDescriptor(name, ((CecilType)ownerType).type); + } + } +} diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj index 587959be6..2dffb28a5 100644 --- a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj +++ b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj @@ -66,6 +66,9 @@ + + + From cced2487531f5db655114829d9befbaee5210235 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 24 May 2011 15:28:12 +0200 Subject: [PATCH 08/12] add AnyCPU configuration to ILSpy.BamlDecompiler.csproj --- ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj index 2dffb28a5..6f4ffcb22 100644 --- a/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj +++ b/ILSpy.BamlDecompiler/ILSpy.BamlDecompiler.csproj @@ -3,7 +3,7 @@ {A6BAD2BA-76BA-461C-8B6D-418607591247} Debug - x86 + AnyCPU Library ILSpy.BamlDecompiler ILSpy.BamlDecompiler.Plugin @@ -22,6 +22,13 @@ 4194304 4096 + + AnyCPU + False + Auto + 4194304 + 4096 + ..\ILSpy\bin\Debug\ true From 949ec40349a762b718e5f8c05101900e8091d966 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 24 May 2011 15:43:03 +0200 Subject: [PATCH 09/12] throw a better exception, if an assembly cannot be resolved --- ILSpy.BamlDecompiler/CecilTypeResolver.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ILSpy.BamlDecompiler/CecilTypeResolver.cs b/ILSpy.BamlDecompiler/CecilTypeResolver.cs index 35d17c9d2..853025b06 100644 --- a/ILSpy.BamlDecompiler/CecilTypeResolver.cs +++ b/ILSpy.BamlDecompiler/CecilTypeResolver.cs @@ -34,6 +34,8 @@ namespace ILSpy.BamlDecompiler var type = assembly.AssemblyDefinition.MainModule.GetType(fullName); if (type == null) { var otherAssembly = assembly.LookupReferencedAssembly(assemblyName); + if (otherAssembly == null) + throw new Exception("could not resolve '" + assemblyName + "'!"); type = otherAssembly.AssemblyDefinition.MainModule.GetType(fullName); } From e0c7bebfe8c99076338ecea8b2f22b857429a574 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Mon, 23 May 2011 17:17:01 +0200 Subject: [PATCH 10/12] Add license headers to the files that were missing them. --- ICSharpCode.Decompiler/Ast/AstBuilder.cs | 18 +++++++++++++++++ .../Ast/AstMethodBodyBuilder.cs | 18 +++++++++++++++++ .../Ast/CecilTypeResolveContext.cs | 19 ++++++++++++++++-- .../Ast/CommentStatement.cs | 19 ++++++++++++++++-- .../Ast/DecompilerContext.cs | 19 ++++++++++++++++-- .../Ast/NRefactoryExtensions.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Ast/NameVariables.cs | 19 ++++++++++++++++-- .../Ast/TextOutputFormatter.cs | 19 ++++++++++++++++-- .../Ast/TypesHierarchyHelpers.cs | 20 ++++++++++++++++++- .../ReferenceResolvingException.cs | 20 ++++++++++++++++++- .../Tests/CallOverloadedMethod.cs | 19 ++++++++++++++++-- .../Tests/CheckedUnchecked.cs | 19 ++++++++++++++++-- .../Tests/CodeSampleFileParser.cs | 20 ++++++++++++++++++- .../Tests/CustomShortCircuitOperators.cs | 19 ++++++++++++++++-- .../Tests/DecompilerTestBase.cs | 20 ++++++++++++++++++- .../Tests/DelegateConstruction.cs | 19 ++++++++++++++++-- .../Tests/ExceptionHandling.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/Generics.cs | 19 ++++++++++++++++-- .../Tests/IncrementDecrement.cs | 19 ++++++++++++++++-- .../Tests/InitializerTests.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/Loops.cs | 19 ++++++++++++++++-- .../Tests/MultidimensionalArray.cs | 19 ++++++++++++++++-- .../Tests/PropertiesAndEvents.cs | 19 ++++++++++++++++-- .../Tests/QueryExpressions.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/Switch.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/TestRunner.cs | 19 ++++++++++++++++-- .../Tests/UndocumentedExpressions.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/UnsafeCode.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/ValueTypes.cs | 19 ++++++++++++++++-- ICSharpCode.Decompiler/Tests/YieldReturn.cs | 19 ++++++++++++++++-- 30 files changed, 520 insertions(+), 52 deletions(-) diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index 17611ffa7..0c50975b4 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -1,3 +1,21 @@ +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs index b82101562..1958b083a 100644 --- a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs @@ -1,3 +1,21 @@ +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/CecilTypeResolveContext.cs b/ICSharpCode.Decompiler/Ast/CecilTypeResolveContext.cs index 0a5348bf4..2bdedd06b 100644 --- a/ICSharpCode.Decompiler/Ast/CecilTypeResolveContext.cs +++ b/ICSharpCode.Decompiler/Ast/CecilTypeResolveContext.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/CommentStatement.cs b/ICSharpCode.Decompiler/Ast/CommentStatement.cs index 8bbc6deda..0940c6c5c 100644 --- a/ICSharpCode.Decompiler/Ast/CommentStatement.cs +++ b/ICSharpCode.Decompiler/Ast/CommentStatement.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Linq; diff --git a/ICSharpCode.Decompiler/Ast/DecompilerContext.cs b/ICSharpCode.Decompiler/Ast/DecompilerContext.cs index cc4745617..4a3f27782 100644 --- a/ICSharpCode.Decompiler/Ast/DecompilerContext.cs +++ b/ICSharpCode.Decompiler/Ast/DecompilerContext.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs b/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs index 0c2a60b86..2edd30b59 100644 --- a/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs +++ b/ICSharpCode.Decompiler/Ast/NRefactoryExtensions.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using ICSharpCode.NRefactory.CSharp; diff --git a/ICSharpCode.Decompiler/Ast/NameVariables.cs b/ICSharpCode.Decompiler/Ast/NameVariables.cs index c7ac8f385..defc30202 100644 --- a/ICSharpCode.Decompiler/Ast/NameVariables.cs +++ b/ICSharpCode.Decompiler/Ast/NameVariables.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs index d0edf5bcc..b9b851bb7 100644 --- a/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs +++ b/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs b/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs index a7cd35a30..8de45cca5 100644 --- a/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs +++ b/ICSharpCode.Decompiler/Ast/TypesHierarchyHelpers.cs @@ -1,4 +1,22 @@ -using System; +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; diff --git a/ICSharpCode.Decompiler/ReferenceResolvingException.cs b/ICSharpCode.Decompiler/ReferenceResolvingException.cs index acd53b499..dbceb44b3 100644 --- a/ICSharpCode.Decompiler/ReferenceResolvingException.cs +++ b/ICSharpCode.Decompiler/ReferenceResolvingException.cs @@ -1,4 +1,22 @@ -using System; +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/ICSharpCode.Decompiler/Tests/CallOverloadedMethod.cs b/ICSharpCode.Decompiler/Tests/CallOverloadedMethod.cs index 852551773..4f493ef20 100644 --- a/ICSharpCode.Decompiler/Tests/CallOverloadedMethod.cs +++ b/ICSharpCode.Decompiler/Tests/CallOverloadedMethod.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs b/ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs index 5f4dc344b..08c5b39a3 100644 --- a/ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs +++ b/ICSharpCode.Decompiler/Tests/CheckedUnchecked.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. public class CheckedUnchecked { diff --git a/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs b/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs index c481c25e8..552d092ee 100644 --- a/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs +++ b/ICSharpCode.Decompiler/Tests/CodeSampleFileParser.cs @@ -1,4 +1,22 @@ -using System; +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs b/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs index 30a94a6e6..f51908659 100644 --- a/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs +++ b/ICSharpCode.Decompiler/Tests/CustomShortCircuitOperators.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs b/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs index ae363e57d..5eb701228 100644 --- a/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs +++ b/ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs @@ -1,4 +1,22 @@ -using System; +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.IO; diff --git a/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs b/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs index 14f6ce8e1..5d5071f67 100644 --- a/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler/Tests/DelegateConstruction.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Tests/ExceptionHandling.cs b/ICSharpCode.Decompiler/Tests/ExceptionHandling.cs index 7f6e506ee..45b5d72ca 100644 --- a/ICSharpCode.Decompiler/Tests/ExceptionHandling.cs +++ b/ICSharpCode.Decompiler/Tests/ExceptionHandling.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Threading; diff --git a/ICSharpCode.Decompiler/Tests/Generics.cs b/ICSharpCode.Decompiler/Tests/Generics.cs index e5b6e2eb7..9924583d6 100644 --- a/ICSharpCode.Decompiler/Tests/Generics.cs +++ b/ICSharpCode.Decompiler/Tests/Generics.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Tests/IncrementDecrement.cs b/ICSharpCode.Decompiler/Tests/IncrementDecrement.cs index 12c47186d..e06b680d6 100644 --- a/ICSharpCode.Decompiler/Tests/IncrementDecrement.cs +++ b/ICSharpCode.Decompiler/Tests/IncrementDecrement.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/InitializerTests.cs b/ICSharpCode.Decompiler/Tests/InitializerTests.cs index aba0fd19e..593db221f 100644 --- a/ICSharpCode.Decompiler/Tests/InitializerTests.cs +++ b/ICSharpCode.Decompiler/Tests/InitializerTests.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Tests/Loops.cs b/ICSharpCode.Decompiler/Tests/Loops.cs index 6a88b4f81..03427a8bd 100644 --- a/ICSharpCode.Decompiler/Tests/Loops.cs +++ b/ICSharpCode.Decompiler/Tests/Loops.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections; diff --git a/ICSharpCode.Decompiler/Tests/MultidimensionalArray.cs b/ICSharpCode.Decompiler/Tests/MultidimensionalArray.cs index cbe6d4333..c3557cee4 100644 --- a/ICSharpCode.Decompiler/Tests/MultidimensionalArray.cs +++ b/ICSharpCode.Decompiler/Tests/MultidimensionalArray.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs b/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs index 13ec6093e..4bacc06e3 100644 --- a/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs +++ b/ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Text; diff --git a/ICSharpCode.Decompiler/Tests/QueryExpressions.cs b/ICSharpCode.Decompiler/Tests/QueryExpressions.cs index 7f3680c88..143f3d30c 100644 --- a/ICSharpCode.Decompiler/Tests/QueryExpressions.cs +++ b/ICSharpCode.Decompiler/Tests/QueryExpressions.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; diff --git a/ICSharpCode.Decompiler/Tests/Switch.cs b/ICSharpCode.Decompiler/Tests/Switch.cs index 8890a5dab..108b86cf4 100644 --- a/ICSharpCode.Decompiler/Tests/Switch.cs +++ b/ICSharpCode.Decompiler/Tests/Switch.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/TestRunner.cs b/ICSharpCode.Decompiler/Tests/TestRunner.cs index a3100391c..a05779ecc 100644 --- a/ICSharpCode.Decompiler/Tests/TestRunner.cs +++ b/ICSharpCode.Decompiler/Tests/TestRunner.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.CodeDom.Compiler; diff --git a/ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs b/ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs index 563e39567..80f5b0371 100644 --- a/ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs +++ b/ICSharpCode.Decompiler/Tests/UndocumentedExpressions.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/UnsafeCode.cs b/ICSharpCode.Decompiler/Tests/UnsafeCode.cs index 3cb08c406..198f0fc97 100644 --- a/ICSharpCode.Decompiler/Tests/UnsafeCode.cs +++ b/ICSharpCode.Decompiler/Tests/UnsafeCode.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/ValueTypes.cs b/ICSharpCode.Decompiler/Tests/ValueTypes.cs index 48bfcd0ea..1d7ec437d 100644 --- a/ICSharpCode.Decompiler/Tests/ValueTypes.cs +++ b/ICSharpCode.Decompiler/Tests/ValueTypes.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; diff --git a/ICSharpCode.Decompiler/Tests/YieldReturn.cs b/ICSharpCode.Decompiler/Tests/YieldReturn.cs index 21a2163ce..7546b194f 100644 --- a/ICSharpCode.Decompiler/Tests/YieldReturn.cs +++ b/ICSharpCode.Decompiler/Tests/YieldReturn.cs @@ -1,5 +1,20 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. using System; using System.Collections.Generic; From e59edceccb33256ffcf84b1b3e4cc3a2b5c85e89 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Mon, 23 May 2011 17:19:00 +0200 Subject: [PATCH 11/12] Fix inlining into null coalescing operator. --- ICSharpCode.Decompiler/ILAst/ILInlining.cs | 2 +- ICSharpCode.Decompiler/ILAst/SimpleControlFlow.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/ILAst/ILInlining.cs b/ICSharpCode.Decompiler/ILAst/ILInlining.cs index d839f41ef..be749a658 100644 --- a/ICSharpCode.Decompiler/ILAst/ILInlining.cs +++ b/ICSharpCode.Decompiler/ILAst/ILInlining.cs @@ -385,7 +385,7 @@ namespace ICSharpCode.Decompiler.ILAst for (int i = 0; i < expr.Arguments.Count; i++) { // Stop when seeing an opcode that does not guarantee that its operands will be evaluated. // Inlining in that case might result in the inlined expresion not being evaluted. - if (i == 1 && (expr.Code == ILCode.LogicAnd || expr.Code == ILCode.LogicOr || expr.Code == ILCode.TernaryOp)) + if (i == 1 && (expr.Code == ILCode.LogicAnd || expr.Code == ILCode.LogicOr || expr.Code == ILCode.TernaryOp || expr.Code == ILCode.NullCoalescing)) return false; ILExpression arg = expr.Arguments[i]; diff --git a/ICSharpCode.Decompiler/ILAst/SimpleControlFlow.cs b/ICSharpCode.Decompiler/ILAst/SimpleControlFlow.cs index 319e18bbb..f7f2cf8a3 100644 --- a/ICSharpCode.Decompiler/ILAst/SimpleControlFlow.cs +++ b/ICSharpCode.Decompiler/ILAst/SimpleControlFlow.cs @@ -306,7 +306,7 @@ namespace ICSharpCode.Decompiler.ILAst if (!opBitwiseCallExpr.Match(ILCode.Call, out opBitwise, out leftVarExpression, out rightExpression)) return false; - if (!opFalseArg.MatchLdloc(leftVarExpression.Operand as ILVariable)) + if (!leftVarExpression.MatchLdloc(leftVar)) return false; // ignore operators other than op_BitwiseAnd and op_BitwiseOr From 17ad27bfacc5d6ac463c27a5045e0ce37bdd585b Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 24 May 2011 17:22:29 +0200 Subject: [PATCH 12/12] Use AnyCPU config for BamlDecompiler.Plugin. Support 'unbox' opcode in type analysis. --- ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs | 2 ++ ILSpy.sln | 10 +++++----- TestPlugin/TestPlugin.csproj | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs index 3c5c47bf6..3667bc895 100644 --- a/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs +++ b/ICSharpCode.Decompiler/ILAst/TypeAnalysis.cs @@ -681,6 +681,8 @@ namespace ICSharpCode.Decompiler.ILAst case ILCode.Castclass: case ILCode.Unbox_Any: return (TypeReference)expr.Operand; + case ILCode.Unbox: + return new ByReferenceType((TypeReference)expr.Operand); case ILCode.Isinst: { // isinst performs the equivalent of a cast only for reference types; diff --git a/ILSpy.sln b/ILSpy.sln index 747fdd135..e3c407eb5 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -# SharpDevelop 4.1.0.7466-alpha +# SharpDevelop 4.0.1.7146 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}" ProjectSection(SolutionItems) = postProject doc\Command Line.txt = doc\Command Line.txt @@ -107,12 +107,12 @@ Global {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.ActiveCfg = net_4_0_Release|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.Build.0 = net_4_0_Debug|Any CPU {63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.ActiveCfg = net_4_0_Release|Any CPU - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.Build.0 = Debug|x86 - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.ActiveCfg = Debug|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|x86.Build.0 = Debug|x86 {A6BAD2BA-76BA-461C-8B6D-418607591247}.Debug|x86.ActiveCfg = Debug|x86 - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.Build.0 = Release|x86 - {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.ActiveCfg = Release|x86 + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.Build.0 = Release|Any CPU + {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|Any CPU.ActiveCfg = Release|Any CPU {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|x86.Build.0 = Release|x86 {A6BAD2BA-76BA-461C-8B6D-418607591247}.Release|x86.ActiveCfg = Release|x86 EndGlobalSection diff --git a/TestPlugin/TestPlugin.csproj b/TestPlugin/TestPlugin.csproj index 54fe0e6f8..b0c205ad9 100644 --- a/TestPlugin/TestPlugin.csproj +++ b/TestPlugin/TestPlugin.csproj @@ -29,7 +29,7 @@ False True DEBUG;TRACE - Program + Project bin\Debug\ILSpy.exe