Repository: icsharpcode/ILSpy
Branch: master
Commit: 5eebf1408a47
Files: 1740
Total size: 10.6 MB
Directory structure:
gitextract_h8aaa6eu/
├── .editorconfig
├── .git-blame-ignore-revs
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── feature_request.md
│ │ └── wrong_decompilation.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── build-frontends.yml
│ ├── build-ilspy.yml
│ ├── codeql-analysis.yml
│ ├── generate-bom.yml
│ ├── lock.yml
│ └── scorecard.yml
├── .gitignore
├── .gitmodules
├── .tgitconfig
├── BuildTools/
│ ├── ILSpy.AddIn.VS2022.vsix.filelist
│ ├── ILSpy.AddIn.vsix.filelist
│ ├── ILSpy.msi.filelist
│ ├── bom-classify-encodings.ps1
│ ├── bom-strip.ps1
│ ├── create-filelists.ps1
│ ├── format.bat
│ ├── ghactions-install.ps1
│ ├── pre-commit
│ ├── sort-resx.ps1
│ └── update-assemblyinfo.ps1
├── Directory.Build.props
├── Directory.Packages.props
├── ICSharpCode.BamlDecompiler/
│ ├── Baml/
│ │ ├── BamlContext.cs
│ │ ├── BamlDocument.cs
│ │ ├── BamlNode.cs
│ │ ├── BamlReader.cs
│ │ ├── BamlRecords.cs
│ │ ├── BamlWriter.cs
│ │ ├── KnownMembers.cs
│ │ ├── KnownThings.cs
│ │ ├── KnownThings.g.cs
│ │ ├── KnownThings.gen.cs
│ │ └── KnownTypes.cs
│ ├── BamlConnectionId.cs
│ ├── BamlDecompilationResult.cs
│ ├── BamlDecompilerSettings.cs
│ ├── BamlDecompilerTypeSystem.cs
│ ├── BamlElement.cs
│ ├── Handlers/
│ │ ├── Blocks/
│ │ │ ├── ConstructorParametersHandler.cs
│ │ │ ├── DocumentHandler.cs
│ │ │ ├── ElementHandler.cs
│ │ │ ├── KeyElementStartHandler.cs
│ │ │ ├── PropertyArrayHandler.cs
│ │ │ ├── PropertyComplexHandler.cs
│ │ │ ├── PropertyDictionaryHandler.cs
│ │ │ └── PropertyListHandler.cs
│ │ └── Records/
│ │ ├── AssemblyInfoHandler.cs
│ │ ├── AttributeInfoHandler.cs
│ │ ├── ConnectionIdHandler.cs
│ │ ├── ConstructorParameterTypeHandler.cs
│ │ ├── ContentPropertyHandler.cs
│ │ ├── DefAttributeHandler.cs
│ │ ├── DefAttributeKeyStringHandler.cs
│ │ ├── DefAttributeKeyTypeHandler.cs
│ │ ├── DeferableContentStartHandler.cs
│ │ ├── LineNumberAndPositionHandler.cs
│ │ ├── LinePositionHandler.cs
│ │ ├── LiteralContentHandler.cs
│ │ ├── OptimizedStaticResourceHandler.cs
│ │ ├── PIMappingHandler.cs
│ │ ├── PresentationOptionsAttributeHandler.cs
│ │ ├── PropertyCustomHandler.cs
│ │ ├── PropertyHandler.cs
│ │ ├── PropertyTypeReferenceHandler.cs
│ │ ├── PropertyWithConverterHandler.cs
│ │ ├── PropertyWithExtensionHandler.cs
│ │ ├── PropertyWithStaticResourceIdHandler.cs
│ │ ├── StaticResourceIdHandler.cs
│ │ ├── StaticResourceStartHandler.cs
│ │ ├── TextHandler.cs
│ │ ├── TextWithConverterHandler.cs
│ │ ├── TypeInfoHandler.cs
│ │ └── XmlnsPropertyHandler.cs
│ ├── ICSharpCode.BamlDecompiler.csproj
│ ├── IHandlers.cs
│ ├── IRewritePass.cs
│ ├── PackageReadme.md
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── Rewrite/
│ │ ├── AttributeRewritePass.cs
│ │ ├── ConnectionIdRewritePass.cs
│ │ ├── DocumentRewritePass.cs
│ │ ├── MarkupExtensionRewritePass.cs
│ │ └── XClassRewritePass.cs
│ ├── Xaml/
│ │ ├── NamespaceMap.cs
│ │ ├── XamlExtension.cs
│ │ ├── XamlPathDeserializer.cs
│ │ ├── XamlProperty.cs
│ │ ├── XamlResourceKey.cs
│ │ ├── XamlType.cs
│ │ └── XamlUtils.cs
│ ├── XamlContext.cs
│ ├── XamlDecompiler.cs
│ ├── XmlnsDictionary.cs
│ └── packages.lock.json
├── ICSharpCode.Decompiler/
│ ├── CSharp/
│ │ ├── Annotations.cs
│ │ ├── CSharpDecompiler.cs
│ │ ├── CSharpLanguageVersion.cs
│ │ ├── CallBuilder.cs
│ │ ├── ExpressionBuilder.cs
│ │ ├── OutputVisitor/
│ │ │ ├── CSharpAmbience.cs
│ │ │ ├── CSharpFormattingOptions.cs
│ │ │ ├── CSharpOutputVisitor.cs
│ │ │ ├── FormattingOptionsFactory.cs
│ │ │ ├── GenericGrammarAmbiguityVisitor.cs
│ │ │ ├── ITokenWriter.cs
│ │ │ ├── InsertMissingTokensDecorator.cs
│ │ │ ├── InsertParenthesesVisitor.cs
│ │ │ ├── InsertRequiredSpacesDecorator.cs
│ │ │ ├── InsertSpecialsDecorator.cs
│ │ │ └── TextWriterTokenWriter.cs
│ │ ├── ProjectDecompiler/
│ │ │ ├── IProjectFileWriter.cs
│ │ │ ├── IProjectInfoProvider.cs
│ │ │ ├── ProjectFileWriterDefault.cs
│ │ │ ├── ProjectFileWriterSdkStyle.cs
│ │ │ ├── TargetFramework.cs
│ │ │ ├── TargetServices.cs
│ │ │ └── WholeProjectDecompiler.cs
│ │ ├── RecordDecompiler.cs
│ │ ├── RequiredNamespaceCollector.cs
│ │ ├── Resolver/
│ │ │ ├── AliasNamespaceResolveResult.cs
│ │ │ ├── AliasTypeResolveResult.cs
│ │ │ ├── AwaitResolveResult.cs
│ │ │ ├── CSharpConversions.cs
│ │ │ ├── CSharpInvocationResolveResult.cs
│ │ │ ├── CSharpOperators.cs
│ │ │ ├── CSharpResolver.cs
│ │ │ ├── DynamicInvocationResolveResult.cs
│ │ │ ├── DynamicMemberResolveResult.cs
│ │ │ ├── LambdaResolveResult.cs
│ │ │ ├── Log.cs
│ │ │ ├── MemberLookup.cs
│ │ │ ├── MethodGroupResolveResult.cs
│ │ │ ├── NameLookupMode.cs
│ │ │ ├── OverloadResolution.cs
│ │ │ ├── OverloadResolutionErrors.cs
│ │ │ └── TypeInference.cs
│ │ ├── SequencePointBuilder.cs
│ │ ├── StatementBuilder.cs
│ │ ├── Syntax/
│ │ │ ├── AstNode.cs
│ │ │ ├── AstNodeCollection.cs
│ │ │ ├── AstType.cs
│ │ │ ├── CSharpModifierToken.cs
│ │ │ ├── CSharpTokenNode.cs
│ │ │ ├── ComposedType.cs
│ │ │ ├── DepthFirstAstVisitor.cs
│ │ │ ├── DocumentationReference.cs
│ │ │ ├── Expressions/
│ │ │ │ ├── AnonymousMethodExpression.cs
│ │ │ │ ├── AnonymousTypeCreateExpression.cs
│ │ │ │ ├── ArrayCreateExpression.cs
│ │ │ │ ├── ArrayInitializerExpression.cs
│ │ │ │ ├── AsExpression.cs
│ │ │ │ ├── AssignmentExpression.cs
│ │ │ │ ├── BaseReferenceExpression.cs
│ │ │ │ ├── BinaryOperatorExpression.cs
│ │ │ │ ├── CastExpression.cs
│ │ │ │ ├── CheckedExpression.cs
│ │ │ │ ├── ConditionalExpression.cs
│ │ │ │ ├── DeclarationExpression.cs
│ │ │ │ ├── DefaultValueExpression.cs
│ │ │ │ ├── DirectionExpression.cs
│ │ │ │ ├── ErrorExpression.cs
│ │ │ │ ├── Expression.cs
│ │ │ │ ├── IdentifierExpression.cs
│ │ │ │ ├── IndexerExpression.cs
│ │ │ │ ├── InterpolatedStringExpression.cs
│ │ │ │ ├── InvocationExpression.cs
│ │ │ │ ├── IsExpression.cs
│ │ │ │ ├── LambdaExpression.cs
│ │ │ │ ├── MemberReferenceExpression.cs
│ │ │ │ ├── NamedArgumentExpression.cs
│ │ │ │ ├── NamedExpression.cs
│ │ │ │ ├── NullReferenceExpression.cs
│ │ │ │ ├── ObjectCreateExpression.cs
│ │ │ │ ├── OutVarDeclarationExpression.cs
│ │ │ │ ├── ParenthesizedExpression.cs
│ │ │ │ ├── PointerReferenceExpression.cs
│ │ │ │ ├── PrimitiveExpression.cs
│ │ │ │ ├── QueryExpression.cs
│ │ │ │ ├── RecursivePatternExpression.cs
│ │ │ │ ├── SizeOfExpression.cs
│ │ │ │ ├── StackAllocExpression.cs
│ │ │ │ ├── SwitchExpression.cs
│ │ │ │ ├── ThisReferenceExpression.cs
│ │ │ │ ├── ThrowExpression.cs
│ │ │ │ ├── TupleExpression.cs
│ │ │ │ ├── TypeOfExpression.cs
│ │ │ │ ├── TypeReferenceExpression.cs
│ │ │ │ ├── UnaryOperatorExpression.cs
│ │ │ │ ├── UncheckedExpression.cs
│ │ │ │ ├── UndocumentedExpression.cs
│ │ │ │ └── WithInitializerExpression.cs
│ │ │ ├── FunctionPointerAstType.cs
│ │ │ ├── GeneralScope/
│ │ │ │ ├── Attribute.cs
│ │ │ │ ├── AttributeSection.cs
│ │ │ │ ├── Comment.cs
│ │ │ │ ├── Constraint.cs
│ │ │ │ ├── DelegateDeclaration.cs
│ │ │ │ ├── ExternAliasDeclaration.cs
│ │ │ │ ├── NamespaceDeclaration.cs
│ │ │ │ ├── PreProcessorDirective.cs
│ │ │ │ ├── TypeDeclaration.cs
│ │ │ │ ├── TypeParameterDeclaration.cs
│ │ │ │ ├── UsingAliasDeclaration.cs
│ │ │ │ └── UsingDeclaration.cs
│ │ │ ├── IAnnotatable.cs
│ │ │ ├── IAstVisitor.cs
│ │ │ ├── Identifier.cs
│ │ │ ├── IdentifierExpressionBackreference.cs
│ │ │ ├── InvocationAstType.cs
│ │ │ ├── MemberType.cs
│ │ │ ├── Modifiers.cs
│ │ │ ├── NodeType.cs
│ │ │ ├── PatternMatching/
│ │ │ │ ├── AnyNode.cs
│ │ │ │ ├── AnyNodeOrNull.cs
│ │ │ │ ├── Backreference.cs
│ │ │ │ ├── BacktrackingInfo.cs
│ │ │ │ ├── Choice.cs
│ │ │ │ ├── INode.cs
│ │ │ │ ├── Match.cs
│ │ │ │ ├── NamedNode.cs
│ │ │ │ ├── OptionalNode.cs
│ │ │ │ ├── Pattern.cs
│ │ │ │ └── Repeat.cs
│ │ │ ├── PrimitiveType.cs
│ │ │ ├── Role.cs
│ │ │ ├── Roles.cs
│ │ │ ├── SimpleType.cs
│ │ │ ├── Statements/
│ │ │ │ ├── BlockStatement.cs
│ │ │ │ ├── BreakStatement.cs
│ │ │ │ ├── CheckedStatement.cs
│ │ │ │ ├── ContinueStatement.cs
│ │ │ │ ├── DoWhileStatement.cs
│ │ │ │ ├── EmptyStatement.cs
│ │ │ │ ├── ExpressionStatement.cs
│ │ │ │ ├── FixedStatement.cs
│ │ │ │ ├── ForStatement.cs
│ │ │ │ ├── ForeachStatement.cs
│ │ │ │ ├── GotoStatement.cs
│ │ │ │ ├── IfElseStatement.cs
│ │ │ │ ├── LabelStatement.cs
│ │ │ │ ├── LocalFunctionDeclarationStatement.cs
│ │ │ │ ├── LockStatement.cs
│ │ │ │ ├── ReturnStatement.cs
│ │ │ │ ├── Statement.cs
│ │ │ │ ├── SwitchStatement.cs
│ │ │ │ ├── ThrowStatement.cs
│ │ │ │ ├── TryCatchStatement.cs
│ │ │ │ ├── UncheckedStatement.cs
│ │ │ │ ├── UnsafeStatement.cs
│ │ │ │ ├── UsingStatement.cs
│ │ │ │ ├── VariableDeclarationStatement.cs
│ │ │ │ ├── WhileStatement.cs
│ │ │ │ ├── YieldBreakStatement.cs
│ │ │ │ └── YieldReturnStatement.cs
│ │ │ ├── SyntaxExtensions.cs
│ │ │ ├── SyntaxTree.cs
│ │ │ ├── TextLocation.cs
│ │ │ ├── TokenRole.cs
│ │ │ ├── TupleAstType.cs
│ │ │ ├── TypeMembers/
│ │ │ │ ├── Accessor.cs
│ │ │ │ ├── ConstructorDeclaration.cs
│ │ │ │ ├── DestructorDeclaration.cs
│ │ │ │ ├── EntityDeclaration.cs
│ │ │ │ ├── EnumMemberDeclaration.cs
│ │ │ │ ├── EventDeclaration.cs
│ │ │ │ ├── ExtensionDeclaration.cs
│ │ │ │ ├── FieldDeclaration.cs
│ │ │ │ ├── FixedFieldDeclaration.cs
│ │ │ │ ├── FixedVariableInitializer.cs
│ │ │ │ ├── IndexerDeclaration.cs
│ │ │ │ ├── MethodDeclaration.cs
│ │ │ │ ├── OperatorDeclaration.cs
│ │ │ │ ├── ParameterDeclaration.cs
│ │ │ │ ├── PropertyDeclaration.cs
│ │ │ │ └── VariableInitializer.cs
│ │ │ ├── TypeSystemAstBuilder.cs
│ │ │ └── VariableDesignation.cs
│ │ ├── Transforms/
│ │ │ ├── AddCheckedBlocks.cs
│ │ │ ├── AddXmlDocumentationTransform.cs
│ │ │ ├── CombineQueryExpressions.cs
│ │ │ ├── ContextTrackingVisitor.cs
│ │ │ ├── CustomPatterns.cs
│ │ │ ├── DeclareVariables.cs
│ │ │ ├── EscapeInvalidIdentifiers.cs
│ │ │ ├── FixNameCollisions.cs
│ │ │ ├── FlattenSwitchBlocks.cs
│ │ │ ├── IAstTransform.cs
│ │ │ ├── IntroduceExtensionMethods.cs
│ │ │ ├── IntroduceQueryExpressions.cs
│ │ │ ├── IntroduceUnsafeModifier.cs
│ │ │ ├── IntroduceUsingDeclarations.cs
│ │ │ ├── NormalizeBlockStatements.cs
│ │ │ ├── PatternStatementTransform.cs
│ │ │ ├── PrettifyAssignments.cs
│ │ │ ├── RemoveCLSCompliantAttribute.cs
│ │ │ ├── ReplaceMethodCallsWithOperators.cs
│ │ │ ├── TransformContext.cs
│ │ │ └── TransformFieldAndConstructorInitializers.cs
│ │ ├── TranslatedExpression.cs
│ │ ├── TranslatedStatement.cs
│ │ ├── TranslationContext.cs
│ │ └── TypeSystem/
│ │ ├── CSharpTypeResolveContext.cs
│ │ └── UsingScope.cs
│ ├── DebugInfo/
│ │ ├── AsyncDebugInfo.cs
│ │ ├── DebugInfoGenerator.cs
│ │ ├── IDebugInfoProvider.cs
│ │ ├── ImportScopeInfo.cs
│ │ ├── KnownGuids.cs
│ │ ├── PortablePdbWriter.cs
│ │ └── SequencePoint.cs
│ ├── DecompilationProgress.cs
│ ├── DecompileRun.cs
│ ├── DecompilerException.cs
│ ├── DecompilerSettings.cs
│ ├── Disassembler/
│ │ ├── DisassemblerHelpers.cs
│ │ ├── DisassemblerSignatureTypeProvider.cs
│ │ ├── IEntityProcessor.cs
│ │ ├── ILParser.cs
│ │ ├── ILStructure.cs
│ │ ├── MethodBodyDisassembler.cs
│ │ ├── OpCodeInfo.cs
│ │ ├── ReflectionDisassembler.cs
│ │ └── SortByNameProcessor.cs
│ ├── Documentation/
│ │ ├── GetPotentiallyNestedClassTypeReference.cs
│ │ ├── IdStringMemberReference.cs
│ │ ├── IdStringProvider.cs
│ │ ├── XmlDocLoader.cs
│ │ ├── XmlDocumentationElement.cs
│ │ └── XmlDocumentationProvider.cs
│ ├── FlowAnalysis/
│ │ ├── ControlFlowNode.cs
│ │ ├── DataFlowVisitor.cs
│ │ ├── DefiniteAssignmentVisitor.cs
│ │ ├── Dominance.cs
│ │ └── ReachingDefinitionsVisitor.cs
│ ├── Humanizer/
│ │ ├── LICENSE
│ │ ├── StringHumanizeExtensions.cs
│ │ ├── Vocabularies.cs
│ │ └── Vocabulary.cs
│ ├── ICSharpCode.Decompiler.csproj
│ ├── ICSharpCode.Decompiler.snk
│ ├── IL/
│ │ ├── BlockBuilder.cs
│ │ ├── ControlFlow/
│ │ │ ├── AsyncAwaitDecompiler.cs
│ │ │ ├── AwaitInCatchTransform.cs
│ │ │ ├── AwaitInFinallyTransform.cs
│ │ │ ├── ConditionDetection.cs
│ │ │ ├── ControlFlowGraph.cs
│ │ │ ├── ControlFlowSimplification.cs
│ │ │ ├── DetectPinnedRegions.cs
│ │ │ ├── ExitPoints.cs
│ │ │ ├── LoopDetection.cs
│ │ │ ├── RemoveRedundantReturn.cs
│ │ │ ├── StateRangeAnalysis.cs
│ │ │ ├── SwitchAnalysis.cs
│ │ │ ├── SwitchDetection.cs
│ │ │ ├── SymbolicExecution.cs
│ │ │ └── YieldReturnDecompiler.cs
│ │ ├── ILAmbience.cs
│ │ ├── ILAstWritingOptions.cs
│ │ ├── ILInstructionExtensions.cs
│ │ ├── ILReader.cs
│ │ ├── ILTypeExtensions.cs
│ │ ├── ILVariable.cs
│ │ ├── InstructionFlags.cs
│ │ ├── InstructionOutputExtensions.cs
│ │ ├── Instructions/
│ │ │ ├── Await.cs
│ │ │ ├── BinaryNumericInstruction.cs
│ │ │ ├── Block.cs
│ │ │ ├── BlockContainer.cs
│ │ │ ├── Branch.cs
│ │ │ ├── CallIndirect.cs
│ │ │ ├── CallInstruction.cs
│ │ │ ├── Comp.cs
│ │ │ ├── CompoundAssignmentInstruction.cs
│ │ │ ├── Conv.cs
│ │ │ ├── DeconstructInstruction.cs
│ │ │ ├── DeconstructResultInstruction.cs
│ │ │ ├── DefaultValue.cs
│ │ │ ├── DynamicInstructions.cs
│ │ │ ├── ExpressionTreeCast.cs
│ │ │ ├── ILFunction.cs
│ │ │ ├── ILInstruction.cs
│ │ │ ├── ILVariableCollection.cs
│ │ │ ├── IfInstruction.cs
│ │ │ ├── InstructionCollection.cs
│ │ │ ├── IsInst.cs
│ │ │ ├── LdFlda.cs
│ │ │ ├── LdLen.cs
│ │ │ ├── Leave.cs
│ │ │ ├── LockInstruction.cs
│ │ │ ├── LogicInstructions.cs
│ │ │ ├── MatchInstruction.cs
│ │ │ ├── MemoryInstructions.cs
│ │ │ ├── NullCoalescingInstruction.cs
│ │ │ ├── NullableInstructions.cs
│ │ │ ├── PatternMatching.cs
│ │ │ ├── SimpleInstruction.cs
│ │ │ ├── StLoc.cs
│ │ │ ├── StringToInt.cs
│ │ │ ├── SwitchInstruction.cs
│ │ │ ├── TryInstruction.cs
│ │ │ ├── UnaryInstruction.cs
│ │ │ └── UsingInstruction.cs
│ │ ├── Instructions.cs
│ │ ├── Instructions.tt
│ │ ├── Patterns/
│ │ │ ├── AnyNode.cs
│ │ │ ├── ListMatch.cs
│ │ │ └── Match.cs
│ │ ├── PointerArithmeticOffset.cs
│ │ ├── PrimitiveType.cs
│ │ ├── SemanticHelper.cs
│ │ ├── SlotInfo.cs
│ │ ├── StackType.cs
│ │ └── Transforms/
│ │ ├── AssignVariableNames.cs
│ │ ├── BlockTransform.cs
│ │ ├── CachedDelegateInitialization.cs
│ │ ├── CombineExitsTransform.cs
│ │ ├── CopyPropagation.cs
│ │ ├── DeconstructionTransform.cs
│ │ ├── DelegateConstruction.cs
│ │ ├── DetectCatchWhenConditionBlocks.cs
│ │ ├── DynamicCallSiteTransform.cs
│ │ ├── DynamicIsEventAssignmentTransform.cs
│ │ ├── EarlyExpressionTransforms.cs
│ │ ├── ExpressionTransforms.cs
│ │ ├── FixRemainingIncrements.cs
│ │ ├── HighLevelLoopTransform.cs
│ │ ├── IILTransform.cs
│ │ ├── ILExtraction.cs
│ │ ├── ILInlining.cs
│ │ ├── IndexRangeTransform.cs
│ │ ├── InlineArrayTransform.cs
│ │ ├── InlineReturnTransform.cs
│ │ ├── InterpolatedStringTransform.cs
│ │ ├── IntroduceDynamicTypeOnLocals.cs
│ │ ├── IntroduceNativeIntTypeOnLocals.cs
│ │ ├── IntroduceRefReadOnlyModifierOnLocals.cs
│ │ ├── LdLocaDupInitObjTransform.cs
│ │ ├── LocalFunctionDecompiler.cs
│ │ ├── LockTransform.cs
│ │ ├── NamedArgumentTransform.cs
│ │ ├── NullCoalescingTransform.cs
│ │ ├── NullPropagationTransform.cs
│ │ ├── NullableLiftingTransform.cs
│ │ ├── PatternMatchingTransform.cs
│ │ ├── ProxyCallReplacer.cs
│ │ ├── ReduceNestingTransform.cs
│ │ ├── RemoveDeadVariableInit.cs
│ │ ├── RemoveInfeasiblePathTransform.cs
│ │ ├── RemoveUnconstrainedGenericReferenceTypeCheck.cs
│ │ ├── SplitVariables.cs
│ │ ├── StatementTransform.cs
│ │ ├── Stepper.cs
│ │ ├── SwitchOnNullableTransform.cs
│ │ ├── SwitchOnStringTransform.cs
│ │ ├── TransformArrayInitializers.cs
│ │ ├── TransformAssignment.cs
│ │ ├── TransformCollectionAndObjectInitializers.cs
│ │ ├── TransformDisplayClassUsage.cs
│ │ ├── TransformExpressionTrees.cs
│ │ ├── TupleTransform.cs
│ │ ├── UserDefinedLogicTransform.cs
│ │ └── UsingTransform.cs
│ ├── Instrumentation/
│ │ └── DecompilerEventSource.cs
│ ├── Metadata/
│ │ ├── AssemblyReferences.cs
│ │ ├── CodeMappingInfo.cs
│ │ ├── CustomAttributeDecoder.cs
│ │ ├── DotNetCorePathFinder.cs
│ │ ├── DotNetCorePathFinderExtensions.cs
│ │ ├── EnumUnderlyingTypeResolveException.cs
│ │ ├── ExportedTypeMetadata.cs
│ │ ├── FindTypeDecoder.cs
│ │ ├── FullTypeNameSignatureDecoder.cs
│ │ ├── ILOpCodes.cs
│ │ ├── ILOpCodes.tt
│ │ ├── LightJson/
│ │ │ ├── JsonArray.cs
│ │ │ ├── JsonObject.cs
│ │ │ ├── JsonValue.cs
│ │ │ ├── JsonValueType.cs
│ │ │ └── Serialization/
│ │ │ ├── JsonParseException.cs
│ │ │ ├── JsonReader.cs
│ │ │ ├── TextPosition.cs
│ │ │ └── TextScanner.cs
│ │ ├── MemberReferenceMetadata.cs
│ │ ├── MetadataExtensions.cs
│ │ ├── MetadataFile.cs
│ │ ├── MetadataGenericContext.cs
│ │ ├── MetadataTokenHelpers.cs
│ │ ├── MethodSemanticsLookup.cs
│ │ ├── ModuleReferenceMetadata.cs
│ │ ├── OperandType.cs
│ │ ├── PEFile.cs
│ │ ├── PropertyAndEventBackingFieldLookup.cs
│ │ ├── ReferenceLoadInfo.cs
│ │ ├── Resource.cs
│ │ ├── SignatureBlobComparer.cs
│ │ ├── TypeReferenceMetadata.cs
│ │ ├── UniversalAssemblyResolver.cs
│ │ ├── UnresolvedAssemblyNameReference.cs
│ │ └── WebCilFile.cs
│ ├── NRExtensions.cs
│ ├── NRTAttributes.cs
│ ├── Output/
│ │ ├── IAmbience.cs
│ │ ├── ITextOutput.cs
│ │ ├── PlainTextOutput.cs
│ │ ├── TextOutputWriter.cs
│ │ └── TextTokenWriter.cs
│ ├── PackageReadme.md
│ ├── PartialTypeInfo.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── DecompilerVersionInfo.template.cs
│ ├── SRMExtensions.cs
│ ├── SRMHacks.cs
│ ├── Semantics/
│ │ ├── AmbiguousResolveResult.cs
│ │ ├── ArrayAccessResolveResult.cs
│ │ ├── ArrayCreateResolveResult.cs
│ │ ├── ByReferenceResolveResult.cs
│ │ ├── ConstantResolveResult.cs
│ │ ├── Conversion.cs
│ │ ├── ConversionResolveResult.cs
│ │ ├── ErrorResolveResult.cs
│ │ ├── ForEachResolveResult.cs
│ │ ├── InitializedObjectResolveResult.cs
│ │ ├── InterpolatedStringResolveResult.cs
│ │ ├── InvocationResolveResult.cs
│ │ ├── LocalResolveResult.cs
│ │ ├── MemberResolveResult.cs
│ │ ├── NamedArgumentResolveResult.cs
│ │ ├── NamespaceResolveResult.cs
│ │ ├── OperatorResolveResult.cs
│ │ ├── OutVarResolveResult.cs
│ │ ├── ResolveResult.cs
│ │ ├── SizeOfResolveResult.cs
│ │ ├── ThisResolveResult.cs
│ │ ├── ThrowResolveResult.cs
│ │ ├── TupleResolveResult.cs
│ │ ├── TypeIsResolveResult.cs
│ │ ├── TypeOfResolveResult.cs
│ │ ├── TypeResolveResult.cs
│ │ └── UnknownMemberResolveResult.cs
│ ├── SingleFileBundle.cs
│ ├── Solution/
│ │ ├── ProjectId.cs
│ │ ├── ProjectItem.cs
│ │ └── SolutionCreator.cs
│ ├── TypeSystem/
│ │ ├── Accessibility.cs
│ │ ├── ApplyAttributeTypeVisitor.cs
│ │ ├── ArrayType.cs
│ │ ├── AssemblyQualifiedTypeName.cs
│ │ ├── ByReferenceType.cs
│ │ ├── ComHelper.cs
│ │ ├── DecompilerTypeSystem.cs
│ │ ├── ExtensionInfo.cs
│ │ ├── FullTypeName.cs
│ │ ├── FunctionPointerType.cs
│ │ ├── GenericContext.cs
│ │ ├── IAssembly.cs
│ │ ├── IAttribute.cs
│ │ ├── ICodeContext.cs
│ │ ├── ICompilation.cs
│ │ ├── IDecompilerTypeSystem.cs
│ │ ├── IEntity.cs
│ │ ├── IEvent.cs
│ │ ├── IField.cs
│ │ ├── IFreezable.cs
│ │ ├── IInterningProvider.cs
│ │ ├── IMember.cs
│ │ ├── IMethod.cs
│ │ ├── INamedElement.cs
│ │ ├── INamespace.cs
│ │ ├── IParameter.cs
│ │ ├── IParameterizedMember.cs
│ │ ├── IProperty.cs
│ │ ├── ISupportsInterning.cs
│ │ ├── ISymbol.cs
│ │ ├── IType.cs
│ │ ├── ITypeDefinition.cs
│ │ ├── ITypeDefinitionOrUnknown.cs
│ │ ├── ITypeParameter.cs
│ │ ├── ITypeReference.cs
│ │ ├── IVariable.cs
│ │ ├── Implementation/
│ │ │ ├── AbstractFreezable.cs
│ │ │ ├── AbstractType.cs
│ │ │ ├── AbstractTypeParameter.cs
│ │ │ ├── AttributeListBuilder.cs
│ │ │ ├── BaseTypeCollector.cs
│ │ │ ├── CustomAttribute.cs
│ │ │ ├── DecimalConstantHelper.cs
│ │ │ ├── DecoratedType.cs
│ │ │ ├── DefaultAssemblyReference.cs
│ │ │ ├── DefaultAttribute.cs
│ │ │ ├── DefaultParameter.cs
│ │ │ ├── DefaultTypeParameter.cs
│ │ │ ├── DefaultVariable.cs
│ │ │ ├── DummyTypeParameter.cs
│ │ │ ├── FakeMember.cs
│ │ │ ├── GetMembersHelper.cs
│ │ │ ├── KnownAttributes.cs
│ │ │ ├── KnownTypeCache.cs
│ │ │ ├── LocalFunctionMethod.cs
│ │ │ ├── MergedNamespace.cs
│ │ │ ├── MetadataEvent.cs
│ │ │ ├── MetadataField.cs
│ │ │ ├── MetadataMethod.cs
│ │ │ ├── MetadataNamespace.cs
│ │ │ ├── MetadataParameter.cs
│ │ │ ├── MetadataProperty.cs
│ │ │ ├── MetadataTypeDefinition.cs
│ │ │ ├── MetadataTypeParameter.cs
│ │ │ ├── MinimalCorlib.cs
│ │ │ ├── NestedTypeReference.cs
│ │ │ ├── NullabilityAnnotatedType.cs
│ │ │ ├── PinnedType.cs
│ │ │ ├── SimpleCompilation.cs
│ │ │ ├── SpecializedEvent.cs
│ │ │ ├── SpecializedField.cs
│ │ │ ├── SpecializedMember.cs
│ │ │ ├── SpecializedMethod.cs
│ │ │ ├── SpecializedParameter.cs
│ │ │ ├── SpecializedProperty.cs
│ │ │ ├── SyntheticRangeIndexer.cs
│ │ │ ├── ThreeState.cs
│ │ │ ├── TypeParameterReference.cs
│ │ │ ├── TypeWithElementType.cs
│ │ │ └── UnknownType.cs
│ │ ├── InheritanceHelper.cs
│ │ ├── IntersectionType.cs
│ │ ├── KnownTypeReference.cs
│ │ ├── MetadataModule.cs
│ │ ├── ModifiedType.cs
│ │ ├── NormalizeTypeVisitor.cs
│ │ ├── Nullability.cs
│ │ ├── NullableType.cs
│ │ ├── ParameterListComparer.cs
│ │ ├── ParameterizedType.cs
│ │ ├── PointerType.cs
│ │ ├── ReferenceResolvingException.cs
│ │ ├── ReflectionHelper.cs
│ │ ├── ReflectionNameParseException.cs
│ │ ├── SimpleTypeResolveContext.cs
│ │ ├── SpecialType.cs
│ │ ├── TaskType.cs
│ │ ├── TopLevelTypeName.cs
│ │ ├── TupleType.cs
│ │ ├── TypeKind.cs
│ │ ├── TypeParameterSubstitution.cs
│ │ ├── TypeProvider.cs
│ │ ├── TypeSystemExtensions.cs
│ │ ├── TypeUtils.cs
│ │ ├── TypeVisitor.cs
│ │ └── VarArgInstanceMethod.cs
│ ├── Util/
│ │ ├── BitOperations.cs
│ │ ├── BitSet.cs
│ │ ├── BusyManager.cs
│ │ ├── CSharpPrimitiveCast.cs
│ │ ├── CacheManager.cs
│ │ ├── CallbackOnDispose.cs
│ │ ├── CollectionExtensions.cs
│ │ ├── DelegateComparer.cs
│ │ ├── EmptyList.cs
│ │ ├── ExtensionMethods.cs
│ │ ├── FileUtility.cs
│ │ ├── GraphTraversal.cs
│ │ ├── Index.cs
│ │ ├── Interval.cs
│ │ ├── KeyComparer.cs
│ │ ├── LazyInit.cs
│ │ ├── LongDict.cs
│ │ ├── LongSet.cs
│ │ ├── MultiDictionary.cs
│ │ ├── Platform.cs
│ │ ├── ProjectedList.cs
│ │ ├── ReferenceComparer.cs
│ │ ├── ResXResourceWriter.cs
│ │ ├── ResourcesFile.cs
│ │ ├── TreeTraversal.cs
│ │ ├── UnicodeNewline.cs
│ │ ├── UnionFind.cs
│ │ └── Win32Resources.cs
│ └── packages.lock.json
├── ICSharpCode.Decompiler.PowerShell/
│ ├── Demo.ps1
│ ├── ErrorIds.cs
│ ├── GetDecompiledProjectCmdlet.cs
│ ├── GetDecompiledSourceCmdlet.cs
│ ├── GetDecompiledTypesCmdlet.cs
│ ├── GetDecompilerCmdlet.cs
│ ├── GetDecompilerVersion.cs
│ ├── GetTargetFramework.cs
│ ├── ICSharpCode.Decompiler.PowerShell.csproj
│ ├── NullAttributes.cs
│ ├── README.md
│ ├── TypesParser.cs
│ └── manifest.psd1
├── ICSharpCode.Decompiler.TestRunner/
│ ├── ICSharpCode.Decompiler.TestRunner.csproj
│ └── Program.cs
├── ICSharpCode.Decompiler.Tests/
│ ├── .editorconfig
│ ├── CorrectnessTestRunner.cs
│ ├── DataFlowTest.cs
│ ├── DisassemblerPrettyTestRunner.cs
│ ├── Helpers/
│ │ ├── CodeAssert.cs
│ │ ├── RemoveCompilerAttribute.cs
│ │ ├── RoslynToolset.cs
│ │ ├── SdkUtility.cs
│ │ ├── Tester.VB.cs
│ │ ├── Tester.cs
│ │ └── TestsAssemblyOutput.cs
│ ├── ICSharpCode.Decompiler.Tests.csproj
│ ├── ILPrettyTestRunner.cs
│ ├── Output/
│ │ ├── CSharpAmbienceTests.cs
│ │ ├── ILAmbienceTests.cs
│ │ └── InsertParenthesesVisitorTests.cs
│ ├── PdbGenerationTestRunner.cs
│ ├── PrettyTestRunner.cs
│ ├── ProjectDecompiler/
│ │ ├── TargetFrameworkTests.cs
│ │ └── WholeProjectDecompilerTests.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── RoundtripAssembly.cs
│ ├── Semantics/
│ │ ├── ConversionTests.cs
│ │ ├── ExplicitConversionTest.cs
│ │ └── OverloadResolutionTests.cs
│ ├── TestAssemblyResolver.cs
│ ├── TestCases/
│ │ ├── Correctness/
│ │ │ ├── Async.cs
│ │ │ ├── BitNot.il
│ │ │ ├── Capturing.cs
│ │ │ ├── ComInterop.cs
│ │ │ ├── Comparisons.cs
│ │ │ ├── CompoundAssignment.cs
│ │ │ ├── ConditionalAttr.cs
│ │ │ ├── ControlFlow.cs
│ │ │ ├── Conversions.cs
│ │ │ ├── DecimalFields.cs
│ │ │ ├── DeconstructionTests.cs
│ │ │ ├── DynamicTests.cs
│ │ │ ├── ExpressionTrees.cs
│ │ │ ├── FloatingPointArithmetic.cs
│ │ │ ├── Generics.cs
│ │ │ ├── HelloWorld.cs
│ │ │ ├── InitializerTests.cs
│ │ │ ├── Jmp.il
│ │ │ ├── LINQRaytracer.cs
│ │ │ ├── Loops.cs
│ │ │ ├── MemberLookup.cs
│ │ │ ├── MiniJSON.cs
│ │ │ ├── NonGenericConstrainedCallVirt.il
│ │ │ ├── NullPropagation.cs
│ │ │ ├── NullableTests.cs
│ │ │ ├── OverloadResolution.cs
│ │ │ ├── PropertiesAndEvents.cs
│ │ │ ├── Readme.txt
│ │ │ ├── StackTests.il
│ │ │ ├── StackTypes.il
│ │ │ ├── StringConcat.cs
│ │ │ ├── Switch.cs
│ │ │ ├── TrickyTypes.cs
│ │ │ ├── UndocumentedExpressions.cs
│ │ │ ├── Uninit.vb
│ │ │ ├── UnsafeCode.cs
│ │ │ ├── Using.cs
│ │ │ ├── ValueTypeCall.cs
│ │ │ └── YieldReturn.cs
│ │ ├── Disassembler/
│ │ │ └── Pretty/
│ │ │ ├── .gitignore
│ │ │ ├── GenericConstraints.il
│ │ │ ├── InterfaceImplAttributes.il
│ │ │ ├── SecurityDeclarations.il
│ │ │ ├── SortMembers.expected.il
│ │ │ └── SortMembers.il
│ │ ├── ILPretty/
│ │ │ ├── .gitignore
│ │ │ ├── CS1xSwitch_Debug.cs
│ │ │ ├── CS1xSwitch_Debug.il
│ │ │ ├── CS1xSwitch_Release.cs
│ │ │ ├── CS1xSwitch_Release.il
│ │ │ ├── CallIndirect.cs
│ │ │ ├── CallIndirect.il
│ │ │ ├── ConstantBlobs.cs
│ │ │ ├── ConstantBlobs.il
│ │ │ ├── DirectCallToExplicitInterfaceImpl.cs
│ │ │ ├── DirectCallToExplicitInterfaceImpl.il
│ │ │ ├── EmptyBodies.cs
│ │ │ ├── EmptyBodies.il
│ │ │ ├── EvalOrder.cs
│ │ │ ├── EvalOrder.il
│ │ │ ├── ExtensionEncodingV1.cs
│ │ │ ├── ExtensionEncodingV1.il
│ │ │ ├── ExtensionEncodingV2.cs
│ │ │ ├── ExtensionEncodingV2.il
│ │ │ ├── FSharpLoops.fs
│ │ │ ├── FSharpLoops_Debug.cs
│ │ │ ├── FSharpLoops_Debug.il
│ │ │ ├── FSharpLoops_Release.cs
│ │ │ ├── FSharpLoops_Release.il
│ │ │ ├── FSharpUsing.fs
│ │ │ ├── FSharpUsing_Debug.cs
│ │ │ ├── FSharpUsing_Debug.il
│ │ │ ├── FSharpUsing_Release.cs
│ │ │ ├── FSharpUsing_Release.il
│ │ │ ├── GuessAccessors.cs
│ │ │ ├── GuessAccessors.il
│ │ │ ├── Issue1038.cs
│ │ │ ├── Issue1038.il
│ │ │ ├── Issue1047.cs
│ │ │ ├── Issue1047.il
│ │ │ ├── Issue1145.cs
│ │ │ ├── Issue1145.il
│ │ │ ├── Issue1157.cs
│ │ │ ├── Issue1157.il
│ │ │ ├── Issue1256.cs
│ │ │ ├── Issue1256.il
│ │ │ ├── Issue1323.cs
│ │ │ ├── Issue1323.il
│ │ │ ├── Issue1325.cs
│ │ │ ├── Issue1325.il
│ │ │ ├── Issue1325.vb
│ │ │ ├── Issue1389.cs
│ │ │ ├── Issue1389.il
│ │ │ ├── Issue1454.cs
│ │ │ ├── Issue1454.il
│ │ │ ├── Issue1681.cs
│ │ │ ├── Issue1681.il
│ │ │ ├── Issue1918.cs
│ │ │ ├── Issue1918.il
│ │ │ ├── Issue1922.cs
│ │ │ ├── Issue1922.il
│ │ │ ├── Issue2104.cs
│ │ │ ├── Issue2104.il
│ │ │ ├── Issue2260SwitchString.cs
│ │ │ ├── Issue2260SwitchString.il
│ │ │ ├── Issue2443.cs
│ │ │ ├── Issue2443.il
│ │ │ ├── Issue3344CkFinite.cs
│ │ │ ├── Issue3344CkFinite.il
│ │ │ ├── Issue3421.cs
│ │ │ ├── Issue3421.il
│ │ │ ├── Issue3442.cs
│ │ │ ├── Issue3442.il
│ │ │ ├── Issue3465.cs
│ │ │ ├── Issue3465.il
│ │ │ ├── Issue3466.cs
│ │ │ ├── Issue3466.il
│ │ │ ├── Issue3504.cs
│ │ │ ├── Issue3504.il
│ │ │ ├── Issue3524.cs
│ │ │ ├── Issue3524.il
│ │ │ ├── Issue3552.cs
│ │ │ ├── Issue3552.il
│ │ │ ├── Issue379.cs
│ │ │ ├── Issue379.il
│ │ │ ├── Issue646.cs
│ │ │ ├── Issue646.il
│ │ │ ├── Issue684.cs
│ │ │ ├── Issue684.il
│ │ │ ├── Issue959.cs
│ │ │ ├── Issue959.il
│ │ │ ├── Issue982.cs
│ │ │ ├── Issue982.il
│ │ │ ├── MonoFixed.cs
│ │ │ ├── MonoFixed.il
│ │ │ ├── SequenceOfNestedIfs.cs
│ │ │ ├── SequenceOfNestedIfs.il
│ │ │ ├── UnknownTypes.cs
│ │ │ ├── UnknownTypes.il
│ │ │ ├── Unsafe.cs
│ │ │ ├── Unsafe.il
│ │ │ ├── WeirdEnums.cs
│ │ │ └── WeirdEnums.il
│ │ ├── PdbGen/
│ │ │ ├── .gitignore
│ │ │ ├── CustomPdbId.xml
│ │ │ ├── ForLoopTests.xml
│ │ │ ├── HelloWorld.xml
│ │ │ ├── LambdaCapturing.xml
│ │ │ ├── Members.xml
│ │ │ └── ProgressReporting.xml
│ │ ├── Pretty/
│ │ │ ├── .gitignore
│ │ │ ├── AnonymousTypes.cs
│ │ │ ├── AssemblyCustomAttributes.cs
│ │ │ ├── Async.cs
│ │ │ ├── AsyncForeach.cs
│ │ │ ├── AsyncMain.cs
│ │ │ ├── AsyncStreams.cs
│ │ │ ├── AsyncUsing.cs
│ │ │ ├── AutoProperties.cs
│ │ │ ├── CS72_PrivateProtected.cs
│ │ │ ├── CS73_StackAllocInitializers.cs
│ │ │ ├── CS9_ExtensionGetEnumerator.cs
│ │ │ ├── CheckedUnchecked.cs
│ │ │ ├── Comparisons.cs
│ │ │ ├── CompoundAssignmentTest.cs
│ │ │ ├── ConstantsTests.cs
│ │ │ ├── ConstructorInitializers.cs
│ │ │ ├── CovariantReturns.cs
│ │ │ ├── CustomAttributeConflicts.cs
│ │ │ ├── CustomAttributeSamples.cs
│ │ │ ├── CustomAttributes.cs
│ │ │ ├── CustomAttributes2.cs
│ │ │ ├── CustomShortCircuitOperators.cs
│ │ │ ├── CustomTaskType.cs
│ │ │ ├── DeconstructionTests.cs
│ │ │ ├── DelegateConstruction.cs
│ │ │ ├── Discards.cs
│ │ │ ├── DynamicTests.cs
│ │ │ ├── EnumTests.cs
│ │ │ ├── ExceptionHandling.cs
│ │ │ ├── ExpandParamsArgumentsDisabled.cs
│ │ │ ├── ExpressionTrees.cs
│ │ │ ├── ExtensionProperties.cs
│ │ │ ├── FileScopedNamespaces.cs
│ │ │ ├── FixProxyCalls.cs
│ │ │ ├── FunctionPointers.cs
│ │ │ ├── Generics.cs
│ │ │ ├── GloballyQualifiedTypeInStringInterpolation.cs
│ │ │ ├── HelloWorld.cs
│ │ │ ├── IndexRangeTest.cs
│ │ │ ├── InitializerTests.cs
│ │ │ ├── InlineArrayTests.cs
│ │ │ ├── InlineAssignmentTest.cs
│ │ │ ├── InterfaceTests.cs
│ │ │ ├── Issue1080.cs
│ │ │ ├── Issue3406.cs
│ │ │ ├── Issue3439.cs
│ │ │ ├── Issue3442.cs
│ │ │ ├── Issue3452.cs
│ │ │ ├── Issue3483.cs
│ │ │ ├── Issue3541.cs
│ │ │ ├── Issue3571_A.cs
│ │ │ ├── Issue3571_B.cs
│ │ │ ├── Issue3571_C.cs
│ │ │ ├── Issue3576.cs
│ │ │ ├── Issue3584.cs
│ │ │ ├── Issue3598.cs
│ │ │ ├── Issue3610.cs
│ │ │ ├── Issue3611.cs
│ │ │ ├── LiftedOperators.cs
│ │ │ ├── LocalFunctions.cs
│ │ │ ├── Lock.cs
│ │ │ ├── Loops.cs
│ │ │ ├── MemberTests.cs
│ │ │ ├── MetadataAttributes.cs
│ │ │ ├── MultidimensionalArray.cs
│ │ │ ├── NamedArguments.cs
│ │ │ ├── NativeInts.cs
│ │ │ ├── NullPropagation.cs
│ │ │ ├── NullableRefTypes.cs
│ │ │ ├── Operators.cs
│ │ │ ├── OptionalArguments.cs
│ │ │ ├── OptionalArgumentsDisabled.cs
│ │ │ ├── OutVariables.cs
│ │ │ ├── PInvoke.cs
│ │ │ ├── ParamsCollections.cs
│ │ │ ├── PatternMatching.cs
│ │ │ ├── PointerArithmetic.cs
│ │ │ ├── PropertiesAndEvents.cs
│ │ │ ├── QualifierTests.cs
│ │ │ ├── QueryExpressions.cs
│ │ │ ├── Readme.txt
│ │ │ ├── Records.cs
│ │ │ ├── ReduceNesting.cs
│ │ │ ├── RefFields.cs
│ │ │ ├── RefLocalsAndReturns.cs
│ │ │ ├── ShortCircuit.cs
│ │ │ ├── StaticAbstractInterfaceMembers.cs
│ │ │ ├── StringInterpolation.cs
│ │ │ ├── Structs.cs
│ │ │ ├── Switch.cs
│ │ │ ├── SwitchExpressions.cs
│ │ │ ├── ThrowExpressions.cs
│ │ │ ├── TupleTests.cs
│ │ │ ├── TypeAnalysisTests.cs
│ │ │ ├── TypeMemberTests.cs
│ │ │ ├── UnsafeCode.cs
│ │ │ ├── UserDefinedConversions.cs
│ │ │ ├── Using.cs
│ │ │ ├── UsingVariables.cs
│ │ │ ├── ValueTypes.cs
│ │ │ ├── VariableNaming.cs
│ │ │ ├── VariableNamingWithoutSymbols.cs
│ │ │ ├── WellKnownConstants.cs
│ │ │ └── YieldReturn.cs
│ │ ├── Ugly/
│ │ │ ├── .gitignore
│ │ │ ├── AggressiveScalarReplacementOfAggregates.Expected.cs
│ │ │ ├── AggressiveScalarReplacementOfAggregates.cs
│ │ │ ├── AggressiveScalarReplacementOfAggregates.net40.roslyn.il
│ │ │ ├── AggressiveScalarReplacementOfAggregates.opt.net40.roslyn.il
│ │ │ ├── AggressiveScalarReplacementOfAggregates.opt.roslyn.il
│ │ │ ├── AggressiveScalarReplacementOfAggregates.roslyn.il
│ │ │ ├── NoArrayInitializers.Expected.cs
│ │ │ ├── NoArrayInitializers.cs
│ │ │ ├── NoArrayInitializers.net40.roslyn.il
│ │ │ ├── NoArrayInitializers.opt.net40.roslyn.il
│ │ │ ├── NoArrayInitializers.opt.roslyn.il
│ │ │ ├── NoArrayInitializers.roslyn.il
│ │ │ ├── NoDecimalConstants.Expected.cs
│ │ │ ├── NoDecimalConstants.cs
│ │ │ ├── NoDecimalConstants.net40.roslyn.il
│ │ │ ├── NoDecimalConstants.opt.net40.roslyn.il
│ │ │ ├── NoDecimalConstants.opt.roslyn.il
│ │ │ ├── NoDecimalConstants.roslyn.il
│ │ │ ├── NoExtensionMethods.Expected.cs
│ │ │ ├── NoExtensionMethods.cs
│ │ │ ├── NoExtensionMethods.net40.roslyn.il
│ │ │ ├── NoExtensionMethods.opt.net40.roslyn.il
│ │ │ ├── NoExtensionMethods.opt.roslyn.il
│ │ │ ├── NoExtensionMethods.roslyn.il
│ │ │ ├── NoForEachStatement.Expected.cs
│ │ │ ├── NoForEachStatement.cs
│ │ │ ├── NoForEachStatement.il
│ │ │ ├── NoForEachStatement.net40.roslyn.il
│ │ │ ├── NoForEachStatement.opt.il
│ │ │ ├── NoForEachStatement.opt.net40.roslyn.il
│ │ │ ├── NoForEachStatement.opt.roslyn.il
│ │ │ ├── NoForEachStatement.roslyn.il
│ │ │ ├── NoLocalFunctions.Expected.cs
│ │ │ ├── NoLocalFunctions.cs
│ │ │ ├── NoLocalFunctions.net40.roslyn.il
│ │ │ ├── NoLocalFunctions.opt.net40.roslyn.il
│ │ │ ├── NoLocalFunctions.opt.roslyn.il
│ │ │ ├── NoLocalFunctions.roslyn.il
│ │ │ ├── NoNewOfT.Expected.cs
│ │ │ ├── NoNewOfT.cs
│ │ │ ├── NoNewOfT.il
│ │ │ ├── NoNewOfT.net40.roslyn.il
│ │ │ ├── NoNewOfT.opt.il
│ │ │ ├── NoNewOfT.opt.net40.roslyn.il
│ │ │ ├── NoNewOfT.opt.roslyn.il
│ │ │ ├── NoNewOfT.roslyn.il
│ │ │ ├── NoPropertiesAndEvents.Expected.cs
│ │ │ ├── NoPropertiesAndEvents.cs
│ │ │ ├── NoPropertiesAndEvents.il
│ │ │ ├── NoPropertiesAndEvents.net40.roslyn.il
│ │ │ ├── NoPropertiesAndEvents.opt.il
│ │ │ ├── NoPropertiesAndEvents.opt.net40.roslyn.il
│ │ │ ├── NoPropertiesAndEvents.opt.roslyn.il
│ │ │ └── NoPropertiesAndEvents.roslyn.il
│ │ └── VBPretty/
│ │ ├── .gitignore
│ │ ├── Async.cs
│ │ ├── Async.vb
│ │ ├── Issue1906.cs
│ │ ├── Issue1906.vb
│ │ ├── Issue2192.cs
│ │ ├── Issue2192.vb
│ │ ├── Select.cs
│ │ ├── Select.vb
│ │ ├── VBAutomaticEvents.cs
│ │ ├── VBAutomaticEvents.vb
│ │ ├── VBCompoundAssign.cs
│ │ ├── VBCompoundAssign.vb
│ │ ├── VBNonGenericForEach.cs
│ │ ├── VBNonGenericForEach.vb
│ │ ├── VBPropertiesTest.cs
│ │ ├── VBPropertiesTest.vb
│ │ ├── YieldReturn.cs
│ │ └── YieldReturn.vb
│ ├── TestTraceListener.cs
│ ├── TypeSystem/
│ │ ├── ReflectionHelperTests.cs
│ │ ├── TypeSystemLoaderTests.cs
│ │ └── TypeSystemTestCase.cs
│ ├── UglyTestRunner.cs
│ ├── Util/
│ │ ├── BitSetTests.cs
│ │ ├── FileUtilityTests.cs
│ │ ├── IntervalTests.cs
│ │ └── LongSetTests.cs
│ └── VBPrettyTestRunner.cs
├── ICSharpCode.ILSpyCmd/
│ ├── AsContainer/
│ │ ├── Dockerfile
│ │ ├── DockerfileForAutomation
│ │ └── README.md
│ ├── DotNetToolUpdateChecker.cs
│ ├── ICSharpCode.ILSpyCmd.csproj
│ ├── IlspyCmdProgram.cs
│ ├── ProgramExitCodes.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── launchSettings.json
│ ├── README.md
│ ├── TypesParser.cs
│ ├── ValidationAttributes.cs
│ └── packages.lock.json
├── ICSharpCode.ILSpyX/
│ ├── Abstractions/
│ │ ├── ILanguage.cs
│ │ └── ITreeNode.cs
│ ├── Analyzers/
│ │ ├── AnalyzerContext.cs
│ │ ├── AnalyzerHelpers.cs
│ │ ├── AnalyzerScope.cs
│ │ ├── Builtin/
│ │ │ ├── AttributeAppliedToAnalyzer.cs
│ │ │ ├── EventImplementedByAnalyzer.cs
│ │ │ ├── EventOverriddenByAnalyzer.cs
│ │ │ ├── FieldAccessAnalyzer.cs
│ │ │ ├── FindTypeInAttributeDecoder.cs
│ │ │ ├── MemberImplementsInterfaceAnalyzer.cs
│ │ │ ├── MethodImplementedByAnalyzer.cs
│ │ │ ├── MethodOverriddenByAnalyzer.cs
│ │ │ ├── MethodUsedByAnalyzer.cs
│ │ │ ├── MethodUsesAnalyzer.cs
│ │ │ ├── MethodVirtualUsedByAnalyzer.cs
│ │ │ ├── PropertyImplementedByAnalyzer.cs
│ │ │ ├── PropertyOverriddenByAnalyzer.cs
│ │ │ ├── TypeExposedByAnalyzer.cs
│ │ │ ├── TypeExtensionMethodsAnalyzer.cs
│ │ │ ├── TypeInstantiatedByAnalyzer.cs
│ │ │ └── TypeUsedByAnalyzer.cs
│ │ ├── ExportAnalyzerAttribute.cs
│ │ └── IAnalyzer.cs
│ ├── ApiVisibility.cs
│ ├── AssemblyList.cs
│ ├── AssemblyListManager.cs
│ ├── AssemblyListSnapshot.cs
│ ├── Extensions/
│ │ └── CollectionExtensions.cs
│ ├── FileLoaders/
│ │ ├── ArchiveFileLoader.cs
│ │ ├── BundleFileLoader.cs
│ │ ├── FileLoaderRegistry.cs
│ │ ├── LoadResult.cs
│ │ ├── MetadataFileLoader.cs
│ │ ├── PEFileLoader.cs
│ │ ├── WebCilFileLoader.cs
│ │ └── XamarinCompressedFileLoader.cs
│ ├── ICSharpCode.ILSpyX.csproj
│ ├── LanguageVersion.cs
│ ├── LoadedAssembly.cs
│ ├── LoadedAssemblyExtensions.cs
│ ├── LoadedPackage.cs
│ ├── MermaidDiagrammer/
│ │ ├── ClassDiagrammer.cs
│ │ ├── ClassDiagrammerFactory.cs
│ │ ├── EmbeddedResource.cs
│ │ ├── Extensions/
│ │ │ ├── StringExtensions.cs
│ │ │ └── TypeExtensions.cs
│ │ ├── Factory.BuildTypes.cs
│ │ ├── Factory.FlatMembers.cs
│ │ ├── Factory.Relationships.cs
│ │ ├── Factory.TypeIds.cs
│ │ ├── Factory.TypeNames.cs
│ │ ├── GenerateHtmlDiagrammer.cs
│ │ ├── Generator.Run.cs
│ │ ├── ReadMe.md
│ │ ├── XmlDocumentationFormatter.cs
│ │ └── html/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.txt
│ │ ├── gulpfile.js
│ │ ├── package.json
│ │ ├── script.js
│ │ ├── styles.css
│ │ ├── styles.less
│ │ └── template.html
│ ├── PackageReadme.md
│ ├── PdbProvider/
│ │ ├── DebugInfoUtils.cs
│ │ ├── MonoCecilDebugInfoProvider.cs
│ │ └── PortableDebugInfoProvider.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── Search/
│ │ ├── AbstractEntitySearchStrategy.cs
│ │ ├── AbstractSearchStrategy.cs
│ │ ├── AssemblySearchStrategy.cs
│ │ ├── CSharpLexer.cs
│ │ ├── LiteralSearchStrategy.cs
│ │ ├── MemberSearchStrategy.cs
│ │ ├── MetadataTokenSearchStrategy.cs
│ │ ├── NamespaceSearchStrategy.cs
│ │ ├── ResourceSearchStrategy.cs
│ │ └── SearchResult.cs
│ ├── Settings/
│ │ ├── DecompilerSettings.cs
│ │ ├── DefaultSettingsFilePathProvider.cs
│ │ ├── ILSpySettings.cs
│ │ ├── ISettingsFilePathProvider.cs
│ │ ├── ISettingsProvider.cs
│ │ └── SettingsServiceBase.cs
│ ├── TreeView/
│ │ ├── FlatListTreeNode.cs
│ │ ├── PlatformAbstractions/
│ │ │ ├── IPlatformDataObject.cs
│ │ │ ├── IPlatformDragDrop.cs
│ │ │ ├── IPlatformDragEventArgs.cs
│ │ │ ├── IPlatformRoutedEventArgs.cs
│ │ │ ├── ITreeNodeImagesProvider.cs
│ │ │ └── XPlatDragDropEffects.cs
│ │ ├── SharpTreeNode.cs
│ │ ├── SharpTreeNodeCollection.cs
│ │ ├── TreeFlattener.cs
│ │ └── TreeTraversal.cs
│ └── packages.lock.json
├── ILSpy/
│ ├── AboutPage.cs
│ ├── Analyzers/
│ │ ├── AnalyzeCommand.cs
│ │ ├── AnalyzerEntityTreeNode.cs
│ │ ├── AnalyzerRootNode.cs
│ │ ├── AnalyzerSearchTreeNode.cs
│ │ ├── AnalyzerTreeNode.cs
│ │ ├── AnalyzerTreeView.xaml
│ │ ├── AnalyzerTreeView.xaml.cs
│ │ ├── AnalyzerTreeViewModel.cs
│ │ ├── CopyAnalysisResultsContextMenuEntry.cs
│ │ ├── RemoveAnalyzeContextMenuEntry.cs
│ │ └── TreeNodes/
│ │ ├── AnalyzedAccessorTreeNode.cs
│ │ ├── AnalyzedEventTreeNode.cs
│ │ ├── AnalyzedFieldTreeNode.cs
│ │ ├── AnalyzedMethodTreeNode.cs
│ │ ├── AnalyzedModuleTreeNode.cs
│ │ ├── AnalyzedPropertyTreeNode.cs
│ │ └── AnalyzedTypeTreeNode.cs
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppEnv/
│ │ ├── AppEnvironment.cs
│ │ ├── CommandLineArguments.cs
│ │ ├── CommandLineTools.cs
│ │ └── SingleInstance.cs
│ ├── AssemblyTree/
│ │ ├── AssemblyListPane.xaml
│ │ ├── AssemblyListPane.xaml.cs
│ │ └── AssemblyTreeModel.cs
│ ├── AvalonEdit/
│ │ ├── ITextMarker.cs
│ │ └── TextMarkerService.cs
│ ├── Commands/
│ │ ├── BrowseBackCommand.cs
│ │ ├── BrowseForwardCommand.cs
│ │ ├── CheckForUpdatesCommand.cs
│ │ ├── CommandWrapper.cs
│ │ ├── CompareContextMenuEntry.cs
│ │ ├── CopyFullyQualifiedNameContextMenuEntry.cs
│ │ ├── CreateDiagramContextMenuEntry.cs
│ │ ├── DecompileAllCommand.cs
│ │ ├── DecompileCommand.cs
│ │ ├── DecompileInNewViewCommand.cs
│ │ ├── DelegateCommand.cs
│ │ ├── DisassembleAllCommand.cs
│ │ ├── ExitCommand.cs
│ │ ├── ExportCommandAttribute.cs
│ │ ├── ExtractPackageEntryContextMenuEntry.cs
│ │ ├── GeneratePdbContextMenuEntry.cs
│ │ ├── IProtocolHandler.cs
│ │ ├── ManageAssemblyListsCommand.cs
│ │ ├── OpenCommand.cs
│ │ ├── OpenFromGacCommand.cs
│ │ ├── Pdb2XmlCommand.cs
│ │ ├── RefreshCommand.cs
│ │ ├── RemoveAssembliesWithLoadErrors.cs
│ │ ├── SaveCodeContextMenuEntry.cs
│ │ ├── SaveCommand.cs
│ │ ├── ScopeSearchToAssembly.cs
│ │ ├── ScopeSearchToNamespace.cs
│ │ ├── SearchMsdnContextMenuEntry.cs
│ │ ├── SelectPdbContextMenuEntry.cs
│ │ ├── SetThemeCommand.cs
│ │ ├── ShowCFGContextMenuEntry.cs
│ │ ├── ShowPane.cs
│ │ ├── SimpleCommand.cs
│ │ └── SortAssemblyListCommand.cs
│ ├── ContextMenuEntry.cs
│ ├── Controls/
│ │ ├── CollapsiblePanel.cs
│ │ ├── CultureSelectionConverter.cs
│ │ ├── CustomDialog.cs
│ │ ├── ExtensionMethods.cs
│ │ ├── GridViewColumnAutoSize.cs
│ │ ├── MainMenu.xaml
│ │ ├── MainMenu.xaml.cs
│ │ ├── MainToolBar.xaml
│ │ ├── MainToolBar.xaml.cs
│ │ ├── MarkupExtensions.cs
│ │ ├── ResourceObjectTable.xaml
│ │ ├── ResourceObjectTable.xaml.cs
│ │ ├── ResourceStringTable.xaml
│ │ ├── ResourceStringTable.xaml.cs
│ │ ├── SearchBox.cs
│ │ ├── SearchBoxStyle.xaml
│ │ ├── SortableGridViewColumn.cs
│ │ ├── TreeView/
│ │ │ ├── EditTextBox.cs
│ │ │ ├── ExtensionMethods.cs
│ │ │ ├── GeneralAdorner.cs
│ │ │ ├── InsertMarker.cs
│ │ │ ├── LinesRenderer.cs
│ │ │ ├── SharpGridView.cs
│ │ │ ├── SharpTreeNodeView.cs
│ │ │ ├── SharpTreeView.cs
│ │ │ ├── SharpTreeView.xaml
│ │ │ ├── SharpTreeViewAutomationPeer.cs
│ │ │ ├── SharpTreeViewItem.cs
│ │ │ ├── SharpTreeViewItemAutomationPeer.cs
│ │ │ ├── SharpTreeViewTextSearch.cs
│ │ │ ├── WpfWindowsDataObject.cs
│ │ │ ├── WpfWindowsDragDropManager.cs
│ │ │ ├── WpfWindowsDragEventArgs.cs
│ │ │ └── WpfWindowsRoutedEventArgs.cs
│ │ ├── XamlResourceExtension.cs
│ │ ├── ZoomButtons.cs
│ │ ├── ZoomScrollViewer.cs
│ │ └── ZoomScrollViewer.xaml
│ ├── DecompilationOptions.cs
│ ├── Docking/
│ │ ├── CloseAllDocumentsCommand.cs
│ │ ├── DockLayoutSettings.cs
│ │ ├── DockWorkspace.cs
│ │ ├── PaneStyleSelector.cs
│ │ └── TabPageGuardConverter.cs
│ ├── EntityReference.cs
│ ├── ExtensionMethods.cs
│ ├── GlobalUsings.cs
│ ├── GuessFileType.cs
│ ├── ILSpy.csproj
│ ├── ILSpySettingsFilePathProvider.cs
│ ├── ILSpyTraceListener.cs
│ ├── ISmartTextOutput.cs
│ ├── Images/
│ │ ├── AccessOverlayIcon.cs
│ │ ├── Assembly.xaml
│ │ ├── AssemblyList.xaml
│ │ ├── AssemblyListGAC.xaml
│ │ ├── AssemblyLoading.xaml
│ │ ├── AssemblyWarning.xaml
│ │ ├── Back.xaml
│ │ ├── Class.xaml
│ │ ├── Close.xaml
│ │ ├── CollapseAll.xaml
│ │ ├── Constructor.xaml
│ │ ├── Copy.xaml
│ │ ├── Delegate.xaml
│ │ ├── Delete.xaml
│ │ ├── DictionaryContain.xaml
│ │ ├── Enum.xaml
│ │ ├── EnumValue.xaml
│ │ ├── Event.xaml
│ │ ├── ExpandAll.xaml
│ │ ├── ExportOverlay.xaml
│ │ ├── ExtensionMethod.xaml
│ │ ├── Field.xaml
│ │ ├── FieldReadOnly.xaml
│ │ ├── FindAssembly.xaml
│ │ ├── Folder.Closed.xaml
│ │ ├── Folder.Open.xaml
│ │ ├── Forward.xaml
│ │ ├── Header.xaml
│ │ ├── Heap.xaml
│ │ ├── ILSpy.pdn
│ │ ├── Images.cs
│ │ ├── Indexer.xaml
│ │ ├── Interface.xaml
│ │ ├── Library.xaml
│ │ ├── ListFolder.Open.xaml
│ │ ├── ListFolder.xaml
│ │ ├── Literal.xaml
│ │ ├── MemberIcon.cs
│ │ ├── Metadata.xaml
│ │ ├── MetadataFile.xaml
│ │ ├── MetadataTable.xaml
│ │ ├── MetadataTableGroup.xaml
│ │ ├── Method.xaml
│ │ ├── Namespace.xaml
│ │ ├── OK.xaml
│ │ ├── Open.xaml
│ │ ├── Operator.xaml
│ │ ├── OverlayCompilerControlled.xaml
│ │ ├── OverlayInternal.xaml
│ │ ├── OverlayPrivate.xaml
│ │ ├── OverlayPrivateProtected.xaml
│ │ ├── OverlayProtected.xaml
│ │ ├── OverlayProtectedInternal.xaml
│ │ ├── OverlayStatic.xaml
│ │ ├── PInvokeMethod.xaml
│ │ ├── ProgramDebugDatabase.xaml
│ │ ├── Property.xaml
│ │ ├── README.md
│ │ ├── ReferenceFolder.xaml
│ │ ├── ReferenceOverlay.xaml
│ │ ├── Refresh.xaml
│ │ ├── Resource.xaml
│ │ ├── ResourceImage.xaml
│ │ ├── ResourceResourcesFile.xaml
│ │ ├── ResourceXml.xaml
│ │ ├── ResourceXsd.xaml
│ │ ├── ResourceXsl.xaml
│ │ ├── ResourceXslt.xaml
│ │ ├── ResultToJSON.xaml
│ │ ├── Save.xaml
│ │ ├── Search.xaml
│ │ ├── SearchMsdn.xaml
│ │ ├── ShowAll.xaml
│ │ ├── ShowPrivateInternal.xaml
│ │ ├── ShowPublicOnly.xaml
│ │ ├── Sort.xaml
│ │ ├── Struct.xaml
│ │ ├── SubTypes.xaml
│ │ ├── SuperTypes.xaml
│ │ ├── SwitchSourceOrTarget.xaml
│ │ ├── TypeIcon.cs
│ │ ├── ViewCode.xaml
│ │ ├── VirtualMethod.xaml
│ │ ├── Warning.xaml
│ │ ├── WebAssembly.xaml
│ │ ├── WpfWindowsTreeNodeImagesProvider.cs
│ │ ├── ZoomIn.xaml
│ │ └── ZoomOut.xaml
│ ├── LanguageSettings.cs
│ ├── Languages/
│ │ ├── CSharpBracketSearcher.cs
│ │ ├── CSharpHighlightingTokenWriter.cs
│ │ ├── CSharpILMixedLanguage.cs
│ │ ├── CSharpLanguage.cs
│ │ ├── ILAstLanguage.cs
│ │ ├── ILLanguage.cs
│ │ ├── IResourceFileHandler.cs
│ │ ├── Language.cs
│ │ └── LanguageService.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MainWindowViewModel.cs
│ ├── Metadata/
│ │ ├── CoffHeaderTreeNode.cs
│ │ ├── CorTables/
│ │ │ ├── AssemblyRefTableTreeNode.cs
│ │ │ ├── AssemblyTableTreeNode.cs
│ │ │ ├── ClassLayoutTableTreeNode.cs
│ │ │ ├── ConstantTableTreeNode.cs
│ │ │ ├── CustomAttributeTableTreeNode.cs
│ │ │ ├── DeclSecurityTableTreeNode.cs
│ │ │ ├── EventMapTableTreeNode.cs
│ │ │ ├── EventTableTreeNode.cs
│ │ │ ├── ExportedTypeTableTreeNode.cs
│ │ │ ├── FieldLayoutTableTreeNode.cs
│ │ │ ├── FieldMarshalTableTreeNode.cs
│ │ │ ├── FieldRVATableTreeNode.cs
│ │ │ ├── FieldTableTreeNode.cs
│ │ │ ├── FileTableTreeNode.cs
│ │ │ ├── GenericParamConstraintTableTreeNode.cs
│ │ │ ├── GenericParamTableTreeNode.cs
│ │ │ ├── ImplMapTableTreeNode.cs
│ │ │ ├── InterfaceImplTableTreeNode.cs
│ │ │ ├── ManifestResourceTableTreeNode.cs
│ │ │ ├── MemberRefTableTreeNode.cs
│ │ │ ├── MethodImplTableTreeNode.cs
│ │ │ ├── MethodSemanticsTableTreeNode.cs
│ │ │ ├── MethodSpecTableTreeNode.cs
│ │ │ ├── MethodTableTreeNode.cs
│ │ │ ├── ModuleRefTableTreeNode.cs
│ │ │ ├── ModuleTableTreeNode.cs
│ │ │ ├── NestedClassTableTreeNode.cs
│ │ │ ├── ParamTableTreeNode.cs
│ │ │ ├── PropertyMapTableTreeNode.cs
│ │ │ ├── PropertyTableTreeNode.cs
│ │ │ ├── PtrTableTreeNode.cs
│ │ │ ├── StandAloneSigTableTreeNode.cs
│ │ │ ├── TypeDefTableTreeNode.cs
│ │ │ ├── TypeRefTableTreeNode.cs
│ │ │ └── TypeSpecTableTreeNode.cs
│ │ ├── DataDirectoriesTreeNode.cs
│ │ ├── DebugDirectory/
│ │ │ ├── CodeViewTreeNode.cs
│ │ │ ├── DebugDirectoryEntryTreeNode.cs
│ │ │ └── PdbChecksumTreeNode.cs
│ │ ├── DebugDirectoryTreeNode.cs
│ │ ├── DebugMetadataTablesTreeNode.cs
│ │ ├── DebugTables/
│ │ │ ├── CustomDebugInformationTableTreeNode.cs
│ │ │ ├── DocumentTableTreeNode.cs
│ │ │ ├── ImportScopeTableTreeNode.cs
│ │ │ ├── LocalConstantTableTreeNode.cs
│ │ │ ├── LocalScopeTableTreeNode.cs
│ │ │ ├── LocalVariableTableTreeNode.cs
│ │ │ ├── MethodDebugInformationTableTreeNode.cs
│ │ │ └── StateMachineMethodTableTreeNode.cs
│ │ ├── DosHeaderTreeNode.cs
│ │ ├── FlagsFilterControl.xaml
│ │ ├── FlagsFilterControl.xaml.cs
│ │ ├── FlagsTooltip.xaml
│ │ ├── FlagsTooltip.xaml.cs
│ │ ├── GoToTokenCommand.cs
│ │ ├── Heaps/
│ │ │ ├── BlobHeapTreeNode.cs
│ │ │ ├── GuidHeapTreeNode.cs
│ │ │ ├── StringHeapTreeNode.cs
│ │ │ └── UserStringHeapTreeNode.cs
│ │ ├── Helpers.cs
│ │ ├── HexFilterControl.xaml
│ │ ├── HexFilterControl.xaml.cs
│ │ ├── MetaDataGrid.cs
│ │ ├── MetadataHeapTreeNode.cs
│ │ ├── MetadataProtocolHandler.cs
│ │ ├── MetadataTableTreeNode.cs
│ │ ├── MetadataTableViews.xaml
│ │ ├── MetadataTableViews.xaml.cs
│ │ ├── MetadataTablesTreeNode.cs
│ │ ├── MetadataTreeNode.cs
│ │ └── OptionalHeaderTreeNode.cs
│ ├── NativeMethods.cs
│ ├── NavigationHistory.cs
│ ├── NavigationState.cs
│ ├── Options/
│ │ ├── DecompilerSettingsPanel.xaml
│ │ ├── DecompilerSettingsPanel.xaml.cs
│ │ ├── DecompilerSettingsViewModel.cs
│ │ ├── DisplaySettings.cs
│ │ ├── DisplaySettingsPanel.xaml
│ │ ├── DisplaySettingsPanel.xaml.cs
│ │ ├── DisplaySettingsViewModel.cs
│ │ ├── MiscSettings.cs
│ │ ├── MiscSettingsPanel.xaml
│ │ ├── MiscSettingsPanel.xaml.cs
│ │ ├── MiscSettingsViewModel.cs
│ │ ├── OptionsDialog.xaml
│ │ ├── OptionsDialog.xaml.cs
│ │ └── OptionsDialogViewModel.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── WPFAssemblyInfo.cs
│ │ └── launchSettings.json
│ ├── Search/
│ │ ├── SearchPane.xaml
│ │ ├── SearchPane.xaml.cs
│ │ ├── SearchPaneModel.cs
│ │ └── SearchResultFactory.cs
│ ├── SessionSettings.cs
│ ├── SolutionWriter.cs
│ ├── TaskHelper.cs
│ ├── TextView/
│ │ ├── Asm-Mode.xshd
│ │ ├── AvalonEditTextOutput.cs
│ │ ├── BracketHighlightRenderer.cs
│ │ ├── CSharp-Mode.xshd
│ │ ├── CaretHighlightAdorner.cs
│ │ ├── DecompilerTextEditor.cs
│ │ ├── DecompilerTextView.cs
│ │ ├── DecompilerTextView.xaml
│ │ ├── DocumentationUIBuilder.cs
│ │ ├── EditorCommands.cs
│ │ ├── FoldingCommands.cs
│ │ ├── ILAsm-Mode.xshd
│ │ ├── OutputLengthExceededException.cs
│ │ ├── ReferenceElementGenerator.cs
│ │ ├── ThemeAwareHighlightingColorizer.cs
│ │ ├── UIElementGenerator.cs
│ │ ├── XML-Mode.xshd
│ │ └── ZoomLevelToTextFormattingModeConverter.cs
│ ├── Themes/
│ │ ├── Base.Dark.xaml
│ │ ├── Base.Light.xaml
│ │ ├── ResourceKeys.cs
│ │ ├── SyntaxColor.cs
│ │ ├── Theme.Dark.xaml
│ │ ├── Theme.Light.xaml
│ │ ├── Theme.RSharpDark.xaml
│ │ ├── Theme.RSharpLight.xaml
│ │ ├── Theme.VSCodeDarkPlus.xaml
│ │ ├── Theme.VSCodeLightPlus.xaml
│ │ ├── ThemeManager.cs
│ │ ├── WindowStyleManagerBehavior.cs
│ │ └── generic.xaml
│ ├── TreeNodes/
│ │ ├── AssemblyListTreeNode.cs
│ │ ├── AssemblyReferenceReferencedTypesTreeNode.cs
│ │ ├── AssemblyReferenceTreeNode.cs
│ │ ├── AssemblyTreeNode.cs
│ │ ├── BaseTypesEntryNode.cs
│ │ ├── BaseTypesTreeNode.cs
│ │ ├── DerivedTypesEntryNode.cs
│ │ ├── DerivedTypesTreeNode.cs
│ │ ├── EventTreeNode.cs
│ │ ├── ExportedTypeTreeNode.cs
│ │ ├── FieldTreeNode.cs
│ │ ├── FilterResult.cs
│ │ ├── ILSpyTreeNode.cs
│ │ ├── IMemberTreeNode.cs
│ │ ├── MemberReferenceTreeNode.cs
│ │ ├── MethodTreeNode.cs
│ │ ├── ModuleReferenceTreeNode.cs
│ │ ├── NamespaceTreeNode.cs
│ │ ├── NaturalStringComparer.cs
│ │ ├── PackageFolderTreeNode.cs
│ │ ├── PropertyTreeNode.cs
│ │ ├── ReferenceFolderTreeNode.cs
│ │ ├── ResourceListTreeNode.cs
│ │ ├── ResourceNodes/
│ │ │ ├── CursorResourceEntryNode.cs
│ │ │ ├── IResourceNodeFactory.cs
│ │ │ ├── IconResourceEntryNode.cs
│ │ │ ├── ImageListResourceEntryNode.cs
│ │ │ ├── ImageResourceEntryNode.cs
│ │ │ ├── ResourceEntryNode.cs
│ │ │ ├── ResourceTreeNode.cs
│ │ │ ├── ResourcesFileTreeNode.cs
│ │ │ ├── XamlResourceNode.cs
│ │ │ └── XmlResourceNode.cs
│ │ ├── ThreadingSupport.cs
│ │ ├── TypeReferenceTreeNode.cs
│ │ └── TypeTreeNode.cs
│ ├── Updates/
│ │ ├── AppUpdateService.cs
│ │ ├── AvailableVersionInfo.cs
│ │ ├── UpdateService.cs
│ │ └── UpdateSettings.cs
│ ├── Util/
│ │ ├── GlobalUtils.cs
│ │ ├── GraphVizGraph.cs
│ │ ├── MessageBus.cs
│ │ ├── ResourceHelper.cs
│ │ ├── SettingsService.cs
│ │ └── ShellHelper.cs
│ ├── ViewModels/
│ │ ├── CompareViewModel.cs
│ │ ├── DebugStepsPaneModel.cs
│ │ ├── LegacyToolPaneModel.cs
│ │ ├── ManageAssemblyListsViewModel.cs
│ │ ├── PaneModel.cs
│ │ ├── TabPageModel.cs
│ │ ├── ToolPaneModel.cs
│ │ └── UpdatePanelViewModel.cs
│ ├── Views/
│ │ ├── CompareView.xaml
│ │ ├── CompareView.xaml.cs
│ │ ├── CreateListDialog.xaml
│ │ ├── CreateListDialog.xaml.cs
│ │ ├── DebugSteps.xaml
│ │ ├── DebugSteps.xaml.cs
│ │ ├── ManageAssemblyLIstsDialog.xaml.cs
│ │ ├── ManageAssemblyListsDialog.xaml
│ │ ├── OpenFromGacDialog.xaml
│ │ ├── OpenFromGacDialog.xaml.cs
│ │ ├── UpdatePanel.xaml
│ │ └── UpdatePanel.xaml.cs
│ └── app.manifest
├── ILSpy.AddIn/
│ ├── Decompiler/
│ │ └── Dummy.cs
│ ├── ILSpy.AddIn.csproj
│ ├── ILSpyAddIn.en-US.vsct
│ ├── ILSpyAddIn.vsct
│ ├── Key.snk
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── launchSettings.json
│ ├── README.md
│ └── source.extension.vsixmanifest.template
├── ILSpy.AddIn.Shared/
│ ├── AssemblyFileFinder.cs
│ ├── Commands/
│ │ ├── AssemblyReferenceForILSpy.cs
│ │ ├── NuGetReferenceForILSpy.cs
│ │ ├── OpenCodeItemCommand.cs
│ │ ├── OpenILSpyCommand.cs
│ │ ├── OpenProjectOutputCommand.cs
│ │ ├── OpenReferenceCommand.cs
│ │ ├── ProjectItemForILSpy.cs
│ │ └── ProjectReferenceForILSpy.cs
│ ├── GlobalSuppressions.cs
│ ├── Guids.cs
│ ├── ILSpy.AddIn.Shared.projitems
│ ├── ILSpy.AddIn.Shared.shproj
│ ├── ILSpyAddInPackage.cs
│ ├── ILSpyInstance.cs
│ ├── PkgCmdID.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── SyntaxNodeExtensions.cs
│ ├── Utils.cs
│ ├── VSPackage.en-US.resx
│ └── VSPackage.resx
├── ILSpy.AddIn.VS2022/
│ ├── Decompiler/
│ │ └── Dummy.cs
│ ├── ILSpy.AddIn.VS2022.csproj
│ ├── ILSpyAddIn.en-US.vsct
│ ├── ILSpyAddIn.vsct
│ ├── Key.snk
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── launchSettings.json
│ ├── README.md
│ └── source.extension.vsixmanifest.template
├── ILSpy.BamlDecompiler/
│ ├── BamlResourceEntryNode.cs
│ ├── BamlResourceNodeFactory.cs
│ ├── ILSpy.BamlDecompiler.csproj
│ └── Properties/
│ ├── AssemblyInfo.cs
│ └── launchSettings.json
├── ILSpy.BamlDecompiler.Tests/
│ ├── BamlTestRunner.cs
│ ├── Cases/
│ │ ├── AttachedEvent.xaml
│ │ ├── AttachedEvent.xaml.cs
│ │ ├── AvalonDockBrushes.xaml
│ │ ├── AvalonDockCommon.xaml
│ │ ├── CustomControl.cs
│ │ ├── Dictionary1.xaml
│ │ ├── EscapeSequence.xaml
│ │ ├── Issue1435.xaml
│ │ ├── Issue1546.xaml
│ │ ├── Issue1547.xaml
│ │ ├── Issue1547.xaml.cs
│ │ ├── Issue2052.xaml
│ │ ├── Issue2097.xaml
│ │ ├── Issue2097.xaml.cs
│ │ ├── Issue2116.xaml
│ │ ├── Issue2116.xaml.cs
│ │ ├── Issue3318.xaml
│ │ ├── Issue3318.xaml.cs
│ │ ├── Issue445.xaml
│ │ ├── Issue775.xaml
│ │ ├── MarkupExtension.xaml
│ │ ├── MyControl.xaml
│ │ ├── MyControl.xaml.cs
│ │ ├── NamespacePrefix.xaml
│ │ ├── ReadonlyProperty.xaml
│ │ ├── ReadonlyProperty.xaml.cs
│ │ ├── Resources.xaml
│ │ ├── Resources.xaml.cs
│ │ ├── Simple.xaml
│ │ ├── Simple.xaml.cs
│ │ ├── SimpleDictionary.xaml
│ │ ├── SimpleNames.xaml
│ │ ├── SimpleNames.xaml.cs
│ │ └── SimplePropertyElement.xaml
│ ├── ILSpy.BamlDecompiler.Tests.csproj
│ └── Mocks/
│ └── AvalonDock.cs
├── ILSpy.Installer/
│ ├── AppPackage.cs
│ ├── ILSpy.Installer.csproj
│ ├── README.md
│ ├── setup.cs
│ └── winui.wxl
├── ILSpy.Installer.sln
├── ILSpy.ReadyToRun/
│ ├── ILSpy.ReadyToRun.csproj
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ └── launchSettings.json
│ ├── ReadyToRunDisassembler.cs
│ ├── ReadyToRunLanguage.cs
│ ├── ReadyToRunOptionPage.xaml
│ ├── ReadyToRunOptionPage.xaml.cs
│ └── ReadyToRunOptions.cs
├── ILSpy.Tests/
│ ├── Analyzers/
│ │ ├── AnalyzerScopeTests.cs
│ │ ├── ExportAnalyzerAttributeTests.cs
│ │ ├── MemberImplementsInterfaceAnalyzerTests.cs
│ │ ├── MethodUsesAnalyzerTests.cs
│ │ ├── TestCases/
│ │ │ └── MainAssembly.cs
│ │ └── TypeUsedByAnalyzerTests.cs
│ ├── BitmapContainer.resources
│ ├── CommandLineArgumentsTests.cs
│ ├── ILSpy.Tests.csproj
│ ├── IconContainer.resx
│ ├── ResourceReaderWriterTests.cs
│ └── Test.resources
├── ILSpy.VSExtensions.sln
├── ILSpy.Wpf.slnf
├── ILSpy.XPlat.slnf
├── ILSpy.sln
├── LICENSE
├── NuGet.config
├── README.md
├── SECURITY.md
├── TestPlugin/
│ ├── AboutPageAddition.cs
│ ├── ContextMenuCommand.cs
│ ├── CustomLanguage.cs
│ ├── CustomOptionPage.xaml
│ ├── CustomOptionPage.xaml.cs
│ ├── MainMenuCommand.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ └── launchSettings.json
│ ├── Readme.txt
│ └── TestPlugin.csproj
├── clean.bat
├── debugbuild.bat
├── decompiler-nuget-demos.ipynb
├── doc/
│ ├── Command Line.txt
│ ├── ILAst Pattern Matching.md
│ ├── ILAst.txt
│ ├── ILSpyAboutPage.txt
│ ├── IntPtr.txt
│ ├── Pattern Matching.html
│ ├── README.md
│ ├── Resources.txt
│ ├── copyright.txt
│ └── third-party-notices.txt
├── global.json
├── publish.ps1
├── publishlocaldev.ps1
├── releasebuild.bat
└── updatedeps.bat
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
; Top-most EditorConfig file
root = true
[*]
charset = utf-8 # standardize on no BOM (except resx, see below)
indent_style = tab
indent_size = 4
guidelines = 110
tab_width = 4
end_of_line = crlf
# .net tooling writes the BOM to resx files on running dotnet build ILSpy.sln regardless,
# so we should direct text editors to NOT change the file
[*.resx]
charset = utf-8-bom
[*.il]
indent_style = space
indent_size = 2
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.{csproj,props}]
indent_style = space
indent_size = 2
[*.config]
indent_style = space
indent_size = 2
[*.nuspec]
indent_style = space
indent_size = 2
[*.vsixmanifest]
indent_style = space
indent_size = 2
[*.vsct]
indent_style = space
indent_size = 2
[*.cs]
# New line preferences
csharp_new_line_before_open_brace = methods, types, control_blocks, local_functions
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_within_query_expression_clauses = false
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = no_change
# Avoid 'this.' in generated code unless absolutely necessary, but allow developers to use it
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Do not use 'var' when generating code, but allow developers to use it
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:silent
# Use language keywords instead of BCL types when generating code, but allow developers to use either
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Using directives
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
# Wrapping
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
# Code style
csharp_prefer_braces = true:silent
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Naming rules
# Naming styles:
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case
# Symbol groups:
# all non-private fields
dotnet_naming_symbols.fields_symbols.applicable_accessibilities = *
dotnet_naming_symbols.fields_symbols.applicable_kinds = field
# all private/protected fields except constants
dotnet_naming_symbols.private_fields_symbols.applicable_accessibilities = private,protected,private_protected
dotnet_naming_symbols.private_fields_symbols.applicable_kinds = field
# Naming rules:
# all non-private fields are pascal case
dotnet_naming_rule.fields_rule.severity = warning
dotnet_naming_rule.fields_rule.style = upper_camel_case_style
dotnet_naming_rule.fields_rule.symbols = fields_symbols
# all private fields are camel case
dotnet_naming_rule.private_fields_rule.severity = warning
dotnet_naming_rule.private_fields_rule.style = lower_camel_case_style
dotnet_naming_rule.private_fields_rule.symbols = private_fields_symbols
# General settings:
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_prefer_system_threading_lock = true:suggestion
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_static_anonymous_function = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = omit_if_default:suggestion
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Errors and warnings
dotnet_diagnostic.IDE0007.severity = none
dotnet_diagnostic.CA1001.severity = warning
dotnet_diagnostic.CA1009.severity = warning
dotnet_diagnostic.CA1016.severity = warning
#dotnet_diagnostic.CA1033.severity = warning # Disabled because currently, there are too many violations
dotnet_diagnostic.CA1049.severity = warning
dotnet_diagnostic.CA1060.severity = warning
dotnet_diagnostic.CA1061.severity = warning
dotnet_diagnostic.CA1063.severity = warning
dotnet_diagnostic.CA1065.severity = warning
dotnet_diagnostic.CA1301.severity = warning
dotnet_diagnostic.CA1400.severity = warning
dotnet_diagnostic.CA1401.severity = warning
dotnet_diagnostic.CA1403.severity = warning
dotnet_diagnostic.CA1404.severity = warning
dotnet_diagnostic.CA1405.severity = warning
dotnet_diagnostic.CA1410.severity = warning
dotnet_diagnostic.CA1415.severity = warning
dotnet_diagnostic.CA1821.severity = warning
dotnet_diagnostic.CA1900.severity = warning
dotnet_diagnostic.CA1901.severity = warning
dotnet_diagnostic.CA2002.severity = warning
dotnet_diagnostic.CA2100.severity = warning
dotnet_diagnostic.CA2101.severity = warning
dotnet_diagnostic.CA2108.severity = warning
dotnet_diagnostic.CA2111.severity = warning
dotnet_diagnostic.CA2112.severity = warning
dotnet_diagnostic.CA2114.severity = warning
dotnet_diagnostic.CA2116.severity = warning
dotnet_diagnostic.CA2117.severity = warning
dotnet_diagnostic.CA2122.severity = warning
dotnet_diagnostic.CA2123.severity = warning
dotnet_diagnostic.CA2124.severity = warning
dotnet_diagnostic.CA2126.severity = warning
dotnet_diagnostic.CA2131.severity = warning
dotnet_diagnostic.CA2132.severity = warning
dotnet_diagnostic.CA2133.severity = warning
dotnet_diagnostic.CA2134.severity = warning
dotnet_diagnostic.CA2137.severity = warning
dotnet_diagnostic.CA2138.severity = warning
dotnet_diagnostic.CA2140.severity = warning
dotnet_diagnostic.CA2141.severity = warning
dotnet_diagnostic.CA2146.severity = warning
dotnet_diagnostic.CA2147.severity = warning
dotnet_diagnostic.CA2149.severity = warning
dotnet_diagnostic.CA2200.severity = warning
dotnet_diagnostic.CA2202.severity = warning
dotnet_diagnostic.CA2207.severity = warning
dotnet_diagnostic.CA2212.severity = warning
dotnet_diagnostic.CA2213.severity = warning
dotnet_diagnostic.CA2214.severity = warning
dotnet_diagnostic.CA2216.severity = warning
dotnet_diagnostic.CA2220.severity = warning
dotnet_diagnostic.CA2229.severity = warning
dotnet_diagnostic.CA2231.severity = warning
dotnet_diagnostic.CA2232.severity = warning
dotnet_diagnostic.CA2235.severity = warning
dotnet_diagnostic.CA2236.severity = warning
dotnet_diagnostic.CA2237.severity = warning
dotnet_diagnostic.CA2238.severity = warning
dotnet_diagnostic.CA2240.severity = warning
dotnet_diagnostic.CA2241.severity = warning
dotnet_diagnostic.CA2242.severity = warning
# MEF006: No importing constructor
dotnet_diagnostic.MEF006.severity = silent
================================================
FILE: .git-blame-ignore-revs
================================================
# https://github.com/icsharpcode/ILSpy/issues/2128
0d9f871a4f7c478fdf3f7b699d74e77506e978a4
================================================
FILE: .gitattributes
================================================
* text=auto
*.cs text diff=csharp
*.sln text eol=crlf
*.csproj text eol=crlf
================================================
FILE: .github/FUNDING.yml
================================================
github: [dgrunwald, siegfriedpammer, christophwille]
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: General bug report
about: Error dialog, crash, or anything else unrelated to the decompiled code
title: ''
labels: Bug
assignees: ''
---
### Steps to reproduce
1.
2.
3.
### Error message shown
```
Copy and paste any error messages / relevant text and/or screenshot the incorrect behaviour.
```
### Details
* Product in use: e.g. ILSpy / ICSharpCode.Decompiler nuget package / VS extension
* Version in use: e.g. 6.0.0 or a commit hash (use Help>About to see which ILSpy version you are using)
* Any other relevant information to the issue, or your interest in contributing a fix.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is and why it's important to you. Ex. I'm always frustrated when [...]
Any (even unsuccessful) ways in which you've tried to workaround the problem currently
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/wrong_decompilation.md
================================================
---
name: Wrong decompilation
about: Decompiled code doesn't compile, or behaves differently to the original IL
title: ''
labels: Bug, Decompiler
assignees: ''
---
### Input code
Please provide the input that failed to decompile.
If providing IL code as input, please provide enough context to allow us to re-assemble the IL.
If uploading a complete assembly, please mention which method failed to decompile.
### Erroneous output
```c#
If relevant, the incorrectly decompiled output, or an exception with stack trace.
```
If the output fails to re-compile, provide the compiler error message.
If the output has the wrong behavior, explain how it differs from the expected behavior.
### Details
* Product in use: e.g. ILSpy / ICSharpCode.Decompiler nuget package / VS extension
* Version in use: e.g. 6.0.0 or a commit hash (use Help>About to see which ILSpy version you are using)
* Any other relevant information to the issue, or your interest in contributing a fix.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
Link to issue(s) this covers
### Problem
Link to, or brief information about the issue
### Solution
* Any comments on the approach taken, its consistency with surrounding code, etc.
* Which part of this PR is most in need of attention/improvement?
* [ ] At least one test covering the code changed
================================================
FILE: .github/dependabot.yml
================================================
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
================================================
FILE: .github/workflows/build-frontends.yml
================================================
name: Build XPlat Frontends
on:
push:
branches: '**'
pull_request:
branches: [ master, release/** ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Install dependencies
run: dotnet restore ILSpy.XPlat.slnf -p:RestoreEnablePackagePruning=false
- name: Build Debug
run: dotnet msbuild ILSpy.XPlat.slnf -p:Configuration=Debug -bl:Debug.binlog
- name: Build Release
run: dotnet msbuild ILSpy.XPlat.slnf -p:Configuration=Release -bl:Release.binlog
- name: list files
if: always()
run: ls -la
- name: print VERSION
if: always()
run: cat VERSION
- name: Upload binlog
if: always()
uses: actions/upload-artifact@v7
with:
name: binlog
path: '**/*.binlog'
if-no-files-found: error
================================================
FILE: .github/workflows/build-ilspy.yml
================================================
name: Build ILSpy
on:
push:
branches: '**'
pull_request:
branches: [ master, release/** ]
permissions:
contents: read
jobs:
Build:
permissions:
packages: write # for dotnet nuget push
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
Configuration: [ Debug, Release ]
env:
BuildPlatform: Any CPU
StagingDirectory: buildartifacts
steps:
- run: mkdir -p $env:StagingDirectory
- uses: actions/checkout@v6
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
env:
DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet
DOTNET_ROOT: ${{ runner.temp }}/.dotnet
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Install dotnet-format
env:
DOTNET_FORMAT_VERSION: 10.0.100-rtm.25531.102
DOTNET_FORMAT_SOURCE: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10-transport/nuget/v3/index.json
run: dotnet tool install -g dotnet-format --version "${{env.DOTNET_FORMAT_VERSION}}" --add-source "${{env.DOTNET_FORMAT_SOURCE}}"
- name: Install wix (locked version)
run: dotnet tool install --global wix --version 6.0.2
- name: Install wix extesnion (locked version)
run: wix.exe extension add -g WixToolset.UI.wixext/6.0.2
- name: Get Version
id: version
shell: pwsh
run: |
.\BuildTools\ghactions-install.ps1
Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "$($_.Name)=$($_.Value)" } | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Restore the application
run: msbuild ILSpy.sln /t:Restore /p:RestoreEnablePackagePruning=false /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform
- name: Build
run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m
- name: Format check
run: dotnet-format whitespace --verify-no-changes --verbosity detailed ILSpy.sln
- name: Execute unit tests
run: dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} --no-build --report-trx --results-directory test-results/${{ matrix.configuration }}
- name: Upload Test Logs
uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: test-results-${{ matrix.configuration }}
path: 'test-results/${{ matrix.configuration }}/*.trx'
- name: Create Test Report
uses: icsharpcode/test-summary-action@dist
if: always()
with:
paths: "test-results/${{ matrix.configuration }}/*.trx"
folded: true
- name: Verify package contents
if: matrix.configuration == 'debug'
shell: pwsh
run: |
.\BuildTools\create-filelists.ps1
git diff --exit-code
- name: Zip ILSpy (framework-dependent)
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries.zip .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*.dll .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*.exe .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*.config .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*.json .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*\ILSpy.resources.dll .\ILSpy\bin\${{ matrix.configuration }}\net10.0-windows\*\ILSpy.ReadyToRun.Plugin.resources.dll
- name: Publish x64/arm64 framework-dependent/self-contained
shell: pwsh
run: .\publish.ps1
- name: Zip ILSpy Release (x64 self-contained)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_selfcontained_x64.zip .\ILSpy\bin\Release\net10.0-windows\win-x64\publish\selfcontained\*
- name: Zip ILSpy Release (arm64 framework-dependent)
if: matrix.configuration == 'release'
run: 7z a -tzip $env:StagingDirectory\ILSpy_binaries_arm64.zip .\ILSpy\bin\Release\net10.0-windows\win-arm64\publish\fwdependent\*
- name: Pack NuGets
if: matrix.configuration == 'release'
run: |
dotnet pack ICSharpCode.Decompiler --no-restore
dotnet pack ICSharpCode.BamlDecompiler --no-restore
dotnet pack ICSharpCode.ILSpyX --no-restore
- name: Build Installer (x64 and arm64, framework-dependent)
if: matrix.configuration == 'release'
run: |
msbuild ILSpy.Installer.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.Installer.sln /p:Configuration="Release" /p:Platform="Any CPU" /p:PlatformForInstaller="ARM64"
- name: Build VS Extensions (for 2017-2019 and 2022)
if: matrix.configuration == 'release'
run: |
msbuild ILSpy.VSExtensions.sln /t:Restore /p:Configuration="Release" /p:Platform="Any CPU"
msbuild ILSpy.VSExtensions.sln /p:Configuration="Release" /p:Platform="Any CPU"
# https://github.com/actions/upload-artifact
- name: Upload VSIX (VS 2019) release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy VS Addin for VS 2017-2019 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error
- name: Upload VSIX (VS 2022) release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy VS Addin for VS 2022 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.AddIn.VS2022\bin\${{ matrix.configuration }}\net472\*.vsix
if-no-files-found: error
- name: Upload Decompiler NuGet release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ICSharpCode.Decompiler NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg
if-no-files-found: error
- name: Publish Decompiler NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.Decompiler\bin\Release\ICSharpCode.Decompiler*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Upload ILSpyX NuGet release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ICSharpCode.ILSpyX NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.ILSpyX\bin\Release\ICSharpCode.ILSpyX*.nupkg
if-no-files-found: error
- name: Publish ILSpyX NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.ILSpyX\bin\Release\ICSharpCode.ILSpyX*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Upload BamlDecompiler NuGet release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ICSharpCode.BamlDecompiler NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.BamlDecompiler\bin\Release\ICSharpCode.BamlDecompiler*.nupkg
if-no-files-found: error
- name: Publish DecomBamlDecompilerpiler NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.BamlDecompiler\bin\Release\ICSharpCode.BamlDecompiler*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Upload zip binaries build artifacts
uses: actions/upload-artifact@v7
with:
name: ILSpy ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries.zip
if-no-files-found: error
- name: Upload x64 self-contained zip (Release-only)
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy self-contained x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_selfcontained_x64.zip
if-no-files-found: error
- name: Upload arm64 framework-dependent zip (Release-only)
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy arm64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ${{ env.StagingDirectory }}\ILSpy_binaries_arm64.zip
if-no-files-found: error
- name: Upload x64 installer artifact
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy Installer x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*-x64.msi
if-no-files-found: error
- name: Upload arm64 installer artifact
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ILSpy Installer arm64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (${{ matrix.configuration }})
path: ILSpy.Installer\wix\*-arm64.msi
if-no-files-found: error
- name: Upload ilspycmd release build artifacts
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v7
with:
name: ilspycmd dotnet tool (${{ matrix.configuration }})
path: ICSharpCode.ILSpyCmd\bin\Release\ilspycmd*.nupkg
if-no-files-found: error
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: '**'
pull_request:
branches: [ master, release/** ]
permissions:
contents: read
jobs:
analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
security-events: write # for github/codeql-action/analyze to upload SARIF results
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Build
run: dotnet build ILSpy.XPlat.slnf --configuration Release -p:RestoreEnablePackagePruning=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
================================================
FILE: .github/workflows/generate-bom.yml
================================================
name: Generate BOM
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: windows-2022
steps:
- name: Checkout
run: git config --global core.autocrlf true
- uses: actions/checkout@v6
with:
submodules: true
persist-credentials: false
- name: Install CycloneDX
run: dotnet tool install --global CycloneDX
- name: Analyze
run: dotnet-CycloneDX ILSpy/ILSpy.csproj --output sbom --recursive --exclude-dev --exclude-test-projects
- name: Upload BOM
uses: actions/upload-artifact@v7
with:
name: ILSpyBOM.xml
path: sbom/bom.xml
if-no-files-found: error
================================================
FILE: .github/workflows/lock.yml
================================================
name: 'Lock threads'
on:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
lock:
permissions:
issues: write # for dessant/lock-threads to lock issues
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v6.0.0
with:
github-token: ${{ github.token }}
issue-inactive-days: '90'
issue-lock-reason: 'resolved'
process-only: 'issues'
================================================
FILE: .github/workflows/scorecard.yml
================================================
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection (disabled)
# branch_protection_rule:
workflow_dispatch:
# schedule ("Maintained") and push are disabled atm
# schedule:
# - cron: '25 1 * * 2'
# push:
# branches: [ "master" ]
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write # Needed to upload the results to code-scanning dashboard.
id-token: write # Needed to publish results and get a badge (see publish_results below).
steps:
- name: "Checkout code"
uses: actions/checkout@v6
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@v2.4.3 # https://github.com/marketplace/actions/ossf-scorecard-action
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: "Upload artifact"
uses: actions/upload-artifact@v7
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: results.sarif
================================================
FILE: .gitignore
================================================
bin/
obj/
AppPackages/
BundleArtifacts/
*.user
/Resharper-ILSpy-Style.xml
_ReSharper*/
*.ReSharper
*.patch
.vs/
.idea/
/ILSpy.AddIn*/Packages/*
/ILSpy.AddIn*/source.extension.vsixmanifest
/ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/*.dll
/ICSharpCode.Decompiler.Tests/TestCases/Disassembler/Pretty/*.result.il
/ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe
/ICSharpCode.Decompiler.Tests/TestCases/Correctness/*.exe.config
multitargeting.props
ILSpy.Installer/wix/
/VERSION
/ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs
**/.vscode/
DecompilerTests.config.json
*.trx
================================================
FILE: .gitmodules
================================================
[submodule "ILSpy-tests"]
path = ILSpy-tests
url = https://github.com/icsharpcode/ILSpy-tests
branch = master
================================================
FILE: .tgitconfig
================================================
[tgit]
icon = ILSpy/Images/ILSpy.ico
================================================
FILE: BuildTools/ILSpy.AddIn.VS2022.vsix.filelist
================================================
[Content_Types].xml
catalog.json
en-US\ILSpy.AddIn.VS2022.resources.dll
extension.vsixmanifest
ICSharpCode.Decompiler.dll
ICSharpCode.ILSpyX.dll
ICSharpCode.TreeView.dll
ILSpy.AddIn.VS2022.dll
ILSpy.AddIn.VS2022.pkgdef
ILSpy.BamlDecompiler.Plugin.dll
ILSpy.deps.json
ILSpy.dll
ILSpy.exe
ILSpy.ReadyToRun.Plugin.dll
ILSpy.runtimeconfig.json
ILSpy\AvalonDock.dll
ILSpy\AvalonDock.Themes.VS2013.dll
ILSpy\DataGridExtensions.dll
ILSpy\Iced.dll
ILSpy\ICSharpCode.AvalonEdit.dll
ILSpy\ICSharpCode.Decompiler.dll
ILSpy\ICSharpCode.ILSpyX.dll
ILSpy\ICSharpCode.TreeView.dll
ILSpy\ILCompiler.Reflection.ReadyToRun.dll
ILSpy\ILSpy.BamlDecompiler.Plugin.deps.json
ILSpy\ILSpy.BamlDecompiler.Plugin.dll
ILSpy\ILSpy.deps.json
ILSpy\ILSpy.dll
ILSpy\ILSpy.exe
ILSpy\ILSpy.ReadyToRun.Plugin.deps.json
ILSpy\ILSpy.ReadyToRun.Plugin.dll
ILSpy\ILSpy.runtimeconfig.json
ILSpy\K4os.Compression.LZ4.dll
ILSpy\Microsoft.DiaSymReader.Converter.Xml.dll
ILSpy\Microsoft.DiaSymReader.dll
ILSpy\Microsoft.DiaSymReader.PortablePdb.dll
ILSpy\Microsoft.VisualStudio.Composition.dll
ILSpy\Microsoft.VisualStudio.Composition.NetFxAttributes.dll
ILSpy\Microsoft.VisualStudio.Validation.dll
ILSpy\Microsoft.Xaml.Behaviors.dll
ILSpy\Mono.Cecil.dll
ILSpy\Mono.Cecil.Mdb.dll
ILSpy\Mono.Cecil.Pdb.dll
ILSpy\Mono.Cecil.Rocks.dll
ILSpy\System.ComponentModel.Composition.dll
ILSpy\System.Composition.AttributedModel.dll
ILSpy\System.Composition.Convention.dll
ILSpy\System.Composition.Hosting.dll
ILSpy\System.Composition.Runtime.dll
ILSpy\System.Composition.TypedParts.dll
ILSpy\TomsToolbox.Essentials.dll
ILSpy\TomsToolbox.ObservableCollections.dll
ILSpy\TomsToolbox.Wpf.dll
ILSpy\TomsToolbox.Wpf.Styles.dll
ILSpy-Large.ico
license.txt
manifest.json
Mono.Cecil.dll
================================================
FILE: BuildTools/ILSpy.AddIn.vsix.filelist
================================================
[Content_Types].xml
catalog.json
en-US\ILSpy.AddIn.resources.dll
extension.vsixmanifest
ICSharpCode.Decompiler.dll
ICSharpCode.ILSpyX.dll
ICSharpCode.TreeView.dll
ILSpy.AddIn.dll
ILSpy.AddIn.pkgdef
ILSpy.BamlDecompiler.Plugin.dll
ILSpy.deps.json
ILSpy.dll
ILSpy.exe
ILSpy.ReadyToRun.Plugin.dll
ILSpy.runtimeconfig.json
ILSpy\AvalonDock.dll
ILSpy\AvalonDock.Themes.VS2013.dll
ILSpy\DataGridExtensions.dll
ILSpy\Iced.dll
ILSpy\ICSharpCode.AvalonEdit.dll
ILSpy\ICSharpCode.Decompiler.dll
ILSpy\ICSharpCode.ILSpyX.dll
ILSpy\ICSharpCode.TreeView.dll
ILSpy\ILCompiler.Reflection.ReadyToRun.dll
ILSpy\ILSpy.BamlDecompiler.Plugin.deps.json
ILSpy\ILSpy.BamlDecompiler.Plugin.dll
ILSpy\ILSpy.deps.json
ILSpy\ILSpy.dll
ILSpy\ILSpy.exe
ILSpy\ILSpy.ReadyToRun.Plugin.deps.json
ILSpy\ILSpy.ReadyToRun.Plugin.dll
ILSpy\ILSpy.runtimeconfig.json
ILSpy\K4os.Compression.LZ4.dll
ILSpy\Microsoft.DiaSymReader.Converter.Xml.dll
ILSpy\Microsoft.DiaSymReader.dll
ILSpy\Microsoft.DiaSymReader.PortablePdb.dll
ILSpy\Microsoft.VisualStudio.Composition.dll
ILSpy\Microsoft.VisualStudio.Composition.NetFxAttributes.dll
ILSpy\Microsoft.VisualStudio.Validation.dll
ILSpy\Microsoft.Xaml.Behaviors.dll
ILSpy\Mono.Cecil.dll
ILSpy\Mono.Cecil.Mdb.dll
ILSpy\Mono.Cecil.Pdb.dll
ILSpy\Mono.Cecil.Rocks.dll
ILSpy\System.ComponentModel.Composition.dll
ILSpy\System.Composition.AttributedModel.dll
ILSpy\System.Composition.Convention.dll
ILSpy\System.Composition.Hosting.dll
ILSpy\System.Composition.Runtime.dll
ILSpy\System.Composition.TypedParts.dll
ILSpy\TomsToolbox.Essentials.dll
ILSpy\TomsToolbox.ObservableCollections.dll
ILSpy\TomsToolbox.Wpf.dll
ILSpy\TomsToolbox.Wpf.Styles.dll
ILSpy-Large.ico
license.txt
manifest.json
Mono.Cecil.dll
================================================
FILE: BuildTools/ILSpy.msi.filelist
================================================
AvalonDock.dll_2384574099
AvalonDock.Themes.VS2013.dll_1693991188
DataGridExtensions.dll_3175011569
Iced.dll_3795180016
ICSharpCode.AvalonEdit.dll_2202357673
ICSharpCode.Decompiler.dll_1302002478
ICSharpCode.ILSpyX.dll_1982182100
ICSharpCode.TreeView.dll_128291808
ILCompiler.Reflection.ReadyToRun.dll_961256598
ILSpy.BamlDecompiler.Plugin.deps.json_425274809
ILSpy.BamlDecompiler.Plugin.dll_1186184332
ILSpy.deps.json_14220630
ILSpy.dll_828718029
ILSpy.exe_2512527281
ILSpy.ReadyToRun.Plugin.deps.json_3602879258
ILSpy.ReadyToRun.Plugin.dll_3493023742
ILSpy.ReadyToRun.Plugin.resources.dll_3072497650
ILSpy.resources.dll_1963394151
ILSpy.runtimeconfig.json_4170109836
K4os.Compression.LZ4.dll_841780051
Microsoft.DiaSymReader.Converter.Xml.dll_1504543009
Microsoft.DiaSymReader.dll_2664270437
Microsoft.DiaSymReader.PortablePdb.dll_645824024
Microsoft.VisualStudio.Composition.dll_3669554833
Microsoft.VisualStudio.Composition.NetFxAttributes.dll_4085550965
Microsoft.VisualStudio.Validation.dll_3370943218
Microsoft.Xaml.Behaviors.dll_3088279542
Mono.Cecil.dll_2043069113
Mono.Cecil.Mdb.dll_881308441
Mono.Cecil.Pdb.dll_94684032
Mono.Cecil.Rocks.dll_284129705
System.ComponentModel.Composition.dll_3956562358
System.Composition.AttributedModel.dll_2731655713
System.Composition.Convention.dll_1880631244
System.Composition.Hosting.dll_1479266732
System.Composition.Runtime.dll_4043919224
System.Composition.TypedParts.dll_1680333710
TomsToolbox.Essentials.dll_1205939788
TomsToolbox.ObservableCollections.dll_75279310
TomsToolbox.Wpf.dll_28003915
TomsToolbox.Wpf.Styles.dll_1483228554
================================================
FILE: BuildTools/bom-classify-encodings.ps1
================================================
<#
.SYNOPSIS
Classify text files by encoding under the current subtree, respecting .gitignore.
.DESCRIPTION
Enumerates tracked files and untracked-but-not-ignored files (via Git) beneath
PWD. Skips likely-binary files (NUL probe). Classifies remaining files as:
- 'utf8' : valid UTF-8 (no BOM) or empty file
- 'utf8-with-bom' : starts with UTF-8 BOM (EF BB BF)
- 'other' : text but not valid UTF-8 (e.g., UTF-16/ANSI)
Outputs:
1) Relative paths of files classified as 'other'
2) A table by extension: UTF8 / UTF8-with-BOM / Other / Total
Notes:
- Read-only: this script makes no changes.
- Requires Git and must be run inside a Git work tree.
#>
[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# --- Git enumeration ---------------------------------------------------------
function Assert-InGitWorkTree {
# Throws if not inside a Git work tree.
$inside = (& git rev-parse --is-inside-work-tree 2>$null).Trim()
if ($LASTEXITCODE -ne 0 -or $inside -ne 'true') {
throw 'Not in a Git work tree.'
}
}
function Get-GitFilesUnderPwd {
<#
Returns full paths to tracked + untracked-not-ignored files under PWD.
#>
Assert-InGitWorkTree
$repoRoot = (& git rev-parse --show-toplevel).Trim()
$pwdPath = (Get-Location).Path
# cached (tracked) + others (untracked not ignored)
$nulSeparated = & git -C $repoRoot ls-files -z --cached --others --exclude-standard
$relativePaths = $nulSeparated.Split(
[char]0, [System.StringSplitOptions]::RemoveEmptyEntries)
foreach ($relPath in $relativePaths) {
$fullPath = Join-Path $repoRoot $relPath
# Only include files under the current subtree.
if ($fullPath.StartsWith($pwdPath,
[System.StringComparison]::OrdinalIgnoreCase)) {
if (Test-Path -LiteralPath $fullPath -PathType Leaf) { $fullPath }
}
}
}
# --- Probes ------------------------------------------------------------------
function Test-ProbablyBinary {
# Heuristic: treat as binary if the first 8 KiB contains any NUL byte.
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$len = [int][Math]::Min(8192,$stream.Length)
if ($len -le 0) { return $false }
$buffer = [byte[]]::new($len)
[void]$stream.Read($buffer,0,$len)
return ($buffer -contains 0)
}
finally { $stream.Dispose() }
}
catch { return $false }
}
function Get-TextEncodingCategory {
# Returns 'utf8', 'utf8-with-bom', 'other', or $null for likely-binary.
param([Parameter(Mandatory)][string]$Path)
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$fileLength = $stream.Length
if ($fileLength -eq 0) { return 'utf8' }
# BOM check (EF BB BF)
$header = [byte[]]::new([Math]::Min(3,$fileLength))
[void]$stream.Read($header,0,$header.Length)
if ($header.Length -ge 3 -and
$header[0] -eq 0xEF -and $header[1] -eq 0xBB -and $header[2] -eq 0xBF) {
return 'utf8-with-bom'
}
# Quick binary probe before expensive decoding
$stream.Position = 0
$sampleLen = [int][Math]::Min(8192,$fileLength)
$sample = [byte[]]::new($sampleLen)
[void]$stream.Read($sample,0,$sampleLen)
if ($sample -contains 0) { return $null }
}
finally { $stream.Dispose() }
# Validate UTF-8 by decoding with throw-on-invalid option (no BOM).
try {
$bytes = [System.IO.File]::ReadAllBytes($Path)
$utf8 = [System.Text.UTF8Encoding]::new($false,$true)
[void]$utf8.GetString($bytes)
return 'utf8'
}
catch { return 'other' }
}
# --- Main --------------------------------------------------------------------
$otherFiles = @()
$byExtension = @{}
$allFiles = Get-GitFilesUnderPwd
foreach ($fullPath in $allFiles) {
# Avoid decoding likely-binary files.
if (Test-ProbablyBinary $fullPath) { continue }
$category = Get-TextEncodingCategory $fullPath
if (-not $category) { continue }
$ext = [IO.Path]::GetExtension($fullPath).ToLower()
if (-not $byExtension.ContainsKey($ext)) {
$byExtension[$ext] = @{ 'utf8' = 0; 'utf8-with-bom' = 0; 'other' = 0 }
}
$byExtension[$ext][$category]++
if ($category -eq 'other') {
$otherFiles += (Resolve-Path -LiteralPath $fullPath -Relative)
}
}
# 1) Files in 'other'
if ($otherFiles.Count -gt 0) {
'Files classified as ''other'':'
$otherFiles | Sort-Object | ForEach-Object { " $_" }
''
}
# 2) Table by extension
$rows = foreach ($kv in $byExtension.GetEnumerator()) {
$ext = if ($kv.Key) { $kv.Key } else { '[noext]' }
$u = [int]$kv.Value['utf8']
$b = [int]$kv.Value['utf8-with-bom']
$o = [int]$kv.Value['other']
[PSCustomObject]@{
Extension = $ext
UTF8 = $u
'UTF8-with-BOM' = $b
Other = $o
Total = $u + $b + $o
}
}
$rows |
Sort-Object -Property (
@{Expression='Total';Descending=$true},
@{Expression='Extension';Descending=$false}
) |
Format-Table -AutoSize
================================================
FILE: BuildTools/bom-strip.ps1
================================================
<#
.SYNOPSIS
Strip UTF-8 BOM from selected text files under the current subtree, respecting
.gitignore.
.DESCRIPTION
Enumerates tracked and untracked-but-not-ignored files under the current
directory (via Git), filters to texty extensions and dotfiles, skips likely
binary files (NUL probe), and removes a leading UTF-8 BOM (EF BB BF) in place.
Refuses to run if there are uncommitted changes as a safeguard. Use -Force to override.
Supports -WhatIf/-Confirm via ShouldProcess.
#>
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low')]
param(
[switch]$Force
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# --- File sets (ILSpy) ------------------------------------------------------
$Dotfiles = @(
'.gitignore', '.editorconfig', '.gitattributes', '.gitmodules',
'.tgitconfig', '.vsconfig'
)
$AllowedExts = @(
'.bat','.config','.cs','.csproj','.css','.filelist','.fs','.html','.il',
'.ipynb','.js','.json','.less','.manifest','.md','.projitems','.props',
'.ps1','.psd1','.shproj','.sln','.slnf','.svg','.template',
'.tt', '.txt','.vb','.vsct','.vsixlangpack','.wxl','.xaml','.xml','.xshd','.yml'
)
$IncludeNoExt = $true # include names like LICENSE
# --- Git checks / enumeration -----------------------------------------------
function Assert-InGitWorkTree {
$inside = (& git rev-parse --is-inside-work-tree 2>$null).Trim()
if ($LASTEXITCODE -ne 0 -or $inside -ne 'true') {
throw 'Not in a Git work tree.'
}
}
function Assert-CleanWorkingTree {
if ($Force) { return }
$status = & git status --porcelain -z
if ($LASTEXITCODE -ne 0) { throw 'git status failed.' }
if (-not [string]::IsNullOrEmpty($status)) {
throw 'Working tree not clean. Commit/stash changes or use -Force.'
}
}
function Get-GitFilesUnderPwd {
Assert-InGitWorkTree
$repoRoot = (& git rev-parse --show-toplevel).Trim()
$pwdPath = (Get-Location).Path
$tracked = & git -C $repoRoot ls-files -z
$others = & git -C $repoRoot ls-files --others --exclude-standard -z
$allRel = ("$tracked$others").Split(
[char]0, [System.StringSplitOptions]::RemoveEmptyEntries)
foreach ($relPath in $allRel) {
$fullPath = Join-Path $repoRoot $relPath
if ($fullPath.StartsWith($pwdPath,
[System.StringComparison]::OrdinalIgnoreCase)) {
if (Test-Path -LiteralPath $fullPath -PathType Leaf) {
$fullPath
}
}
}
}
# --- Probes -----------------------------------------------------------------
function Test-HasUtf8Bom {
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
if ($stream.Length -lt 3) { return $false }
$header = [byte[]]::new(3)
[void]$stream.Read($header,0,3)
return ($header[0] -eq 0xEF -and
$header[1] -eq 0xBB -and
$header[2] -eq 0xBF)
}
finally {
$stream.Dispose()
}
}
catch { return $false }
}
function Test-ProbablyBinary {
# Binary if the first 8 KiB contains any NUL byte.
param([Parameter(Mandatory)][string]$Path)
try {
$stream = [System.IO.File]::Open($Path,'Open','Read','ReadWrite')
try {
$len = [int][Math]::Min(8192,$stream.Length)
if ($len -le 0) { return $false }
$buffer = [byte[]]::new($len)
[void]$stream.Read($buffer,0,$len)
return ($buffer -contains 0)
}
finally {
$stream.Dispose()
}
}
catch { return $false }
}
# --- Mutation ---------------------------------------------------------------
function Remove-Utf8BomInPlace {
# Write the existing buffer from offset 3, no extra full-size allocation.
param([Parameter(Mandatory)][string]$Path)
$bytes = [System.IO.File]::ReadAllBytes($Path)
if ($bytes.Length -lt 3) { return $false }
if ($bytes[0] -ne 0xEF -or
$bytes[1] -ne 0xBB -or
$bytes[2] -ne 0xBF) {
return $false
}
$stream = [System.IO.File]::Open($Path,'Create','Write','ReadWrite')
try {
$stream.Write($bytes, 3, $bytes.Length - 3)
$stream.SetLength($bytes.Length - 3)
}
finally {
$stream.Dispose()
}
return $true
}
# --- Main -------------------------------------------------------------------
Assert-InGitWorkTree
Assert-CleanWorkingTree
$allFiles = Get-GitFilesUnderPwd
$targets = $allFiles | % {
$fileName = [IO.Path]::GetFileName($_)
$ext = [IO.Path]::GetExtension($fileName)
$isDot = $Dotfiles -contains $fileName
$isNoExt = -not $fileName.Contains('.')
if ($isDot -or ($AllowedExts -contains $ext) -or
($IncludeNoExt -and $isNoExt -and -not $isDot)) {
$_
}
}
| ? { Test-HasUtf8Bom $_ }
| ? { -not (Test-ProbablyBinary $_) }
$changed = 0
$byExtension = @{}
$dotfileChanges = 0
$targets | % {
$relative = Resolve-Path -LiteralPath $_ -Relative
if ($PSCmdlet.ShouldProcess($relative,'Strip UTF-8 BOM')) {
if (Remove-Utf8BomInPlace -Path $_) {
$changed++
$fileName = [IO.Path]::GetFileName($_)
if ($Dotfiles -contains $fileName) { $dotfileChanges++ }
$ext = [IO.Path]::GetExtension($fileName)
if (-not $byExtension.ContainsKey($ext)) { $byExtension[$ext] = 0 }
$byExtension[$ext]++
"stripped BOM: $relative"
}
}
}
"Done. Stripped BOM from $changed file(s)."
if ($byExtension.Keys.Count -gt 0) {
""
"By extension:"
$byExtension.GetEnumerator() | Sort-Object Name | % {
$key = if ([string]::IsNullOrEmpty($_.Name)) { '[noext]' } else { $_.Name }
" {0}: {1}" -f $key, $_.Value
}
}
if ($dotfileChanges -gt 0) {
" [dotfiles]: $dotfileChanges"
}
================================================
FILE: BuildTools/create-filelists.ps1
================================================
$ErrorActionPreference = "Stop";
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
gci -Include *.vsix, *.msi -recurse | foreach ($_) {
if (-not ($_.FullName -contains "\bin\Debug\")) {
continue;
}
$idx=-1;
$body=$false;
$outputFileName = ".\BuildTools\$($_.Name -replace '-\d+\.\d+\.\d+\.\d+', '').filelist";
$lines = 7z l $_.FullName | foreach {
if ($idx -eq -1) {
$idx = $_.IndexOf("Name");
}
$p = $body;
if ($idx -gt 0) {
$body = ($body -ne ($_ -match ' *-[ -]+'))
}
if ($p -and $body) {
$_.Substring($idx)
}
} | sort
[System.IO.File]::WriteAllLines($outputFileName, $lines, $Utf8NoBomEncoding)
}
================================================
FILE: BuildTools/format.bat
================================================
@rem This file can be used to trigger the commit hook's formatting,
@rem modifying the local formatting even if not committing all changes.
pushd %~dp0\..
"%ProgramFiles%\Git\usr\bin\bash.exe" BuildTools\pre-commit --format
popd
================================================
FILE: BuildTools/ghactions-install.ps1
================================================
$ErrorActionPreference = "Stop"
$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
$baseCommitRev = 1;
# make sure this matches artifacts-only branches list in appveyor.yml!
$masterBranches = '^refs/heads/(master|release/.+)$';
$decompilerVersionInfoTemplateFile = "ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs";
$versionParts = @{};
Get-Content $decompilerVersionInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;
if ($versionName -ne "null") {
$versionName = "-$versionName";
} else {
$versionName = "";
}
Write-Host "GITHUB_REF: '$env:GITHUB_REF'";
if ($env:GITHUB_REF -match $masterBranches) {
$branch = "";
$suffix = "";
} elseif ($env:GITHUB_REF -match '^refs/pull/(\d+)/merge$') {
$branch = "";
$suffix = "-pr" + $Matches[1];
} elseif ($env:GITHUB_REF -match '^refs/heads/(.+)$') {
$branch = "-" + $Matches[1];
$suffix = "";
} else {
$branch = "";
$suffix = "";
}
$revision = [Int32]::Parse((git rev-list --count "$baseCommit..HEAD")) + $baseCommitRev;
$newVersion="$major.$minor.$build.$revision";
$ilspyVersionNumber = "$newVersion$branch$versionName$suffix";
$ilspyVersionNumber = $ilspyVersionNumber.Replace("/", "-");
$env:ILSPY_VERSION_NUMBER="$ilspyVersionNumber";
$env:ILSPY_VERSION_NUMBER | Out-File "ILSPY_VERSION"
Write-Host "new version: $ilspyVersionNumber";
================================================
FILE: BuildTools/pre-commit
================================================
#!/bin/sh
#
# To enable this hook, copy/symlink this file to ".git/hooks/pre-commit".
# mklink .git\hooks\pre-commit ..\..\BuildTools\pre-commit
set -eu
DOTNET_FORMAT_VERSION=10.0.100-rtm.25531.102
DOTNET_FORMAT_SOURCE="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10-transport/nuget/v3/index.json"
DOTNET_PATH="$LOCALAPPDATA/ICSharpCode/ILSpy/dotnet-format-$DOTNET_FORMAT_VERSION"
if [ ! -d "$DOTNET_PATH" ]; then
echo "Downloading dotnet-format $DOTNET_FORMAT_VERSION..."
dotnet tool install --tool-path "$DOTNET_PATH" dotnet-format --version "$DOTNET_FORMAT_VERSION" --add-source "$DOTNET_FORMAT_SOURCE"
fi
"$DOTNET_PATH/dotnet-format.exe" --version
if [ "${1:-}" = "--format" ]; then
# called via format.bat
"$DOTNET_PATH/dotnet-format.exe" whitespace --no-restore --verbosity detailed ILSpy.sln
elif git diff --quiet --ignore-submodules; then
"$DOTNET_PATH/dotnet-format.exe" whitespace --no-restore --verbosity detailed ILSpy.sln
git add -u -- \*\*.cs
else
echo Partial commit: only verifying formatting
exec "$DOTNET_PATH/dotnet-format.exe" whitespace --verify-no-changes --no-restore --verbosity detailed ILSpy.sln
fi
================================================
FILE: BuildTools/sort-resx.ps1
================================================
$ErrorActionPreference = "Stop";
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null
Write-Host "Sorting .resx files...";
Get-ChildItem -Include *.resx -Recurse | foreach ($_) {
Write-Host $_.FullName;
$doc = [System.Xml.Linq.XDocument]::Load($_.FullName);
$descendants = [System.Linq.Enumerable]::ToArray($doc.Descendants("data"));
[System.Xml.Linq.Extensions]::Remove($descendants);
$ordered = [System.Linq.Enumerable]::OrderBy($descendants, [System.Func[System.Xml.Linq.XElement,string]] { param ($e) $e.Attribute("name").Value }, [System.StringComparer]::Ordinal);
$doc.Root.Add($ordered);
$doc.Save($_.FullName);
}
================================================
FILE: BuildTools/update-assemblyinfo.ps1
================================================
if (-not ($PSVersionTable.PSCompatibleVersions -contains "5.0")) {
Write-Error "This script requires at least powershell version 5.0!";
return 255;
}
$ErrorActionPreference = "Stop"
$baseCommit = "d779383cb85003d6dabeb976f0845631e07bf463";
$baseCommitRev = 1;
# make sure this matches artifacts-only branches list in appveyor.yml!
$masterBranches = '^(master|release/.+)$';
$decompilerVersionInfoTemplateFile = "ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.template.cs";
function Test-File([string]$filename) {
return [System.IO.File]::Exists((Join-Path (Get-Location) $filename));
}
function Test-Dir([string]$name) {
return [System.IO.Directory]::Exists((Join-Path (Get-Location) $name));
}
function Find-Git() {
try {
$executable = (get-command git).Path;
return $executable -ne $null;
} catch {
#git not found in path, continue;
}
#we're on Windows
if ($env:PROGRAMFILES -ne $null) {
#hack for x86 powershell used by default (yuck!)
if (${env:PROGRAMFILES(X86)} -eq ${env:PROGRAMFILES}) {
$env:PROGRAMFILES = $env:PROGRAMFILES.Substring(0, $env:PROGRAMFILES.Length - 6);
}
#try to add git to path
if ([System.IO.Directory]::Exists("$env:PROGRAMFILES\git\cmd\")) {
$env:PATH = "$env:PATH;$env:PROGRAMFILES\git\cmd\";
return $true;
}
}
return $false;
}
function No-Git() {
return -not (((Test-Dir ".git") -or (Test-File ".git")) -and (Find-Git));
}
function gitVersion() {
if (No-Git) {
return 0;
}
try {
return [Int32]::Parse((git rev-list --count "$baseCommit..HEAD" 2>&1 | Tee-Object -Variable cmdOutput)) + $baseCommitRev;
} catch {
Write-Host $cmdOutput
return 0;
}
}
function gitCommitHash() {
if (No-Git) {
return "0000000000000000000000000000000000000000";
}
try {
return (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "0000000000000000000000000000000000000000";
}
}
function gitShortCommitHash() {
if (No-Git) {
return "00000000";
}
try {
return (git rev-parse --short=8 (git rev-list --max-count 1 HEAD 2>&1 | Tee-Object -Variable cmdOutput) 2>&1 | Tee-Object -Variable cmdOutput);
} catch {
Write-Host $cmdOutput
return "00000000";
}
}
function gitBranch() {
if (No-Git) {
return "no-branch";
}
if ($env:APPVEYOR_REPO_BRANCH -ne $null) {
return $env:APPVEYOR_REPO_BRANCH;
} elseif ($env:BUILD_SOURCEBRANCHNAME -ne $null) {
return $env:BUILD_SOURCEBRANCHNAME;
} else {
return ((git branch --no-color).Split([System.Environment]::NewLine) | where { $_ -match "^\* " } | select -First 1).Substring(2);
}
}
$templateFiles = (
@{Input=$decompilerVersionInfoTemplateFile; Output="ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs"},
@{Input="ILSpy.AddIn/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn/source.extension.vsixmanifest"},
@{Input="ILSpy.AddIn.VS2022/source.extension.vsixmanifest.template"; Output = "ILSpy.AddIn.VS2022/source.extension.vsixmanifest"}
);
[string]$mutexId = "ILSpyUpdateAssemblyInfo" + (Get-Location).ToString().GetHashCode();
Write-Host $mutexId;
[bool]$createdNew = $false;
$mutex = New-Object System.Threading.Mutex($true, $mutexId, [ref]$createdNew);
try {
if (-not $createdNew) {
try {
$mutex.WaitOne(10000);
} catch [System.Threading.AbandonedMutexException] {
}
return 0;
}
if (-not (Test-File "ILSpy.sln")) {
Write-Error "Working directory must be the ILSpy repo root!";
return 2;
}
$versionParts = @{};
Get-Content $decompilerVersionInfoTemplateFile | where { $_ -match 'string (\w+) = "?(\w+)"?;' } | foreach { $versionParts.Add($Matches[1], $Matches[2]) }
$major = $versionParts.Major;
$minor = $versionParts.Minor;
$build = $versionParts.Build;
$versionName = $versionParts.VersionName;
$revision = gitVersion;
$branchName = gitBranch;
$gitCommitHash = gitCommitHash;
$gitShortCommitHash = gitShortCommitHash;
if ($branchName -match $masterBranches) {
$postfixBranchName = "";
} else {
$postfixBranchName = "-$branchName";
}
if ($versionName -eq "null") {
$versionName = "";
$postfixVersionName = "";
} else {
$postfixVersionName = "-$versionName";
}
$buildConfig = $args[0].ToString().ToLower();
if ($buildConfig -eq "release") {
$buildConfig = "";
} else {
$buildConfig = "-" + $buildConfig;
}
$fullVersionNumber = "$major.$minor.$build.$revision";
if ((-not (Test-File "VERSION")) -or (((Get-Content "VERSION") -Join [System.Environment]::NewLine) -ne "$fullVersionNumber$postfixVersionName")) {
"$fullVersionNumber$postfixVersionName" | Out-File -Encoding utf8 -NoNewLine "VERSION";
}
foreach ($file in $templateFiles) {
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;
$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
$out = $out.Replace('$INSERTREVISION$', $revision);
$out = $out.Replace('$INSERTCOMMITHASH$', $gitCommitHash);
$out = $out.Replace('$INSERTSHORTCOMMITHASH$', $gitShortCommitHash);
$out = $out.Replace('$INSERTDATE$', [System.DateTime]::Now.ToString("MM/dd/yyyy"));
$out = $out.Replace('$INSERTYEAR$', [System.DateTime]::Now.Year.ToString());
$out = $out.Replace('$INSERTBRANCHNAME$', $branchName);
$out = $out.Replace('$INSERTBRANCHPOSTFIX$', $postfixBranchName);
$out = $out.Replace('$INSERTVERSIONNAME$', $versionName);
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join [System.Environment]::NewLine) -ne $out)) {
$utf8NoBom = New-Object System.Text.UTF8Encoding($false);
[System.IO.File]::WriteAllText($file.Output, $out, $utf8NoBom);
}
}
} finally {
$mutex.ReleaseMutex();
$mutex.Close();
}
================================================
FILE: Directory.Build.props
================================================
$(NoWarn);NU1510
true
================================================
FILE: Directory.Packages.props
================================================
true
false
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlContext.cs
================================================
/*
Copyright (c) 2015 Ki
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.Threading;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem;
using Metadata = ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal class BamlContext
{
public IDecompilerTypeSystem TypeSystem { get; }
public KnownThings KnownThings { get; }
Dictionary assemblyMap = new Dictionary();
public Dictionary AssemblyIdMap { get; }
public Dictionary AttributeIdMap { get; }
public Dictionary StringIdMap { get; }
public Dictionary TypeIdMap { get; }
BamlContext(IDecompilerTypeSystem typeSystem)
{
this.TypeSystem = typeSystem;
KnownThings = new KnownThings(typeSystem);
AssemblyIdMap = new Dictionary();
AttributeIdMap = new Dictionary();
StringIdMap = new Dictionary();
TypeIdMap = new Dictionary();
}
public static BamlContext ConstructContext(IDecompilerTypeSystem typeSystem, BamlDocument document, CancellationToken token)
{
var ctx = new BamlContext(typeSystem);
foreach (var record in document)
{
token.ThrowIfCancellationRequested();
if (record is AssemblyInfoRecord assemblyInfo)
{
if (assemblyInfo.AssemblyId == ctx.AssemblyIdMap.Count)
ctx.AssemblyIdMap.Add(assemblyInfo.AssemblyId, assemblyInfo);
}
else if (record is AttributeInfoRecord attrInfo)
{
if (attrInfo.AttributeId == ctx.AttributeIdMap.Count)
ctx.AttributeIdMap.Add(attrInfo.AttributeId, attrInfo);
}
else if (record is StringInfoRecord strInfo)
{
if (strInfo.StringId == ctx.StringIdMap.Count)
ctx.StringIdMap.Add(strInfo.StringId, strInfo);
}
else if (record is TypeInfoRecord typeInfo)
{
if (typeInfo.TypeId == ctx.TypeIdMap.Count)
ctx.TypeIdMap.Add(typeInfo.TypeId, typeInfo);
}
}
return ctx;
}
public (string FullAssemblyName, IModule Assembly) ResolveAssembly(ushort id)
{
id &= 0xfff;
if (!assemblyMap.TryGetValue(id, out var assembly))
{
if (AssemblyIdMap.TryGetValue(id, out var assemblyRec))
{
var assemblyName = Metadata.AssemblyNameReference.Parse(assemblyRec.AssemblyFullName);
if (assemblyName.Name == TypeSystem.MainModule.AssemblyName)
{
assembly = (assemblyRec.AssemblyFullName, TypeSystem.MainModule);
}
else
{
assembly = (assemblyRec.AssemblyFullName, FindMatchingReference(assemblyName));
}
}
else
assembly = (null, null);
assemblyMap[id] = assembly;
}
return assembly;
}
private IModule FindMatchingReference(AssemblyNameReference name)
{
IModule bestMatch = null;
foreach (var module in TypeSystem.ReferencedModules)
{
if (module.AssemblyName == name.Name)
{
// using highest version as criterion
if (bestMatch == null || bestMatch.AssemblyVersion <= module.AssemblyVersion)
{
bestMatch = module;
}
}
}
return bestMatch;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlDocument.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal class BamlDocument : List
{
public string DocumentName { get; set; }
public string Signature { get; set; }
public BamlVersion ReaderVersion { get; set; }
public BamlVersion UpdaterVersion { get; set; }
public BamlVersion WriterVersion { get; set; }
public struct BamlVersion
{
public ushort Major;
public ushort Minor;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlNode.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using System.Threading;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal abstract class BamlNode
{
public BamlBlockNode Parent { get; set; }
public abstract BamlRecordType Type { get; }
public object Annotation { get; set; }
public abstract BamlRecord Record { get; }
public static bool IsHeader(BamlRecord rec)
{
switch (rec.Type)
{
case BamlRecordType.ConstructorParametersStart:
case BamlRecordType.DocumentStart:
case BamlRecordType.ElementStart:
case BamlRecordType.KeyElementStart:
case BamlRecordType.NamedElementStart:
case BamlRecordType.PropertyArrayStart:
case BamlRecordType.PropertyComplexStart:
case BamlRecordType.PropertyDictionaryStart:
case BamlRecordType.PropertyListStart:
case BamlRecordType.StaticResourceStart:
return true;
}
return false;
}
public static bool IsFooter(BamlRecord rec)
{
switch (rec.Type)
{
case BamlRecordType.ConstructorParametersEnd:
case BamlRecordType.DocumentEnd:
case BamlRecordType.ElementEnd:
case BamlRecordType.KeyElementEnd:
case BamlRecordType.PropertyArrayEnd:
case BamlRecordType.PropertyComplexEnd:
case BamlRecordType.PropertyDictionaryEnd:
case BamlRecordType.PropertyListEnd:
case BamlRecordType.StaticResourceEnd:
return true;
}
return false;
}
public static bool IsMatch(BamlRecord header, BamlRecord footer)
{
switch (header.Type)
{
case BamlRecordType.ConstructorParametersStart:
return footer.Type == BamlRecordType.ConstructorParametersEnd;
case BamlRecordType.DocumentStart:
return footer.Type == BamlRecordType.DocumentEnd;
case BamlRecordType.KeyElementStart:
return footer.Type == BamlRecordType.KeyElementEnd;
case BamlRecordType.PropertyArrayStart:
return footer.Type == BamlRecordType.PropertyArrayEnd;
case BamlRecordType.PropertyComplexStart:
return footer.Type == BamlRecordType.PropertyComplexEnd;
case BamlRecordType.PropertyDictionaryStart:
return footer.Type == BamlRecordType.PropertyDictionaryEnd;
case BamlRecordType.PropertyListStart:
return footer.Type == BamlRecordType.PropertyListEnd;
case BamlRecordType.StaticResourceStart:
return footer.Type == BamlRecordType.StaticResourceEnd;
case BamlRecordType.ElementStart:
case BamlRecordType.NamedElementStart:
return footer.Type == BamlRecordType.ElementEnd;
}
return false;
}
public static BamlNode Parse(BamlDocument document, CancellationToken token)
{
Debug.Assert(document.Count > 0 && document[0].Type == BamlRecordType.DocumentStart);
BamlBlockNode current = null;
var stack = new Stack();
for (int i = 0; i < document.Count; i++)
{
token.ThrowIfCancellationRequested();
if (IsHeader(document[i]))
{
var prev = current;
current = new BamlBlockNode {
Header = document[i]
};
if (prev != null)
{
prev.Children.Add(current);
current.Parent = prev;
stack.Push(prev);
}
}
else if (IsFooter(document[i]))
{
if (current == null)
throw new Exception("Unexpected footer.");
while (!IsMatch(current.Header, document[i]))
{
// End record can be omited (sometimes).
if (stack.Count > 0)
current = stack.Pop();
}
current.Footer = document[i];
if (stack.Count > 0)
current = stack.Pop();
}
else
current.Children.Add(new BamlRecordNode(document[i]) { Parent = current });
}
Debug.Assert(stack.Count == 0);
return current;
}
}
internal class BamlRecordNode : BamlNode
{
BamlRecord record;
public override BamlRecord Record => record;
public override BamlRecordType Type => Record.Type;
public BamlRecordNode(BamlRecord record) => this.record = record;
}
internal class BamlBlockNode : BamlNode
{
public BamlRecord Header { get; set; }
public IList Children { get; }
public BamlRecord Footer { get; set; }
public override BamlRecord Record => Header;
public override BamlRecordType Type => Header.Type;
public BamlBlockNode() => Children = new List();
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlReader.cs
================================================
/*
Copyright (c) 2015 Ki
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.IO;
using System.Text;
using System.Threading;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal class BamlBinaryReader : BinaryReader
{
public BamlBinaryReader(Stream stream)
: base(stream)
{
}
public int ReadEncodedInt() => Read7BitEncodedInt();
}
internal class BamlReader
{
const string MSBAML_SIG = "MSBAML";
internal static bool IsBamlHeader(Stream str)
{
var pos = str.Position;
try
{
var rdr = new BinaryReader(str, Encoding.Unicode);
int len = (int)(rdr.ReadUInt32() >> 1);
if (len != MSBAML_SIG.Length)
return false;
var sig = new string(rdr.ReadChars(len));
return sig == MSBAML_SIG;
}
finally
{
str.Position = pos;
}
}
static string ReadSignature(Stream str)
{
var rdr = new BinaryReader(str, Encoding.Unicode);
uint len = rdr.ReadUInt32();
var sig = new string(rdr.ReadChars((int)(len >> 1)));
rdr.ReadBytes((int)(((len + 3) & ~3) - len));
return sig;
}
public static BamlDocument ReadDocument(Stream str, CancellationToken token)
{
var ret = new BamlDocument();
var reader = new BamlBinaryReader(str);
ret.Signature = ReadSignature(str);
if (ret.Signature != MSBAML_SIG)
throw new NotSupportedException();
ret.ReaderVersion = new BamlDocument.BamlVersion { Major = reader.ReadUInt16(), Minor = reader.ReadUInt16() };
ret.UpdaterVersion = new BamlDocument.BamlVersion { Major = reader.ReadUInt16(), Minor = reader.ReadUInt16() };
ret.WriterVersion = new BamlDocument.BamlVersion { Major = reader.ReadUInt16(), Minor = reader.ReadUInt16() };
if (ret.ReaderVersion.Major != 0 || ret.ReaderVersion.Minor != 0x60 ||
ret.UpdaterVersion.Major != 0 || ret.UpdaterVersion.Minor != 0x60 ||
ret.WriterVersion.Major != 0 || ret.WriterVersion.Minor != 0x60)
throw new NotSupportedException();
var recs = new Dictionary();
while (str.Position < str.Length)
{
token.ThrowIfCancellationRequested();
long pos = str.Position;
var type = (BamlRecordType)reader.ReadByte();
BamlRecord rec = null;
switch (type)
{
case BamlRecordType.AssemblyInfo:
rec = new AssemblyInfoRecord();
break;
case BamlRecordType.AttributeInfo:
rec = new AttributeInfoRecord();
break;
case BamlRecordType.ConstructorParametersStart:
rec = new ConstructorParametersStartRecord();
break;
case BamlRecordType.ConstructorParametersEnd:
rec = new ConstructorParametersEndRecord();
break;
case BamlRecordType.ConstructorParameterType:
rec = new ConstructorParameterTypeRecord();
break;
case BamlRecordType.ConnectionId:
rec = new ConnectionIdRecord();
break;
case BamlRecordType.ContentProperty:
rec = new ContentPropertyRecord();
break;
case BamlRecordType.DefAttribute:
rec = new DefAttributeRecord();
break;
case BamlRecordType.DefAttributeKeyString:
rec = new DefAttributeKeyStringRecord();
break;
case BamlRecordType.DefAttributeKeyType:
rec = new DefAttributeKeyTypeRecord();
break;
case BamlRecordType.DeferableContentStart:
rec = new DeferableContentStartRecord();
break;
case BamlRecordType.DocumentEnd:
rec = new DocumentEndRecord();
break;
case BamlRecordType.DocumentStart:
rec = new DocumentStartRecord();
break;
case BamlRecordType.ElementEnd:
rec = new ElementEndRecord();
break;
case BamlRecordType.ElementStart:
rec = new ElementStartRecord();
break;
case BamlRecordType.KeyElementEnd:
rec = new KeyElementEndRecord();
break;
case BamlRecordType.KeyElementStart:
rec = new KeyElementStartRecord();
break;
case BamlRecordType.LineNumberAndPosition:
rec = new LineNumberAndPositionRecord();
break;
case BamlRecordType.LinePosition:
rec = new LinePositionRecord();
break;
case BamlRecordType.LiteralContent:
rec = new LiteralContentRecord();
break;
case BamlRecordType.NamedElementStart:
rec = new NamedElementStartRecord();
break;
case BamlRecordType.OptimizedStaticResource:
rec = new OptimizedStaticResourceRecord();
break;
case BamlRecordType.PIMapping:
rec = new PIMappingRecord();
break;
case BamlRecordType.PresentationOptionsAttribute:
rec = new PresentationOptionsAttributeRecord();
break;
case BamlRecordType.Property:
rec = new PropertyRecord();
break;
case BamlRecordType.PropertyArrayEnd:
rec = new PropertyArrayEndRecord();
break;
case BamlRecordType.PropertyArrayStart:
rec = new PropertyArrayStartRecord();
break;
case BamlRecordType.PropertyComplexEnd:
rec = new PropertyComplexEndRecord();
break;
case BamlRecordType.PropertyComplexStart:
rec = new PropertyComplexStartRecord();
break;
case BamlRecordType.PropertyCustom:
rec = new PropertyCustomRecord();
break;
case BamlRecordType.PropertyDictionaryEnd:
rec = new PropertyDictionaryEndRecord();
break;
case BamlRecordType.PropertyDictionaryStart:
rec = new PropertyDictionaryStartRecord();
break;
case BamlRecordType.PropertyListEnd:
rec = new PropertyListEndRecord();
break;
case BamlRecordType.PropertyListStart:
rec = new PropertyListStartRecord();
break;
case BamlRecordType.PropertyStringReference:
rec = new PropertyStringReferenceRecord();
break;
case BamlRecordType.PropertyTypeReference:
rec = new PropertyTypeReferenceRecord();
break;
case BamlRecordType.PropertyWithConverter:
rec = new PropertyWithConverterRecord();
break;
case BamlRecordType.PropertyWithExtension:
rec = new PropertyWithExtensionRecord();
break;
case BamlRecordType.PropertyWithStaticResourceId:
rec = new PropertyWithStaticResourceIdRecord();
break;
case BamlRecordType.RoutedEvent:
rec = new RoutedEventRecord();
break;
case BamlRecordType.StaticResourceEnd:
rec = new StaticResourceEndRecord();
break;
case BamlRecordType.StaticResourceId:
rec = new StaticResourceIdRecord();
break;
case BamlRecordType.StaticResourceStart:
rec = new StaticResourceStartRecord();
break;
case BamlRecordType.StringInfo:
rec = new StringInfoRecord();
break;
case BamlRecordType.Text:
rec = new TextRecord();
break;
case BamlRecordType.TextWithConverter:
rec = new TextWithConverterRecord();
break;
case BamlRecordType.TextWithId:
rec = new TextWithIdRecord();
break;
case BamlRecordType.TypeInfo:
rec = new TypeInfoRecord();
break;
case BamlRecordType.TypeSerializerInfo:
rec = new TypeSerializerInfoRecord();
break;
case BamlRecordType.XmlnsProperty:
rec = new XmlnsPropertyRecord();
break;
case BamlRecordType.XmlAttribute:
case BamlRecordType.ProcessingInstruction:
case BamlRecordType.LastRecordType:
case BamlRecordType.EndAttributes:
case BamlRecordType.DefTag:
case BamlRecordType.ClrEvent:
case BamlRecordType.Comment:
default:
throw new NotSupportedException();
}
rec.Position = pos;
rec.Read(reader);
ret.Add(rec);
recs.Add(pos, rec);
}
for (int i = 0; i < ret.Count; i++)
{
if (ret[i] is IBamlDeferRecord defer)
defer.ReadDefer(ret, i, _ => recs[_]);
}
return ret;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlRecords.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using System.IO;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal enum BamlRecordType : byte
{
ClrEvent = 0x13,
Comment = 0x17,
AssemblyInfo = 0x1c,
AttributeInfo = 0x1f,
ConstructorParametersStart = 0x2a,
ConstructorParametersEnd = 0x2b,
ConstructorParameterType = 0x2c,
ConnectionId = 0x2d,
ContentProperty = 0x2e,
DefAttribute = 0x19,
DefAttributeKeyString = 0x26,
DefAttributeKeyType = 0x27,
DeferableContentStart = 0x25,
DefTag = 0x18,
DocumentEnd = 0x2,
DocumentStart = 0x1,
ElementEnd = 0x4,
ElementStart = 0x3,
EndAttributes = 0x1a,
KeyElementEnd = 0x29,
KeyElementStart = 0x28,
LastRecordType = 0x39,
LineNumberAndPosition = 0x35,
LinePosition = 0x36,
LiteralContent = 0xf,
NamedElementStart = 0x2f,
OptimizedStaticResource = 0x37,
PIMapping = 0x1b,
PresentationOptionsAttribute = 0x34,
ProcessingInstruction = 0x16,
Property = 0x5,
PropertyArrayEnd = 0xa,
PropertyArrayStart = 0x9,
PropertyComplexEnd = 0x8,
PropertyComplexStart = 0x7,
PropertyCustom = 0x6,
PropertyDictionaryEnd = 0xe,
PropertyDictionaryStart = 0xd,
PropertyListEnd = 0xc,
PropertyListStart = 0xb,
PropertyStringReference = 0x21,
PropertyTypeReference = 0x22,
PropertyWithConverter = 0x24,
PropertyWithExtension = 0x23,
PropertyWithStaticResourceId = 0x38,
RoutedEvent = 0x12,
StaticResourceEnd = 0x31,
StaticResourceId = 0x32,
StaticResourceStart = 0x30,
StringInfo = 0x20,
Text = 0x10,
TextWithConverter = 0x11,
TextWithId = 0x33,
TypeInfo = 0x1d,
TypeSerializerInfo = 0x1e,
XmlAttribute = 0x15,
XmlnsProperty = 0x14
}
internal abstract class BamlRecord
{
public abstract BamlRecordType Type { get; }
public long Position { get; internal set; }
public abstract void Read(BamlBinaryReader reader);
public abstract void Write(BamlBinaryWriter writer);
}
internal abstract class SizedBamlRecord : BamlRecord
{
public override void Read(BamlBinaryReader reader)
{
long pos = reader.BaseStream.Position;
int size = reader.ReadEncodedInt();
ReadData(reader, size - (int)(reader.BaseStream.Position - pos));
}
int SizeofEncodedInt(int val)
{
if ((val & ~0x7F) == 0)
{
return 1;
}
if ((val & ~0x3FFF) == 0)
{
return 2;
}
if ((val & ~0x1FFFFF) == 0)
{
return 3;
}
if ((val & ~0xFFFFFFF) == 0)
{
return 4;
}
return 5;
}
public override void Write(BamlBinaryWriter writer)
{
long pos = writer.BaseStream.Position;
WriteData(writer);
var size = (int)(writer.BaseStream.Position - pos);
size = SizeofEncodedInt(SizeofEncodedInt(size) + size) + size;
writer.BaseStream.Position = pos;
writer.WriteEncodedInt(size);
WriteData(writer);
}
protected abstract void ReadData(BamlBinaryReader reader, int size);
protected abstract void WriteData(BamlBinaryWriter writer);
}
internal interface IBamlDeferRecord
{
long Position { get; }
BamlRecord Record { get; set; }
void ReadDefer(BamlDocument doc, int index, Func resolve);
void WriteDefer(BamlDocument doc, int index, BinaryWriter wtr);
}
internal class XmlnsPropertyRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.XmlnsProperty;
public string Prefix { get; set; }
public string XmlNamespace { get; set; }
public ushort[] AssemblyIds { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
Prefix = reader.ReadString();
XmlNamespace = reader.ReadString();
AssemblyIds = new ushort[reader.ReadUInt16()];
for (int i = 0; i < AssemblyIds.Length; i++)
AssemblyIds[i] = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(Prefix);
writer.Write(XmlNamespace);
writer.Write((ushort)AssemblyIds.Length);
foreach (ushort i in AssemblyIds)
writer.Write(i);
}
}
internal class PresentationOptionsAttributeRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.PresentationOptionsAttribute;
public string Value { get; set; }
public ushort NameId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
Value = reader.ReadString();
NameId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(Value);
writer.Write(NameId);
}
}
internal class PIMappingRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.PIMapping;
public string XmlNamespace { get; set; }
public string ClrNamespace { get; set; }
public ushort AssemblyId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
XmlNamespace = reader.ReadString();
ClrNamespace = reader.ReadString();
AssemblyId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(XmlNamespace);
writer.Write(ClrNamespace);
writer.Write(AssemblyId);
}
}
internal class AssemblyInfoRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.AssemblyInfo;
public ushort AssemblyId { get; set; }
public string AssemblyFullName { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
AssemblyId = reader.ReadUInt16();
AssemblyFullName = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(AssemblyId);
writer.Write(AssemblyFullName);
}
}
internal class PropertyRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.Property;
public ushort AttributeId { get; set; }
public string Value { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
AttributeId = reader.ReadUInt16();
Value = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(AttributeId);
writer.Write(Value);
}
}
internal class PropertyWithConverterRecord : PropertyRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyWithConverter;
public ushort ConverterTypeId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
base.ReadData(reader, size);
ConverterTypeId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
base.WriteData(writer);
writer.Write(ConverterTypeId);
}
}
internal class PropertyCustomRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyCustom;
public ushort AttributeId { get; set; }
public ushort SerializerTypeId { get; set; }
public byte[] Data { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
long pos = reader.BaseStream.Position;
AttributeId = reader.ReadUInt16();
SerializerTypeId = reader.ReadUInt16();
Data = reader.ReadBytes(size - (int)(reader.BaseStream.Position - pos));
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(AttributeId);
writer.Write(SerializerTypeId);
writer.Write(Data);
}
}
internal class DefAttributeRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.DefAttribute;
public string Value { get; set; }
public ushort NameId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
Value = reader.ReadString();
NameId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(Value);
writer.Write(NameId);
}
}
internal class DefAttributeKeyStringRecord : SizedBamlRecord, IBamlDeferRecord
{
internal uint pos = 0xffffffff;
public override BamlRecordType Type => BamlRecordType.DefAttributeKeyString;
public ushort ValueId { get; set; }
public bool Shared { get; set; }
public bool SharedSet { get; set; }
public BamlRecord Record { get; set; }
public void ReadDefer(BamlDocument doc, int index, Func resolve)
{
bool keys = true;
do
{
switch (doc[index].Type)
{
case BamlRecordType.DefAttributeKeyString:
case BamlRecordType.DefAttributeKeyType:
case BamlRecordType.OptimizedStaticResource:
keys = true;
break;
case BamlRecordType.StaticResourceStart:
NavigateTree(doc, BamlRecordType.StaticResourceStart, BamlRecordType.StaticResourceEnd, ref index);
keys = true;
break;
case BamlRecordType.KeyElementStart:
NavigateTree(doc, BamlRecordType.KeyElementStart, BamlRecordType.KeyElementEnd, ref index);
keys = true;
break;
default:
keys = false;
index--;
break;
}
index++;
} while (keys);
Record = resolve(doc[index].Position + pos);
}
public void WriteDefer(BamlDocument doc, int index, BinaryWriter wtr)
{
bool keys = true;
do
{
switch (doc[index].Type)
{
case BamlRecordType.DefAttributeKeyString:
case BamlRecordType.DefAttributeKeyType:
case BamlRecordType.OptimizedStaticResource:
keys = true;
break;
case BamlRecordType.StaticResourceStart:
NavigateTree(doc, BamlRecordType.StaticResourceStart, BamlRecordType.StaticResourceEnd, ref index);
keys = true;
break;
case BamlRecordType.KeyElementStart:
NavigateTree(doc, BamlRecordType.KeyElementStart, BamlRecordType.KeyElementEnd, ref index);
keys = true;
break;
default:
keys = false;
index--;
break;
}
index++;
} while (keys);
wtr.BaseStream.Seek(pos, SeekOrigin.Begin);
wtr.Write((uint)(Record.Position - doc[index].Position));
}
protected override void ReadData(BamlBinaryReader reader, int size)
{
ValueId = reader.ReadUInt16();
pos = reader.ReadUInt32();
Shared = reader.ReadBoolean();
SharedSet = reader.ReadBoolean();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(ValueId);
pos = (uint)writer.BaseStream.Position;
writer.Write((uint)0);
writer.Write(Shared);
writer.Write(SharedSet);
}
static void NavigateTree(BamlDocument doc, BamlRecordType start, BamlRecordType end, ref int index)
{
index++;
while (true) //Assume there alway is a end
{
if (doc[index].Type == start)
NavigateTree(doc, start, end, ref index);
else if (doc[index].Type == end)
return;
index++;
}
}
}
internal class TypeInfoRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.TypeInfo;
public ushort TypeId { get; set; }
public ushort AssemblyId { get; set; }
public string TypeFullName { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
TypeId = reader.ReadUInt16();
AssemblyId = reader.ReadUInt16();
TypeFullName = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(TypeId);
writer.Write(AssemblyId);
writer.Write(TypeFullName);
}
}
internal class TypeSerializerInfoRecord : TypeInfoRecord
{
public override BamlRecordType Type => BamlRecordType.TypeSerializerInfo;
public ushort SerializerTypeId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
base.ReadData(reader, size);
SerializerTypeId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
base.WriteData(writer);
writer.Write(SerializerTypeId);
}
}
internal class AttributeInfoRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.AttributeInfo;
public ushort AttributeId { get; set; }
public ushort OwnerTypeId { get; set; }
public byte AttributeUsage { get; set; }
public string Name { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
AttributeId = reader.ReadUInt16();
OwnerTypeId = reader.ReadUInt16();
AttributeUsage = reader.ReadByte();
Name = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(AttributeId);
writer.Write(OwnerTypeId);
writer.Write(AttributeUsage);
writer.Write(Name);
}
}
internal class StringInfoRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.StringInfo;
public ushort StringId { get; set; }
public string Value { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
StringId = reader.ReadUInt16();
Value = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(StringId);
writer.Write(Value);
}
}
internal class TextRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.Text;
public string Value { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size) => Value = reader.ReadString();
protected override void WriteData(BamlBinaryWriter writer) => writer.Write(Value);
}
internal class TextWithConverterRecord : TextRecord
{
public override BamlRecordType Type => BamlRecordType.TextWithConverter;
public ushort ConverterTypeId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
base.ReadData(reader, size);
ConverterTypeId = reader.ReadUInt16();
}
protected override void WriteData(BamlBinaryWriter writer)
{
base.WriteData(writer);
writer.Write(ConverterTypeId);
}
}
internal class TextWithIdRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.TextWithId;
public ushort ValueId { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size) => ValueId = reader.ReadUInt16();
protected override void WriteData(BamlBinaryWriter writer) => writer.Write(ValueId);
}
internal class LiteralContentRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.LiteralContent;
public string Value { get; set; }
public uint Reserved0 { get; set; }
public uint Reserved1 { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
Value = reader.ReadString();
Reserved0 = reader.ReadUInt32();
Reserved1 = reader.ReadUInt32();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(Value);
writer.Write(Reserved0);
writer.Write(Reserved1);
}
}
internal class RoutedEventRecord : SizedBamlRecord
{
public override BamlRecordType Type => BamlRecordType.RoutedEvent;
public string Value { get; set; }
public ushort AttributeId { get; set; }
public uint Reserved1 { get; set; }
protected override void ReadData(BamlBinaryReader reader, int size)
{
AttributeId = reader.ReadUInt16();
Value = reader.ReadString();
}
protected override void WriteData(BamlBinaryWriter writer)
{
writer.Write(Value);
writer.Write(AttributeId);
}
}
internal class DocumentStartRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.DocumentStart;
public bool LoadAsync { get; set; }
public uint MaxAsyncRecords { get; set; }
public bool DebugBaml { get; set; }
public override void Read(BamlBinaryReader reader)
{
LoadAsync = reader.ReadBoolean();
MaxAsyncRecords = reader.ReadUInt32();
DebugBaml = reader.ReadBoolean();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(LoadAsync);
writer.Write(MaxAsyncRecords);
writer.Write(DebugBaml);
}
}
internal class DocumentEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.DocumentEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class ElementStartRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ElementStart;
public ushort TypeId { get; set; }
public byte Flags { get; set; }
public override void Read(BamlBinaryReader reader)
{
TypeId = reader.ReadUInt16();
Flags = reader.ReadByte();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(TypeId);
writer.Write(Flags);
}
}
internal class ElementEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ElementEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class KeyElementStartRecord : DefAttributeKeyTypeRecord
{
public override BamlRecordType Type => BamlRecordType.KeyElementStart;
}
internal class KeyElementEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.KeyElementEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class ConnectionIdRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ConnectionId;
public uint ConnectionId { get; set; }
public override void Read(BamlBinaryReader reader) => ConnectionId = reader.ReadUInt32();
public override void Write(BamlBinaryWriter writer) => writer.Write(ConnectionId);
}
internal class PropertyWithExtensionRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyWithExtension;
public ushort AttributeId { get; set; }
public ushort Flags { get; set; }
public ushort ValueId { get; set; }
public override void Read(BamlBinaryReader reader)
{
AttributeId = reader.ReadUInt16();
Flags = reader.ReadUInt16();
ValueId = reader.ReadUInt16();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(AttributeId);
writer.Write(Flags);
writer.Write(ValueId);
}
}
internal class PropertyTypeReferenceRecord : PropertyComplexStartRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyTypeReference;
public ushort TypeId { get; set; }
public override void Read(BamlBinaryReader reader)
{
base.Read(reader);
TypeId = reader.ReadUInt16();
}
public override void Write(BamlBinaryWriter writer)
{
base.Write(writer);
writer.Write(TypeId);
}
}
internal class PropertyStringReferenceRecord : PropertyComplexStartRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyStringReference;
public ushort StringId { get; set; }
public override void Read(BamlBinaryReader reader)
{
base.Read(reader);
StringId = reader.ReadUInt16();
}
public override void Write(BamlBinaryWriter writer)
{
base.Write(writer);
writer.Write(StringId);
}
}
internal class PropertyWithStaticResourceIdRecord : StaticResourceIdRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyWithStaticResourceId;
public ushort AttributeId { get; set; }
public override void Read(BamlBinaryReader reader)
{
AttributeId = reader.ReadUInt16();
base.Read(reader);
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(AttributeId);
base.Write(writer);
}
}
internal class ContentPropertyRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ContentProperty;
public ushort AttributeId { get; set; }
public override void Read(BamlBinaryReader reader) => AttributeId = reader.ReadUInt16();
public override void Write(BamlBinaryWriter writer) => writer.Write(AttributeId);
}
internal class DefAttributeKeyTypeRecord : ElementStartRecord, IBamlDeferRecord
{
internal uint pos = 0xffffffff;
public override BamlRecordType Type => BamlRecordType.DefAttributeKeyType;
public bool Shared { get; set; }
public bool SharedSet { get; set; }
public BamlRecord Record { get; set; }
public void ReadDefer(BamlDocument doc, int index, Func resolve)
{
bool keys = true;
do
{
switch (doc[index].Type)
{
case BamlRecordType.DefAttributeKeyString:
case BamlRecordType.DefAttributeKeyType:
case BamlRecordType.OptimizedStaticResource:
keys = true;
break;
case BamlRecordType.StaticResourceStart:
NavigateTree(doc, BamlRecordType.StaticResourceStart, BamlRecordType.StaticResourceEnd, ref index);
keys = true;
break;
case BamlRecordType.KeyElementStart:
NavigateTree(doc, BamlRecordType.KeyElementStart, BamlRecordType.KeyElementEnd, ref index);
keys = true;
break;
default:
keys = false;
index--;
break;
}
index++;
} while (keys);
Record = resolve(doc[index].Position + pos);
}
public void WriteDefer(BamlDocument doc, int index, BinaryWriter wtr)
{
bool keys = true;
do
{
switch (doc[index].Type)
{
case BamlRecordType.DefAttributeKeyString:
case BamlRecordType.DefAttributeKeyType:
case BamlRecordType.OptimizedStaticResource:
keys = true;
break;
case BamlRecordType.StaticResourceStart:
NavigateTree(doc, BamlRecordType.StaticResourceStart, BamlRecordType.StaticResourceEnd, ref index);
keys = true;
break;
case BamlRecordType.KeyElementStart:
NavigateTree(doc, BamlRecordType.KeyElementStart, BamlRecordType.KeyElementEnd, ref index);
keys = true;
break;
default:
keys = false;
index--;
break;
}
index++;
} while (keys);
wtr.BaseStream.Seek(pos, SeekOrigin.Begin);
wtr.Write((uint)(Record.Position - doc[index].Position));
}
public override void Read(BamlBinaryReader reader)
{
base.Read(reader);
pos = reader.ReadUInt32();
Shared = reader.ReadBoolean();
SharedSet = reader.ReadBoolean();
}
public override void Write(BamlBinaryWriter writer)
{
base.Write(writer);
pos = (uint)writer.BaseStream.Position;
writer.Write((uint)0);
writer.Write(Shared);
writer.Write(SharedSet);
}
static void NavigateTree(BamlDocument doc, BamlRecordType start, BamlRecordType end, ref int index)
{
index++;
while (true)
{
if (doc[index].Type == start)
NavigateTree(doc, start, end, ref index);
else if (doc[index].Type == end)
return;
index++;
}
}
}
internal class PropertyListStartRecord : PropertyComplexStartRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyListStart;
}
internal class PropertyListEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyListEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class PropertyDictionaryStartRecord : PropertyComplexStartRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyDictionaryStart;
}
internal class PropertyDictionaryEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyDictionaryEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class PropertyArrayStartRecord : PropertyComplexStartRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyArrayStart;
}
internal class PropertyArrayEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyArrayEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class PropertyComplexStartRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyComplexStart;
public ushort AttributeId { get; set; }
public override void Read(BamlBinaryReader reader) => AttributeId = reader.ReadUInt16();
public override void Write(BamlBinaryWriter writer) => writer.Write(AttributeId);
}
internal class PropertyComplexEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.PropertyComplexEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class ConstructorParametersStartRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ConstructorParametersStart;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class ConstructorParametersEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ConstructorParametersEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class ConstructorParameterTypeRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.ConstructorParameterType;
public ushort TypeId { get; set; }
public override void Read(BamlBinaryReader reader) => TypeId = reader.ReadUInt16();
public override void Write(BamlBinaryWriter writer) => writer.Write(TypeId);
}
internal class DeferableContentStartRecord : BamlRecord, IBamlDeferRecord
{
long pos;
internal uint size = 0xffffffff;
public override BamlRecordType Type => BamlRecordType.DeferableContentStart;
public BamlRecord Record { get; set; }
public void ReadDefer(BamlDocument doc, int index, Func resolve) => Record = resolve(pos + size);
public void WriteDefer(BamlDocument doc, int index, BinaryWriter wtr)
{
wtr.BaseStream.Seek(pos, SeekOrigin.Begin);
wtr.Write((uint)(Record.Position - (pos + 4)));
}
public override void Read(BamlBinaryReader reader)
{
size = reader.ReadUInt32();
pos = reader.BaseStream.Position;
}
public override void Write(BamlBinaryWriter writer)
{
pos = writer.BaseStream.Position;
writer.Write((uint)0);
}
}
internal class StaticResourceStartRecord : ElementStartRecord
{
public override BamlRecordType Type => BamlRecordType.StaticResourceStart;
}
internal class StaticResourceEndRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.StaticResourceEnd;
public override void Read(BamlBinaryReader reader)
{
}
public override void Write(BamlBinaryWriter writer)
{
}
}
internal class StaticResourceIdRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.StaticResourceId;
public ushort StaticResourceId { get; set; }
public override void Read(BamlBinaryReader reader) => StaticResourceId = reader.ReadUInt16();
public override void Write(BamlBinaryWriter writer) => writer.Write(StaticResourceId);
}
internal class OptimizedStaticResourceRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.OptimizedStaticResource;
public byte Flags { get; set; }
public ushort ValueId { get; set; }
public bool IsType => (Flags & 1) != 0;
public bool IsStatic => (Flags & 2) != 0;
public override void Read(BamlBinaryReader reader)
{
Flags = reader.ReadByte();
ValueId = reader.ReadUInt16();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(Flags);
writer.Write(ValueId);
}
}
internal class LineNumberAndPositionRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.LineNumberAndPosition;
public uint LineNumber { get; set; }
public uint LinePosition { get; set; }
public override void Read(BamlBinaryReader reader)
{
LineNumber = reader.ReadUInt32();
LinePosition = reader.ReadUInt32();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(LineNumber);
writer.Write(LinePosition);
}
}
internal class LinePositionRecord : BamlRecord
{
public override BamlRecordType Type => BamlRecordType.LinePosition;
public uint LinePosition { get; set; }
public override void Read(BamlBinaryReader reader) => LinePosition = reader.ReadUInt32();
public override void Write(BamlBinaryWriter writer) => writer.Write(LinePosition);
}
internal class NamedElementStartRecord : ElementStartRecord
{
public override BamlRecordType Type => BamlRecordType.NamedElementStart;
public string RuntimeName { get; set; }
public override void Read(BamlBinaryReader reader)
{
TypeId = reader.ReadUInt16();
RuntimeName = reader.ReadString();
}
public override void Write(BamlBinaryWriter writer)
{
writer.Write(TypeId);
if (RuntimeName != null)
{
writer.Write(RuntimeName);
}
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/BamlWriter.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
using System.IO;
using System.Text;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal class BamlBinaryWriter : BinaryWriter
{
public BamlBinaryWriter(Stream stream)
: base(stream)
{
}
public void WriteEncodedInt(int val) => Write7BitEncodedInt(val);
}
internal class BamlWriter
{
public static void WriteDocument(BamlDocument doc, Stream str)
{
var writer = new BamlBinaryWriter(str);
{
var wtr = new BinaryWriter(str, Encoding.Unicode);
int len = doc.Signature.Length * 2;
wtr.Write(len);
wtr.Write(doc.Signature.ToCharArray());
wtr.Write(new byte[((len + 3) & ~3) - len]);
}
writer.Write(doc.ReaderVersion.Major);
writer.Write(doc.ReaderVersion.Minor);
writer.Write(doc.UpdaterVersion.Major);
writer.Write(doc.UpdaterVersion.Minor);
writer.Write(doc.WriterVersion.Major);
writer.Write(doc.WriterVersion.Minor);
var defers = new List();
for (int i = 0; i < doc.Count; i++)
{
BamlRecord rec = doc[i];
rec.Position = str.Position;
writer.Write((byte)rec.Type);
rec.Write(writer);
if (rec is IBamlDeferRecord)
defers.Add(i);
}
foreach (int i in defers)
(doc[i] as IBamlDeferRecord).WriteDefer(doc, i, writer);
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/KnownMembers.cs
================================================
/*
Copyright (c) 2015 Ki
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.
*/
namespace ICSharpCode.BamlDecompiler.Baml
{
// Auto generated. Do not modify.
internal enum KnownMembers : short
{
Unknown = 0,
AccessText_Text = 1,
BeginStoryboard_Storyboard = 2,
BitmapEffectGroup_Children = 3,
Border_Background = 4,
Border_BorderBrush = 5,
Border_BorderThickness = 6,
ButtonBase_Command = 7,
ButtonBase_CommandParameter = 8,
ButtonBase_CommandTarget = 9,
ButtonBase_IsPressed = 10,
ColumnDefinition_MaxWidth = 11,
ColumnDefinition_MinWidth = 12,
ColumnDefinition_Width = 13,
ContentControl_Content = 14,
ContentControl_ContentTemplate = 15,
ContentControl_ContentTemplateSelector = 16,
ContentControl_HasContent = 17,
ContentElement_Focusable = 18,
ContentPresenter_Content = 19,
ContentPresenter_ContentSource = 20,
ContentPresenter_ContentTemplate = 21,
ContentPresenter_ContentTemplateSelector = 22,
ContentPresenter_RecognizesAccessKey = 23,
Control_Background = 24,
Control_BorderBrush = 25,
Control_BorderThickness = 26,
Control_FontFamily = 27,
Control_FontSize = 28,
Control_FontStretch = 29,
Control_FontStyle = 30,
Control_FontWeight = 31,
Control_Foreground = 32,
Control_HorizontalContentAlignment = 33,
Control_IsTabStop = 34,
Control_Padding = 35,
Control_TabIndex = 36,
Control_Template = 37,
Control_VerticalContentAlignment = 38,
DockPanel_Dock = 39,
DockPanel_LastChildFill = 40,
DocumentViewerBase_Document = 41,
DrawingGroup_Children = 42,
FlowDocumentReader_Document = 43,
FlowDocumentScrollViewer_Document = 44,
FrameworkContentElement_Style = 45,
FrameworkElement_FlowDirection = 46,
FrameworkElement_Height = 47,
FrameworkElement_HorizontalAlignment = 48,
FrameworkElement_Margin = 49,
FrameworkElement_MaxHeight = 50,
FrameworkElement_MaxWidth = 51,
FrameworkElement_MinHeight = 52,
FrameworkElement_MinWidth = 53,
FrameworkElement_Name = 54,
FrameworkElement_Style = 55,
FrameworkElement_VerticalAlignment = 56,
FrameworkElement_Width = 57,
GeneralTransformGroup_Children = 58,
GeometryGroup_Children = 59,
GradientBrush_GradientStops = 60,
Grid_Column = 61,
Grid_ColumnSpan = 62,
Grid_Row = 63,
Grid_RowSpan = 64,
GridViewColumn_Header = 65,
HeaderedContentControl_HasHeader = 66,
HeaderedContentControl_Header = 67,
HeaderedContentControl_HeaderTemplate = 68,
HeaderedContentControl_HeaderTemplateSelector = 69,
HeaderedItemsControl_HasHeader = 70,
HeaderedItemsControl_Header = 71,
HeaderedItemsControl_HeaderTemplate = 72,
HeaderedItemsControl_HeaderTemplateSelector = 73,
Hyperlink_NavigateUri = 74,
Image_Source = 75,
Image_Stretch = 76,
ItemsControl_ItemContainerStyle = 77,
ItemsControl_ItemContainerStyleSelector = 78,
ItemsControl_ItemTemplate = 79,
ItemsControl_ItemTemplateSelector = 80,
ItemsControl_ItemsPanel = 81,
ItemsControl_ItemsSource = 82,
MaterialGroup_Children = 83,
Model3DGroup_Children = 84,
Page_Content = 85,
Panel_Background = 86,
Path_Data = 87,
PathFigure_Segments = 88,
PathGeometry_Figures = 89,
Popup_Child = 90,
Popup_IsOpen = 91,
Popup_Placement = 92,
Popup_PopupAnimation = 93,
RowDefinition_Height = 94,
RowDefinition_MaxHeight = 95,
RowDefinition_MinHeight = 96,
ScrollViewer_CanContentScroll = 97,
ScrollViewer_HorizontalScrollBarVisibility = 98,
ScrollViewer_VerticalScrollBarVisibility = 99,
Shape_Fill = 100,
Shape_Stroke = 101,
Shape_StrokeThickness = 102,
TextBlock_Background = 103,
TextBlock_FontFamily = 104,
TextBlock_FontSize = 105,
TextBlock_FontStretch = 106,
TextBlock_FontStyle = 107,
TextBlock_FontWeight = 108,
TextBlock_Foreground = 109,
TextBlock_Text = 110,
TextBlock_TextDecorations = 111,
TextBlock_TextTrimming = 112,
TextBlock_TextWrapping = 113,
TextBox_Text = 114,
TextElement_Background = 115,
TextElement_FontFamily = 116,
TextElement_FontSize = 117,
TextElement_FontStretch = 118,
TextElement_FontStyle = 119,
TextElement_FontWeight = 120,
TextElement_Foreground = 121,
TimelineGroup_Children = 122,
Track_IsDirectionReversed = 123,
Track_Maximum = 124,
Track_Minimum = 125,
Track_Orientation = 126,
Track_Value = 127,
Track_ViewportSize = 128,
Transform3DGroup_Children = 129,
TransformGroup_Children = 130,
UIElement_ClipToBounds = 131,
UIElement_Focusable = 132,
UIElement_IsEnabled = 133,
UIElement_RenderTransform = 134,
UIElement_Visibility = 135,
Viewport3D_Children = 136,
AdornedElementPlaceholder_Child = 138,
AdornerDecorator_Child = 139,
AnchoredBlock_Blocks = 140,
ArrayExtension_Items = 141,
BlockUIContainer_Child = 142,
Bold_Inlines = 143,
BooleanAnimationUsingKeyFrames_KeyFrames = 144,
Border_Child = 145,
BulletDecorator_Child = 146,
Button_Content = 147,
ButtonBase_Content = 148,
ByteAnimationUsingKeyFrames_KeyFrames = 149,
Canvas_Children = 150,
CharAnimationUsingKeyFrames_KeyFrames = 151,
CheckBox_Content = 152,
ColorAnimationUsingKeyFrames_KeyFrames = 153,
ComboBox_Items = 154,
ComboBoxItem_Content = 155,
ContextMenu_Items = 156,
ControlTemplate_VisualTree = 157,
DataTemplate_VisualTree = 158,
DataTrigger_Setters = 159,
DecimalAnimationUsingKeyFrames_KeyFrames = 160,
Decorator_Child = 161,
DockPanel_Children = 162,
DocumentViewer_Document = 163,
DoubleAnimationUsingKeyFrames_KeyFrames = 164,
EventTrigger_Actions = 165,
Expander_Content = 166,
Figure_Blocks = 167,
FixedDocument_Pages = 168,
FixedDocumentSequence_References = 169,
FixedPage_Children = 170,
Floater_Blocks = 171,
FlowDocument_Blocks = 172,
FlowDocumentPageViewer_Document = 173,
FrameworkTemplate_VisualTree = 174,
Grid_Children = 175,
GridView_Columns = 176,
GridViewColumnHeader_Content = 177,
GroupBox_Content = 178,
GroupItem_Content = 179,
HeaderedContentControl_Content = 180,
HeaderedItemsControl_Items = 181,
HierarchicalDataTemplate_VisualTree = 182,
Hyperlink_Inlines = 183,
InkCanvas_Children = 184,
InkPresenter_Child = 185,
InlineUIContainer_Child = 186,
InputScopeName_NameValue = 187,
Int16AnimationUsingKeyFrames_KeyFrames = 188,
Int32AnimationUsingKeyFrames_KeyFrames = 189,
Int64AnimationUsingKeyFrames_KeyFrames = 190,
Italic_Inlines = 191,
ItemsControl_Items = 192,
ItemsPanelTemplate_VisualTree = 193,
Label_Content = 194,
LinearGradientBrush_GradientStops = 195,
List_ListItems = 196,
ListBox_Items = 197,
ListBoxItem_Content = 198,
ListItem_Blocks = 199,
ListView_Items = 200,
ListViewItem_Content = 201,
MatrixAnimationUsingKeyFrames_KeyFrames = 202,
Menu_Items = 203,
MenuBase_Items = 204,
MenuItem_Items = 205,
ModelVisual3D_Children = 206,
MultiBinding_Bindings = 207,
MultiDataTrigger_Setters = 208,
MultiTrigger_Setters = 209,
ObjectAnimationUsingKeyFrames_KeyFrames = 210,
PageContent_Child = 211,
PageFunctionBase_Content = 212,
Panel_Children = 213,
Paragraph_Inlines = 214,
ParallelTimeline_Children = 215,
Point3DAnimationUsingKeyFrames_KeyFrames = 216,
PointAnimationUsingKeyFrames_KeyFrames = 217,
PriorityBinding_Bindings = 218,
QuaternionAnimationUsingKeyFrames_KeyFrames = 219,
RadialGradientBrush_GradientStops = 220,
RadioButton_Content = 221,
RectAnimationUsingKeyFrames_KeyFrames = 222,
RepeatButton_Content = 223,
RichTextBox_Document = 224,
Rotation3DAnimationUsingKeyFrames_KeyFrames = 225,
Run_Text = 226,
ScrollViewer_Content = 227,
Section_Blocks = 228,
Selector_Items = 229,
SingleAnimationUsingKeyFrames_KeyFrames = 230,
SizeAnimationUsingKeyFrames_KeyFrames = 231,
Span_Inlines = 232,
StackPanel_Children = 233,
StatusBar_Items = 234,
StatusBarItem_Content = 235,
Storyboard_Children = 236,
StringAnimationUsingKeyFrames_KeyFrames = 237,
Style_Setters = 238,
TabControl_Items = 239,
TabItem_Content = 240,
TabPanel_Children = 241,
Table_RowGroups = 242,
TableCell_Blocks = 243,
TableRow_Cells = 244,
TableRowGroup_Rows = 245,
TextBlock_Inlines = 246,
ThicknessAnimationUsingKeyFrames_KeyFrames = 247,
ToggleButton_Content = 248,
ToolBar_Items = 249,
ToolBarOverflowPanel_Children = 250,
ToolBarPanel_Children = 251,
ToolBarTray_ToolBars = 252,
ToolTip_Content = 253,
TreeView_Items = 254,
TreeViewItem_Items = 255,
Trigger_Setters = 256,
Underline_Inlines = 257,
UniformGrid_Children = 258,
UserControl_Content = 259,
Vector3DAnimationUsingKeyFrames_KeyFrames = 260,
VectorAnimationUsingKeyFrames_KeyFrames = 261,
Viewbox_Child = 262,
Viewport3DVisual_Children = 263,
VirtualizingPanel_Children = 264,
VirtualizingStackPanel_Children = 265,
Window_Content = 266,
WrapPanel_Children = 267,
XmlDataProvider_XmlSerializer = 268,
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/KnownThings.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal partial class KnownThings
{
readonly IDecompilerTypeSystem typeSystem;
readonly Dictionary assemblies;
readonly Dictionary members;
readonly Dictionary types;
readonly Dictionary strings;
readonly Dictionary resources;
public KnownThings(IDecompilerTypeSystem typeSystem)
{
this.typeSystem = typeSystem;
assemblies = new Dictionary();
types = new Dictionary();
members = new Dictionary();
strings = new Dictionary();
resources = new Dictionary();
try
{
InitAssemblies();
InitTypes();
InitMembers();
InitStrings();
InitResources();
}
catch (Exception ex)
{
throw new ICSharpCode.Decompiler.DecompilerException(typeSystem.MainModule.MetadataFile, ex.Message, ex);
}
}
public Func Types => id => types[id];
public Func Members => id => members[id];
public Func Strings => id => strings[id];
public Func Resources => id => resources[id];
public IModule FrameworkAssembly => assemblies[0];
IModule ResolveAssembly(string name)
{
IModule module = typeSystem.Modules.FirstOrDefault(m => m.AssemblyName == name);
if (module == null)
throw new Exception("Could not resolve known assembly '" + name + "'!");
return module;
}
ITypeDefinition InitType(IModule assembly, string ns, string name) => assembly.GetTypeDefinition(new TopLevelTypeName(ns, name));
KnownMember InitMember(KnownTypes parent, string name, ITypeDefinition type) => new KnownMember(parent, types[parent], name, type);
}
internal class KnownMember
{
public KnownMember(KnownTypes parent, ITypeDefinition declType, string name, ITypeDefinition type)
{
Parent = parent;
Property = declType.GetProperties(p => p.Name == name, GetMemberOptions.IgnoreInheritedMembers).SingleOrDefault();
DeclaringType = declType;
Name = name;
Type = type;
}
public KnownTypes Parent { get; }
public ITypeDefinition DeclaringType { get; }
public IProperty Property { get; }
public string Name { get; }
public ITypeDefinition Type { get; }
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/KnownThings.g.cs
================================================
/*
Copyright (c) 2015 Ki
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;
namespace ICSharpCode.BamlDecompiler.Baml
{
internal partial class KnownThings
{
// Auto-generated. Do not modify.
void InitAssemblies()
{
assemblies[0] = ResolveAssembly("mscorlib");
assemblies[1] = ResolveAssembly("System");
assemblies[2] = ResolveAssembly("WindowsBase");
assemblies[3] = ResolveAssembly("PresentationCore");
assemblies[4] = ResolveAssembly("PresentationFramework");
assemblies[5] = ResolveAssembly("System.Xml");
}
void InitTypes()
{
types[KnownTypes.AccessText] = InitType(assemblies[4], "System.Windows.Controls", "AccessText");
types[KnownTypes.AdornedElementPlaceholder] = InitType(assemblies[4], "System.Windows.Controls", "AdornedElementPlaceholder");
types[KnownTypes.Adorner] = InitType(assemblies[4], "System.Windows.Documents", "Adorner");
types[KnownTypes.AdornerDecorator] = InitType(assemblies[4], "System.Windows.Documents", "AdornerDecorator");
types[KnownTypes.AdornerLayer] = InitType(assemblies[4], "System.Windows.Documents", "AdornerLayer");
types[KnownTypes.AffineTransform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "AffineTransform3D");
types[KnownTypes.AmbientLight] = InitType(assemblies[3], "System.Windows.Media.Media3D", "AmbientLight");
types[KnownTypes.AnchoredBlock] = InitType(assemblies[4], "System.Windows.Documents", "AnchoredBlock");
types[KnownTypes.Animatable] = InitType(assemblies[3], "System.Windows.Media.Animation", "Animatable");
types[KnownTypes.AnimationClock] = InitType(assemblies[3], "System.Windows.Media.Animation", "AnimationClock");
types[KnownTypes.AnimationTimeline] = InitType(assemblies[3], "System.Windows.Media.Animation", "AnimationTimeline");
types[KnownTypes.Application] = InitType(assemblies[4], "System.Windows", "Application");
types[KnownTypes.ArcSegment] = InitType(assemblies[3], "System.Windows.Media", "ArcSegment");
types[KnownTypes.ArrayExtension] = InitType(assemblies[4], "System.Windows.Markup", "ArrayExtension");
types[KnownTypes.AxisAngleRotation3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "AxisAngleRotation3D");
types[KnownTypes.BaseIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "BaseIListConverter");
types[KnownTypes.BeginStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "BeginStoryboard");
types[KnownTypes.BevelBitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "BevelBitmapEffect");
types[KnownTypes.BezierSegment] = InitType(assemblies[3], "System.Windows.Media", "BezierSegment");
types[KnownTypes.Binding] = InitType(assemblies[4], "System.Windows.Data", "Binding");
types[KnownTypes.BindingBase] = InitType(assemblies[4], "System.Windows.Data", "BindingBase");
types[KnownTypes.BindingExpression] = InitType(assemblies[4], "System.Windows.Data", "BindingExpression");
types[KnownTypes.BindingExpressionBase] = InitType(assemblies[4], "System.Windows.Data", "BindingExpressionBase");
types[KnownTypes.BindingListCollectionView] = InitType(assemblies[4], "System.Windows.Data", "BindingListCollectionView");
types[KnownTypes.BitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapDecoder");
types[KnownTypes.BitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "BitmapEffect");
types[KnownTypes.BitmapEffectCollection] = InitType(assemblies[3], "System.Windows.Media.Effects", "BitmapEffectCollection");
types[KnownTypes.BitmapEffectGroup] = InitType(assemblies[3], "System.Windows.Media.Effects", "BitmapEffectGroup");
types[KnownTypes.BitmapEffectInput] = InitType(assemblies[3], "System.Windows.Media.Effects", "BitmapEffectInput");
types[KnownTypes.BitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapEncoder");
types[KnownTypes.BitmapFrame] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapFrame");
types[KnownTypes.BitmapImage] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapImage");
types[KnownTypes.BitmapMetadata] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapMetadata");
types[KnownTypes.BitmapPalette] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapPalette");
types[KnownTypes.BitmapSource] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BitmapSource");
types[KnownTypes.Block] = InitType(assemblies[4], "System.Windows.Documents", "Block");
types[KnownTypes.BlockUIContainer] = InitType(assemblies[4], "System.Windows.Documents", "BlockUIContainer");
types[KnownTypes.BlurBitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "BlurBitmapEffect");
types[KnownTypes.BmpBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BmpBitmapDecoder");
types[KnownTypes.BmpBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "BmpBitmapEncoder");
types[KnownTypes.Bold] = InitType(assemblies[4], "System.Windows.Documents", "Bold");
types[KnownTypes.BoolIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "BoolIListConverter");
types[KnownTypes.Boolean] = InitType(assemblies[0], "System", "Boolean");
types[KnownTypes.BooleanAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "BooleanAnimationBase");
types[KnownTypes.BooleanAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "BooleanAnimationUsingKeyFrames");
types[KnownTypes.BooleanConverter] = InitType(assemblies[1], "System.ComponentModel", "BooleanConverter");
types[KnownTypes.BooleanKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "BooleanKeyFrame");
types[KnownTypes.BooleanKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "BooleanKeyFrameCollection");
types[KnownTypes.BooleanToVisibilityConverter] = InitType(assemblies[4], "System.Windows.Controls", "BooleanToVisibilityConverter");
types[KnownTypes.Border] = InitType(assemblies[4], "System.Windows.Controls", "Border");
types[KnownTypes.BorderGapMaskConverter] = InitType(assemblies[4], "System.Windows.Controls", "BorderGapMaskConverter");
types[KnownTypes.Brush] = InitType(assemblies[3], "System.Windows.Media", "Brush");
types[KnownTypes.BrushConverter] = InitType(assemblies[3], "System.Windows.Media", "BrushConverter");
types[KnownTypes.BulletDecorator] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "BulletDecorator");
types[KnownTypes.Button] = InitType(assemblies[4], "System.Windows.Controls", "Button");
types[KnownTypes.ButtonBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ButtonBase");
types[KnownTypes.Byte] = InitType(assemblies[0], "System", "Byte");
types[KnownTypes.ByteAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "ByteAnimation");
types[KnownTypes.ByteAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "ByteAnimationBase");
types[KnownTypes.ByteAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "ByteAnimationUsingKeyFrames");
types[KnownTypes.ByteConverter] = InitType(assemblies[1], "System.ComponentModel", "ByteConverter");
types[KnownTypes.ByteKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "ByteKeyFrame");
types[KnownTypes.ByteKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "ByteKeyFrameCollection");
types[KnownTypes.CachedBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "CachedBitmap");
types[KnownTypes.Camera] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Camera");
types[KnownTypes.Canvas] = InitType(assemblies[4], "System.Windows.Controls", "Canvas");
types[KnownTypes.Char] = InitType(assemblies[0], "System", "Char");
types[KnownTypes.CharAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "CharAnimationBase");
types[KnownTypes.CharAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "CharAnimationUsingKeyFrames");
types[KnownTypes.CharConverter] = InitType(assemblies[1], "System.ComponentModel", "CharConverter");
types[KnownTypes.CharIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "CharIListConverter");
types[KnownTypes.CharKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "CharKeyFrame");
types[KnownTypes.CharKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "CharKeyFrameCollection");
types[KnownTypes.CheckBox] = InitType(assemblies[4], "System.Windows.Controls", "CheckBox");
types[KnownTypes.Clock] = InitType(assemblies[3], "System.Windows.Media.Animation", "Clock");
types[KnownTypes.ClockController] = InitType(assemblies[3], "System.Windows.Media.Animation", "ClockController");
types[KnownTypes.ClockGroup] = InitType(assemblies[3], "System.Windows.Media.Animation", "ClockGroup");
types[KnownTypes.CollectionContainer] = InitType(assemblies[4], "System.Windows.Data", "CollectionContainer");
types[KnownTypes.CollectionView] = InitType(assemblies[4], "System.Windows.Data", "CollectionView");
types[KnownTypes.CollectionViewSource] = InitType(assemblies[4], "System.Windows.Data", "CollectionViewSource");
types[KnownTypes.Color] = InitType(assemblies[3], "System.Windows.Media", "Color");
types[KnownTypes.ColorAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "ColorAnimation");
types[KnownTypes.ColorAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "ColorAnimationBase");
types[KnownTypes.ColorAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "ColorAnimationUsingKeyFrames");
types[KnownTypes.ColorConvertedBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "ColorConvertedBitmap");
types[KnownTypes.ColorConvertedBitmapExtension] = InitType(assemblies[4], "System.Windows", "ColorConvertedBitmapExtension");
types[KnownTypes.ColorConverter] = InitType(assemblies[3], "System.Windows.Media", "ColorConverter");
types[KnownTypes.ColorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "ColorKeyFrame");
types[KnownTypes.ColorKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "ColorKeyFrameCollection");
types[KnownTypes.ColumnDefinition] = InitType(assemblies[4], "System.Windows.Controls", "ColumnDefinition");
types[KnownTypes.CombinedGeometry] = InitType(assemblies[3], "System.Windows.Media", "CombinedGeometry");
types[KnownTypes.ComboBox] = InitType(assemblies[4], "System.Windows.Controls", "ComboBox");
types[KnownTypes.ComboBoxItem] = InitType(assemblies[4], "System.Windows.Controls", "ComboBoxItem");
types[KnownTypes.CommandConverter] = InitType(assemblies[4], "System.Windows.Input", "CommandConverter");
types[KnownTypes.ComponentResourceKey] = InitType(assemblies[4], "System.Windows", "ComponentResourceKey");
types[KnownTypes.ComponentResourceKeyConverter] = InitType(assemblies[4], "System.Windows.Markup", "ComponentResourceKeyConverter");
types[KnownTypes.CompositionTarget] = InitType(assemblies[3], "System.Windows.Media", "CompositionTarget");
types[KnownTypes.Condition] = InitType(assemblies[4], "System.Windows", "Condition");
types[KnownTypes.ContainerVisual] = InitType(assemblies[3], "System.Windows.Media", "ContainerVisual");
types[KnownTypes.ContentControl] = InitType(assemblies[4], "System.Windows.Controls", "ContentControl");
types[KnownTypes.ContentElement] = InitType(assemblies[3], "System.Windows", "ContentElement");
types[KnownTypes.ContentPresenter] = InitType(assemblies[4], "System.Windows.Controls", "ContentPresenter");
types[KnownTypes.ContentPropertyAttribute] = InitType(assemblies[2], "System.Windows.Markup", "ContentPropertyAttribute");
types[KnownTypes.ContentWrapperAttribute] = InitType(assemblies[2], "System.Windows.Markup", "ContentWrapperAttribute");
types[KnownTypes.ContextMenu] = InitType(assemblies[4], "System.Windows.Controls", "ContextMenu");
types[KnownTypes.ContextMenuService] = InitType(assemblies[4], "System.Windows.Controls", "ContextMenuService");
types[KnownTypes.Control] = InitType(assemblies[4], "System.Windows.Controls", "Control");
types[KnownTypes.ControlTemplate] = InitType(assemblies[4], "System.Windows.Controls", "ControlTemplate");
types[KnownTypes.ControllableStoryboardAction] = InitType(assemblies[4], "System.Windows.Media.Animation", "ControllableStoryboardAction");
types[KnownTypes.CornerRadius] = InitType(assemblies[4], "System.Windows", "CornerRadius");
types[KnownTypes.CornerRadiusConverter] = InitType(assemblies[4], "System.Windows", "CornerRadiusConverter");
types[KnownTypes.CroppedBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "CroppedBitmap");
types[KnownTypes.CultureInfo] = InitType(assemblies[0], "System.Globalization", "CultureInfo");
types[KnownTypes.CultureInfoConverter] = InitType(assemblies[1], "System.ComponentModel", "CultureInfoConverter");
types[KnownTypes.CultureInfoIetfLanguageTagConverter] = InitType(assemblies[3], "System.Windows", "CultureInfoIetfLanguageTagConverter");
types[KnownTypes.Cursor] = InitType(assemblies[3], "System.Windows.Input", "Cursor");
types[KnownTypes.CursorConverter] = InitType(assemblies[3], "System.Windows.Input", "CursorConverter");
types[KnownTypes.DashStyle] = InitType(assemblies[3], "System.Windows.Media", "DashStyle");
types[KnownTypes.DataChangedEventManager] = InitType(assemblies[4], "System.Windows.Data", "DataChangedEventManager");
types[KnownTypes.DataTemplate] = InitType(assemblies[4], "System.Windows", "DataTemplate");
types[KnownTypes.DataTemplateKey] = InitType(assemblies[4], "System.Windows", "DataTemplateKey");
types[KnownTypes.DataTrigger] = InitType(assemblies[4], "System.Windows", "DataTrigger");
types[KnownTypes.DateTime] = InitType(assemblies[0], "System", "DateTime");
types[KnownTypes.DateTimeConverter] = InitType(assemblies[1], "System.ComponentModel", "DateTimeConverter");
types[KnownTypes.DateTimeConverter2] = InitType(assemblies[2], "System.Windows.Markup", "DateTimeConverter2");
types[KnownTypes.Decimal] = InitType(assemblies[0], "System", "Decimal");
types[KnownTypes.DecimalAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalAnimation");
types[KnownTypes.DecimalAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalAnimationBase");
types[KnownTypes.DecimalAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalAnimationUsingKeyFrames");
types[KnownTypes.DecimalConverter] = InitType(assemblies[1], "System.ComponentModel", "DecimalConverter");
types[KnownTypes.DecimalKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalKeyFrame");
types[KnownTypes.DecimalKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalKeyFrameCollection");
types[KnownTypes.Decorator] = InitType(assemblies[4], "System.Windows.Controls", "Decorator");
types[KnownTypes.DefinitionBase] = InitType(assemblies[4], "System.Windows.Controls", "DefinitionBase");
types[KnownTypes.DependencyObject] = InitType(assemblies[2], "System.Windows", "DependencyObject");
types[KnownTypes.DependencyProperty] = InitType(assemblies[2], "System.Windows", "DependencyProperty");
types[KnownTypes.DependencyPropertyConverter] = InitType(assemblies[4], "System.Windows.Markup", "DependencyPropertyConverter");
types[KnownTypes.DialogResultConverter] = InitType(assemblies[4], "System.Windows", "DialogResultConverter");
types[KnownTypes.DiffuseMaterial] = InitType(assemblies[3], "System.Windows.Media.Media3D", "DiffuseMaterial");
types[KnownTypes.DirectionalLight] = InitType(assemblies[3], "System.Windows.Media.Media3D", "DirectionalLight");
types[KnownTypes.DiscreteBooleanKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteBooleanKeyFrame");
types[KnownTypes.DiscreteByteKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteByteKeyFrame");
types[KnownTypes.DiscreteCharKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteCharKeyFrame");
types[KnownTypes.DiscreteColorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteColorKeyFrame");
types[KnownTypes.DiscreteDecimalKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteDecimalKeyFrame");
types[KnownTypes.DiscreteDoubleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteDoubleKeyFrame");
types[KnownTypes.DiscreteInt16KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteInt16KeyFrame");
types[KnownTypes.DiscreteInt32KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteInt32KeyFrame");
types[KnownTypes.DiscreteInt64KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteInt64KeyFrame");
types[KnownTypes.DiscreteMatrixKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteMatrixKeyFrame");
types[KnownTypes.DiscreteObjectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteObjectKeyFrame");
types[KnownTypes.DiscretePoint3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscretePoint3DKeyFrame");
types[KnownTypes.DiscretePointKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscretePointKeyFrame");
types[KnownTypes.DiscreteQuaternionKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteQuaternionKeyFrame");
types[KnownTypes.DiscreteRectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteRectKeyFrame");
types[KnownTypes.DiscreteRotation3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteRotation3DKeyFrame");
types[KnownTypes.DiscreteSingleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteSingleKeyFrame");
types[KnownTypes.DiscreteSizeKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteSizeKeyFrame");
types[KnownTypes.DiscreteStringKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteStringKeyFrame");
types[KnownTypes.DiscreteThicknessKeyFrame] = InitType(assemblies[4], "System.Windows.Media.Animation", "DiscreteThicknessKeyFrame");
types[KnownTypes.DiscreteVector3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteVector3DKeyFrame");
types[KnownTypes.DiscreteVectorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DiscreteVectorKeyFrame");
types[KnownTypes.DockPanel] = InitType(assemblies[4], "System.Windows.Controls", "DockPanel");
types[KnownTypes.DocumentPageView] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "DocumentPageView");
types[KnownTypes.DocumentReference] = InitType(assemblies[4], "System.Windows.Documents", "DocumentReference");
types[KnownTypes.DocumentViewer] = InitType(assemblies[4], "System.Windows.Controls", "DocumentViewer");
types[KnownTypes.DocumentViewerBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "DocumentViewerBase");
types[KnownTypes.Double] = InitType(assemblies[0], "System", "Double");
types[KnownTypes.DoubleAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleAnimation");
types[KnownTypes.DoubleAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleAnimationBase");
types[KnownTypes.DoubleAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleAnimationUsingKeyFrames");
types[KnownTypes.DoubleAnimationUsingPath] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleAnimationUsingPath");
types[KnownTypes.DoubleCollection] = InitType(assemblies[3], "System.Windows.Media", "DoubleCollection");
types[KnownTypes.DoubleCollectionConverter] = InitType(assemblies[3], "System.Windows.Media", "DoubleCollectionConverter");
types[KnownTypes.DoubleConverter] = InitType(assemblies[1], "System.ComponentModel", "DoubleConverter");
types[KnownTypes.DoubleIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "DoubleIListConverter");
types[KnownTypes.DoubleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleKeyFrame");
types[KnownTypes.DoubleKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleKeyFrameCollection");
types[KnownTypes.Drawing] = InitType(assemblies[3], "System.Windows.Media", "Drawing");
types[KnownTypes.DrawingBrush] = InitType(assemblies[3], "System.Windows.Media", "DrawingBrush");
types[KnownTypes.DrawingCollection] = InitType(assemblies[3], "System.Windows.Media", "DrawingCollection");
types[KnownTypes.DrawingContext] = InitType(assemblies[3], "System.Windows.Media", "DrawingContext");
types[KnownTypes.DrawingGroup] = InitType(assemblies[3], "System.Windows.Media", "DrawingGroup");
types[KnownTypes.DrawingImage] = InitType(assemblies[3], "System.Windows.Media", "DrawingImage");
types[KnownTypes.DrawingVisual] = InitType(assemblies[3], "System.Windows.Media", "DrawingVisual");
types[KnownTypes.DropShadowBitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "DropShadowBitmapEffect");
types[KnownTypes.Duration] = InitType(assemblies[3], "System.Windows", "Duration");
types[KnownTypes.DurationConverter] = InitType(assemblies[3], "System.Windows", "DurationConverter");
types[KnownTypes.DynamicResourceExtension] = InitType(assemblies[4], "System.Windows", "DynamicResourceExtension");
types[KnownTypes.DynamicResourceExtensionConverter] = InitType(assemblies[4], "System.Windows", "DynamicResourceExtensionConverter");
types[KnownTypes.Ellipse] = InitType(assemblies[4], "System.Windows.Shapes", "Ellipse");
types[KnownTypes.EllipseGeometry] = InitType(assemblies[3], "System.Windows.Media", "EllipseGeometry");
types[KnownTypes.EmbossBitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "EmbossBitmapEffect");
types[KnownTypes.EmissiveMaterial] = InitType(assemblies[3], "System.Windows.Media.Media3D", "EmissiveMaterial");
types[KnownTypes.EnumConverter] = InitType(assemblies[1], "System.ComponentModel", "EnumConverter");
types[KnownTypes.EventManager] = InitType(assemblies[3], "System.Windows", "EventManager");
types[KnownTypes.EventSetter] = InitType(assemblies[4], "System.Windows", "EventSetter");
types[KnownTypes.EventTrigger] = InitType(assemblies[4], "System.Windows", "EventTrigger");
types[KnownTypes.Expander] = InitType(assemblies[4], "System.Windows.Controls", "Expander");
types[KnownTypes.Expression] = InitType(assemblies[2], "System.Windows", "Expression");
types[KnownTypes.ExpressionConverter] = InitType(assemblies[2], "System.Windows", "ExpressionConverter");
types[KnownTypes.Figure] = InitType(assemblies[4], "System.Windows.Documents", "Figure");
types[KnownTypes.FigureLength] = InitType(assemblies[4], "System.Windows", "FigureLength");
types[KnownTypes.FigureLengthConverter] = InitType(assemblies[4], "System.Windows", "FigureLengthConverter");
types[KnownTypes.FixedDocument] = InitType(assemblies[4], "System.Windows.Documents", "FixedDocument");
types[KnownTypes.FixedDocumentSequence] = InitType(assemblies[4], "System.Windows.Documents", "FixedDocumentSequence");
types[KnownTypes.FixedPage] = InitType(assemblies[4], "System.Windows.Documents", "FixedPage");
types[KnownTypes.Floater] = InitType(assemblies[4], "System.Windows.Documents", "Floater");
types[KnownTypes.FlowDocument] = InitType(assemblies[4], "System.Windows.Documents", "FlowDocument");
types[KnownTypes.FlowDocumentPageViewer] = InitType(assemblies[4], "System.Windows.Controls", "FlowDocumentPageViewer");
types[KnownTypes.FlowDocumentReader] = InitType(assemblies[4], "System.Windows.Controls", "FlowDocumentReader");
types[KnownTypes.FlowDocumentScrollViewer] = InitType(assemblies[4], "System.Windows.Controls", "FlowDocumentScrollViewer");
types[KnownTypes.FocusManager] = InitType(assemblies[3], "System.Windows.Input", "FocusManager");
types[KnownTypes.FontFamily] = InitType(assemblies[3], "System.Windows.Media", "FontFamily");
types[KnownTypes.FontFamilyConverter] = InitType(assemblies[3], "System.Windows.Media", "FontFamilyConverter");
types[KnownTypes.FontSizeConverter] = InitType(assemblies[4], "System.Windows", "FontSizeConverter");
types[KnownTypes.FontStretch] = InitType(assemblies[3], "System.Windows", "FontStretch");
types[KnownTypes.FontStretchConverter] = InitType(assemblies[3], "System.Windows", "FontStretchConverter");
types[KnownTypes.FontStyle] = InitType(assemblies[3], "System.Windows", "FontStyle");
types[KnownTypes.FontStyleConverter] = InitType(assemblies[3], "System.Windows", "FontStyleConverter");
types[KnownTypes.FontWeight] = InitType(assemblies[3], "System.Windows", "FontWeight");
types[KnownTypes.FontWeightConverter] = InitType(assemblies[3], "System.Windows", "FontWeightConverter");
types[KnownTypes.FormatConvertedBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "FormatConvertedBitmap");
types[KnownTypes.Frame] = InitType(assemblies[4], "System.Windows.Controls", "Frame");
types[KnownTypes.FrameworkContentElement] = InitType(assemblies[4], "System.Windows", "FrameworkContentElement");
types[KnownTypes.FrameworkElement] = InitType(assemblies[4], "System.Windows", "FrameworkElement");
types[KnownTypes.FrameworkElementFactory] = InitType(assemblies[4], "System.Windows", "FrameworkElementFactory");
types[KnownTypes.FrameworkPropertyMetadata] = InitType(assemblies[4], "System.Windows", "FrameworkPropertyMetadata");
types[KnownTypes.FrameworkPropertyMetadataOptions] = InitType(assemblies[4], "System.Windows", "FrameworkPropertyMetadataOptions");
types[KnownTypes.FrameworkRichTextComposition] = InitType(assemblies[4], "System.Windows.Documents", "FrameworkRichTextComposition");
types[KnownTypes.FrameworkTemplate] = InitType(assemblies[4], "System.Windows", "FrameworkTemplate");
types[KnownTypes.FrameworkTextComposition] = InitType(assemblies[4], "System.Windows.Documents", "FrameworkTextComposition");
types[KnownTypes.Freezable] = InitType(assemblies[2], "System.Windows", "Freezable");
types[KnownTypes.GeneralTransform] = InitType(assemblies[3], "System.Windows.Media", "GeneralTransform");
types[KnownTypes.GeneralTransformCollection] = InitType(assemblies[3], "System.Windows.Media", "GeneralTransformCollection");
types[KnownTypes.GeneralTransformGroup] = InitType(assemblies[3], "System.Windows.Media", "GeneralTransformGroup");
types[KnownTypes.Geometry] = InitType(assemblies[3], "System.Windows.Media", "Geometry");
types[KnownTypes.Geometry3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Geometry3D");
types[KnownTypes.GeometryCollection] = InitType(assemblies[3], "System.Windows.Media", "GeometryCollection");
types[KnownTypes.GeometryConverter] = InitType(assemblies[3], "System.Windows.Media", "GeometryConverter");
types[KnownTypes.GeometryDrawing] = InitType(assemblies[3], "System.Windows.Media", "GeometryDrawing");
types[KnownTypes.GeometryGroup] = InitType(assemblies[3], "System.Windows.Media", "GeometryGroup");
types[KnownTypes.GeometryModel3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "GeometryModel3D");
types[KnownTypes.GestureRecognizer] = InitType(assemblies[3], "System.Windows.Ink", "GestureRecognizer");
types[KnownTypes.GifBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "GifBitmapDecoder");
types[KnownTypes.GifBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "GifBitmapEncoder");
types[KnownTypes.GlyphRun] = InitType(assemblies[3], "System.Windows.Media", "GlyphRun");
types[KnownTypes.GlyphRunDrawing] = InitType(assemblies[3], "System.Windows.Media", "GlyphRunDrawing");
types[KnownTypes.GlyphTypeface] = InitType(assemblies[3], "System.Windows.Media", "GlyphTypeface");
types[KnownTypes.Glyphs] = InitType(assemblies[4], "System.Windows.Documents", "Glyphs");
types[KnownTypes.GradientBrush] = InitType(assemblies[3], "System.Windows.Media", "GradientBrush");
types[KnownTypes.GradientStop] = InitType(assemblies[3], "System.Windows.Media", "GradientStop");
types[KnownTypes.GradientStopCollection] = InitType(assemblies[3], "System.Windows.Media", "GradientStopCollection");
types[KnownTypes.Grid] = InitType(assemblies[4], "System.Windows.Controls", "Grid");
types[KnownTypes.GridLength] = InitType(assemblies[4], "System.Windows", "GridLength");
types[KnownTypes.GridLengthConverter] = InitType(assemblies[4], "System.Windows", "GridLengthConverter");
types[KnownTypes.GridSplitter] = InitType(assemblies[4], "System.Windows.Controls", "GridSplitter");
types[KnownTypes.GridView] = InitType(assemblies[4], "System.Windows.Controls", "GridView");
types[KnownTypes.GridViewColumn] = InitType(assemblies[4], "System.Windows.Controls", "GridViewColumn");
types[KnownTypes.GridViewColumnHeader] = InitType(assemblies[4], "System.Windows.Controls", "GridViewColumnHeader");
types[KnownTypes.GridViewHeaderRowPresenter] = InitType(assemblies[4], "System.Windows.Controls", "GridViewHeaderRowPresenter");
types[KnownTypes.GridViewRowPresenter] = InitType(assemblies[4], "System.Windows.Controls", "GridViewRowPresenter");
types[KnownTypes.GridViewRowPresenterBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "GridViewRowPresenterBase");
types[KnownTypes.GroupBox] = InitType(assemblies[4], "System.Windows.Controls", "GroupBox");
types[KnownTypes.GroupItem] = InitType(assemblies[4], "System.Windows.Controls", "GroupItem");
types[KnownTypes.Guid] = InitType(assemblies[0], "System", "Guid");
types[KnownTypes.GuidConverter] = InitType(assemblies[1], "System.ComponentModel", "GuidConverter");
types[KnownTypes.GuidelineSet] = InitType(assemblies[3], "System.Windows.Media", "GuidelineSet");
types[KnownTypes.HeaderedContentControl] = InitType(assemblies[4], "System.Windows.Controls", "HeaderedContentControl");
types[KnownTypes.HeaderedItemsControl] = InitType(assemblies[4], "System.Windows.Controls", "HeaderedItemsControl");
types[KnownTypes.HierarchicalDataTemplate] = InitType(assemblies[4], "System.Windows", "HierarchicalDataTemplate");
types[KnownTypes.HostVisual] = InitType(assemblies[3], "System.Windows.Media", "HostVisual");
types[KnownTypes.Hyperlink] = InitType(assemblies[4], "System.Windows.Documents", "Hyperlink");
types[KnownTypes.IAddChild] = InitType(assemblies[3], "System.Windows.Markup", "IAddChild");
types[KnownTypes.IAddChildInternal] = InitType(assemblies[3], "System.Windows.Markup", "IAddChildInternal");
types[KnownTypes.ICommand] = InitType(assemblies[3], "System.Windows.Input", "ICommand");
types[KnownTypes.IComponentConnector] = InitType(assemblies[2], "System.Windows.Markup", "IComponentConnector");
types[KnownTypes.INameScope] = InitType(assemblies[2], "System.Windows.Markup", "INameScope");
types[KnownTypes.IStyleConnector] = InitType(assemblies[4], "System.Windows.Markup", "IStyleConnector");
types[KnownTypes.IconBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "IconBitmapDecoder");
types[KnownTypes.Image] = InitType(assemblies[4], "System.Windows.Controls", "Image");
types[KnownTypes.ImageBrush] = InitType(assemblies[3], "System.Windows.Media", "ImageBrush");
types[KnownTypes.ImageDrawing] = InitType(assemblies[3], "System.Windows.Media", "ImageDrawing");
types[KnownTypes.ImageMetadata] = InitType(assemblies[3], "System.Windows.Media", "ImageMetadata");
types[KnownTypes.ImageSource] = InitType(assemblies[3], "System.Windows.Media", "ImageSource");
types[KnownTypes.ImageSourceConverter] = InitType(assemblies[3], "System.Windows.Media", "ImageSourceConverter");
types[KnownTypes.InPlaceBitmapMetadataWriter] = InitType(assemblies[3], "System.Windows.Media.Imaging", "InPlaceBitmapMetadataWriter");
types[KnownTypes.InkCanvas] = InitType(assemblies[4], "System.Windows.Controls", "InkCanvas");
types[KnownTypes.InkPresenter] = InitType(assemblies[4], "System.Windows.Controls", "InkPresenter");
types[KnownTypes.Inline] = InitType(assemblies[4], "System.Windows.Documents", "Inline");
types[KnownTypes.InlineCollection] = InitType(assemblies[4], "System.Windows.Documents", "InlineCollection");
types[KnownTypes.InlineUIContainer] = InitType(assemblies[4], "System.Windows.Documents", "InlineUIContainer");
types[KnownTypes.InputBinding] = InitType(assemblies[3], "System.Windows.Input", "InputBinding");
types[KnownTypes.InputDevice] = InitType(assemblies[3], "System.Windows.Input", "InputDevice");
types[KnownTypes.InputLanguageManager] = InitType(assemblies[3], "System.Windows.Input", "InputLanguageManager");
types[KnownTypes.InputManager] = InitType(assemblies[3], "System.Windows.Input", "InputManager");
types[KnownTypes.InputMethod] = InitType(assemblies[3], "System.Windows.Input", "InputMethod");
types[KnownTypes.InputScope] = InitType(assemblies[3], "System.Windows.Input", "InputScope");
types[KnownTypes.InputScopeConverter] = InitType(assemblies[3], "System.Windows.Input", "InputScopeConverter");
types[KnownTypes.InputScopeName] = InitType(assemblies[3], "System.Windows.Input", "InputScopeName");
types[KnownTypes.InputScopeNameConverter] = InitType(assemblies[3], "System.Windows.Input", "InputScopeNameConverter");
types[KnownTypes.Int16] = InitType(assemblies[0], "System", "Int16");
types[KnownTypes.Int16Animation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int16Animation");
types[KnownTypes.Int16AnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int16AnimationBase");
types[KnownTypes.Int16AnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int16AnimationUsingKeyFrames");
types[KnownTypes.Int16Converter] = InitType(assemblies[1], "System.ComponentModel", "Int16Converter");
types[KnownTypes.Int16KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int16KeyFrame");
types[KnownTypes.Int16KeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int16KeyFrameCollection");
types[KnownTypes.Int32] = InitType(assemblies[0], "System", "Int32");
types[KnownTypes.Int32Animation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int32Animation");
types[KnownTypes.Int32AnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int32AnimationBase");
types[KnownTypes.Int32AnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int32AnimationUsingKeyFrames");
types[KnownTypes.Int32Collection] = InitType(assemblies[3], "System.Windows.Media", "Int32Collection");
types[KnownTypes.Int32CollectionConverter] = InitType(assemblies[3], "System.Windows.Media", "Int32CollectionConverter");
types[KnownTypes.Int32Converter] = InitType(assemblies[1], "System.ComponentModel", "Int32Converter");
types[KnownTypes.Int32KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int32KeyFrame");
types[KnownTypes.Int32KeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int32KeyFrameCollection");
types[KnownTypes.Int32Rect] = InitType(assemblies[2], "System.Windows", "Int32Rect");
types[KnownTypes.Int32RectConverter] = InitType(assemblies[2], "System.Windows", "Int32RectConverter");
types[KnownTypes.Int64] = InitType(assemblies[0], "System", "Int64");
types[KnownTypes.Int64Animation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int64Animation");
types[KnownTypes.Int64AnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int64AnimationBase");
types[KnownTypes.Int64AnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int64AnimationUsingKeyFrames");
types[KnownTypes.Int64Converter] = InitType(assemblies[1], "System.ComponentModel", "Int64Converter");
types[KnownTypes.Int64KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int64KeyFrame");
types[KnownTypes.Int64KeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Int64KeyFrameCollection");
types[KnownTypes.Italic] = InitType(assemblies[4], "System.Windows.Documents", "Italic");
types[KnownTypes.ItemCollection] = InitType(assemblies[4], "System.Windows.Controls", "ItemCollection");
types[KnownTypes.ItemsControl] = InitType(assemblies[4], "System.Windows.Controls", "ItemsControl");
types[KnownTypes.ItemsPanelTemplate] = InitType(assemblies[4], "System.Windows.Controls", "ItemsPanelTemplate");
types[KnownTypes.ItemsPresenter] = InitType(assemblies[4], "System.Windows.Controls", "ItemsPresenter");
types[KnownTypes.JournalEntry] = InitType(assemblies[4], "System.Windows.Navigation", "JournalEntry");
types[KnownTypes.JournalEntryListConverter] = InitType(assemblies[4], "System.Windows.Navigation", "JournalEntryListConverter");
types[KnownTypes.JournalEntryUnifiedViewConverter] = InitType(assemblies[4], "System.Windows.Navigation", "JournalEntryUnifiedViewConverter");
types[KnownTypes.JpegBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "JpegBitmapDecoder");
types[KnownTypes.JpegBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "JpegBitmapEncoder");
types[KnownTypes.KeyBinding] = InitType(assemblies[3], "System.Windows.Input", "KeyBinding");
types[KnownTypes.KeyConverter] = InitType(assemblies[2], "System.Windows.Input", "KeyConverter");
types[KnownTypes.KeyGesture] = InitType(assemblies[3], "System.Windows.Input", "KeyGesture");
types[KnownTypes.KeyGestureConverter] = InitType(assemblies[3], "System.Windows.Input", "KeyGestureConverter");
types[KnownTypes.KeySpline] = InitType(assemblies[3], "System.Windows.Media.Animation", "KeySpline");
types[KnownTypes.KeySplineConverter] = InitType(assemblies[3], "System.Windows", "KeySplineConverter");
types[KnownTypes.KeyTime] = InitType(assemblies[3], "System.Windows.Media.Animation", "KeyTime");
types[KnownTypes.KeyTimeConverter] = InitType(assemblies[3], "System.Windows", "KeyTimeConverter");
types[KnownTypes.KeyboardDevice] = InitType(assemblies[3], "System.Windows.Input", "KeyboardDevice");
types[KnownTypes.Label] = InitType(assemblies[4], "System.Windows.Controls", "Label");
types[KnownTypes.LateBoundBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "LateBoundBitmapDecoder");
types[KnownTypes.LengthConverter] = InitType(assemblies[4], "System.Windows", "LengthConverter");
types[KnownTypes.Light] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Light");
types[KnownTypes.Line] = InitType(assemblies[4], "System.Windows.Shapes", "Line");
types[KnownTypes.LineBreak] = InitType(assemblies[4], "System.Windows.Documents", "LineBreak");
types[KnownTypes.LineGeometry] = InitType(assemblies[3], "System.Windows.Media", "LineGeometry");
types[KnownTypes.LineSegment] = InitType(assemblies[3], "System.Windows.Media", "LineSegment");
types[KnownTypes.LinearByteKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearByteKeyFrame");
types[KnownTypes.LinearColorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearColorKeyFrame");
types[KnownTypes.LinearDecimalKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearDecimalKeyFrame");
types[KnownTypes.LinearDoubleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearDoubleKeyFrame");
types[KnownTypes.LinearGradientBrush] = InitType(assemblies[3], "System.Windows.Media", "LinearGradientBrush");
types[KnownTypes.LinearInt16KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearInt16KeyFrame");
types[KnownTypes.LinearInt32KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearInt32KeyFrame");
types[KnownTypes.LinearInt64KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearInt64KeyFrame");
types[KnownTypes.LinearPoint3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearPoint3DKeyFrame");
types[KnownTypes.LinearPointKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearPointKeyFrame");
types[KnownTypes.LinearQuaternionKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearQuaternionKeyFrame");
types[KnownTypes.LinearRectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearRectKeyFrame");
types[KnownTypes.LinearRotation3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearRotation3DKeyFrame");
types[KnownTypes.LinearSingleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearSingleKeyFrame");
types[KnownTypes.LinearSizeKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearSizeKeyFrame");
types[KnownTypes.LinearThicknessKeyFrame] = InitType(assemblies[4], "System.Windows.Media.Animation", "LinearThicknessKeyFrame");
types[KnownTypes.LinearVector3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearVector3DKeyFrame");
types[KnownTypes.LinearVectorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "LinearVectorKeyFrame");
types[KnownTypes.List] = InitType(assemblies[4], "System.Windows.Documents", "List");
types[KnownTypes.ListBox] = InitType(assemblies[4], "System.Windows.Controls", "ListBox");
types[KnownTypes.ListBoxItem] = InitType(assemblies[4], "System.Windows.Controls", "ListBoxItem");
types[KnownTypes.ListCollectionView] = InitType(assemblies[4], "System.Windows.Data", "ListCollectionView");
types[KnownTypes.ListItem] = InitType(assemblies[4], "System.Windows.Documents", "ListItem");
types[KnownTypes.ListView] = InitType(assemblies[4], "System.Windows.Controls", "ListView");
types[KnownTypes.ListViewItem] = InitType(assemblies[4], "System.Windows.Controls", "ListViewItem");
types[KnownTypes.Localization] = InitType(assemblies[4], "System.Windows", "Localization");
types[KnownTypes.LostFocusEventManager] = InitType(assemblies[4], "System.Windows", "LostFocusEventManager");
types[KnownTypes.MarkupExtension] = InitType(assemblies[2], "System.Windows.Markup", "MarkupExtension");
types[KnownTypes.Material] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Material");
types[KnownTypes.MaterialCollection] = InitType(assemblies[3], "System.Windows.Media.Media3D", "MaterialCollection");
types[KnownTypes.MaterialGroup] = InitType(assemblies[3], "System.Windows.Media.Media3D", "MaterialGroup");
types[KnownTypes.Matrix] = InitType(assemblies[2], "System.Windows.Media", "Matrix");
types[KnownTypes.Matrix3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Matrix3D");
types[KnownTypes.Matrix3DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Matrix3DConverter");
types[KnownTypes.MatrixAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixAnimationBase");
types[KnownTypes.MatrixAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixAnimationUsingKeyFrames");
types[KnownTypes.MatrixAnimationUsingPath] = InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixAnimationUsingPath");
types[KnownTypes.MatrixCamera] = InitType(assemblies[3], "System.Windows.Media.Media3D", "MatrixCamera");
types[KnownTypes.MatrixConverter] = InitType(assemblies[2], "System.Windows.Media", "MatrixConverter");
types[KnownTypes.MatrixKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixKeyFrame");
types[KnownTypes.MatrixKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixKeyFrameCollection");
types[KnownTypes.MatrixTransform] = InitType(assemblies[3], "System.Windows.Media", "MatrixTransform");
types[KnownTypes.MatrixTransform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "MatrixTransform3D");
types[KnownTypes.MediaClock] = InitType(assemblies[3], "System.Windows.Media", "MediaClock");
types[KnownTypes.MediaElement] = InitType(assemblies[4], "System.Windows.Controls", "MediaElement");
types[KnownTypes.MediaPlayer] = InitType(assemblies[3], "System.Windows.Media", "MediaPlayer");
types[KnownTypes.MediaTimeline] = InitType(assemblies[3], "System.Windows.Media", "MediaTimeline");
types[KnownTypes.Menu] = InitType(assemblies[4], "System.Windows.Controls", "Menu");
types[KnownTypes.MenuBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "MenuBase");
types[KnownTypes.MenuItem] = InitType(assemblies[4], "System.Windows.Controls", "MenuItem");
types[KnownTypes.MenuScrollingVisibilityConverter] = InitType(assemblies[4], "System.Windows.Controls", "MenuScrollingVisibilityConverter");
types[KnownTypes.MeshGeometry3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "MeshGeometry3D");
types[KnownTypes.Model3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Model3D");
types[KnownTypes.Model3DCollection] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Model3DCollection");
types[KnownTypes.Model3DGroup] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Model3DGroup");
types[KnownTypes.ModelVisual3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "ModelVisual3D");
types[KnownTypes.ModifierKeysConverter] = InitType(assemblies[2], "System.Windows.Input", "ModifierKeysConverter");
types[KnownTypes.MouseActionConverter] = InitType(assemblies[3], "System.Windows.Input", "MouseActionConverter");
types[KnownTypes.MouseBinding] = InitType(assemblies[3], "System.Windows.Input", "MouseBinding");
types[KnownTypes.MouseDevice] = InitType(assemblies[3], "System.Windows.Input", "MouseDevice");
types[KnownTypes.MouseGesture] = InitType(assemblies[3], "System.Windows.Input", "MouseGesture");
types[KnownTypes.MouseGestureConverter] = InitType(assemblies[3], "System.Windows.Input", "MouseGestureConverter");
types[KnownTypes.MultiBinding] = InitType(assemblies[4], "System.Windows.Data", "MultiBinding");
types[KnownTypes.MultiBindingExpression] = InitType(assemblies[4], "System.Windows.Data", "MultiBindingExpression");
types[KnownTypes.MultiDataTrigger] = InitType(assemblies[4], "System.Windows", "MultiDataTrigger");
types[KnownTypes.MultiTrigger] = InitType(assemblies[4], "System.Windows", "MultiTrigger");
types[KnownTypes.NameScope] = InitType(assemblies[4], "System.Windows", "NameScope");
types[KnownTypes.NavigationWindow] = InitType(assemblies[4], "System.Windows.Navigation", "NavigationWindow");
types[KnownTypes.NullExtension] = InitType(assemblies[4], "System.Windows.Markup", "NullExtension");
types[KnownTypes.NullableBoolConverter] = InitType(assemblies[4], "System.Windows", "NullableBoolConverter");
types[KnownTypes.NullableConverter] = InitType(assemblies[1], "System.ComponentModel", "NullableConverter");
types[KnownTypes.NumberSubstitution] = InitType(assemblies[3], "System.Windows.Media", "NumberSubstitution");
types[KnownTypes.Object] = InitType(assemblies[0], "System", "Object");
types[KnownTypes.ObjectAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "ObjectAnimationBase");
types[KnownTypes.ObjectAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "ObjectAnimationUsingKeyFrames");
types[KnownTypes.ObjectDataProvider] = InitType(assemblies[4], "System.Windows.Data", "ObjectDataProvider");
types[KnownTypes.ObjectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "ObjectKeyFrame");
types[KnownTypes.ObjectKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "ObjectKeyFrameCollection");
types[KnownTypes.OrthographicCamera] = InitType(assemblies[3], "System.Windows.Media.Media3D", "OrthographicCamera");
types[KnownTypes.OuterGlowBitmapEffect] = InitType(assemblies[3], "System.Windows.Media.Effects", "OuterGlowBitmapEffect");
types[KnownTypes.Page] = InitType(assemblies[4], "System.Windows.Controls", "Page");
types[KnownTypes.PageContent] = InitType(assemblies[4], "System.Windows.Documents", "PageContent");
types[KnownTypes.PageFunctionBase] = InitType(assemblies[4], "System.Windows.Navigation", "PageFunctionBase");
types[KnownTypes.Panel] = InitType(assemblies[4], "System.Windows.Controls", "Panel");
types[KnownTypes.Paragraph] = InitType(assemblies[4], "System.Windows.Documents", "Paragraph");
types[KnownTypes.ParallelTimeline] = InitType(assemblies[3], "System.Windows.Media.Animation", "ParallelTimeline");
types[KnownTypes.ParserContext] = InitType(assemblies[4], "System.Windows.Markup", "ParserContext");
types[KnownTypes.PasswordBox] = InitType(assemblies[4], "System.Windows.Controls", "PasswordBox");
types[KnownTypes.Path] = InitType(assemblies[4], "System.Windows.Shapes", "Path");
types[KnownTypes.PathFigure] = InitType(assemblies[3], "System.Windows.Media", "PathFigure");
types[KnownTypes.PathFigureCollection] = InitType(assemblies[3], "System.Windows.Media", "PathFigureCollection");
types[KnownTypes.PathFigureCollectionConverter] = InitType(assemblies[3], "System.Windows.Media", "PathFigureCollectionConverter");
types[KnownTypes.PathGeometry] = InitType(assemblies[3], "System.Windows.Media", "PathGeometry");
types[KnownTypes.PathSegment] = InitType(assemblies[3], "System.Windows.Media", "PathSegment");
types[KnownTypes.PathSegmentCollection] = InitType(assemblies[3], "System.Windows.Media", "PathSegmentCollection");
types[KnownTypes.PauseStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "PauseStoryboard");
types[KnownTypes.Pen] = InitType(assemblies[3], "System.Windows.Media", "Pen");
types[KnownTypes.PerspectiveCamera] = InitType(assemblies[3], "System.Windows.Media.Media3D", "PerspectiveCamera");
types[KnownTypes.PixelFormat] = InitType(assemblies[3], "System.Windows.Media", "PixelFormat");
types[KnownTypes.PixelFormatConverter] = InitType(assemblies[3], "System.Windows.Media", "PixelFormatConverter");
types[KnownTypes.PngBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "PngBitmapDecoder");
types[KnownTypes.PngBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "PngBitmapEncoder");
types[KnownTypes.Point] = InitType(assemblies[2], "System.Windows", "Point");
types[KnownTypes.Point3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point3D");
types[KnownTypes.Point3DAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DAnimation");
types[KnownTypes.Point3DAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DAnimationBase");
types[KnownTypes.Point3DAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DAnimationUsingKeyFrames");
types[KnownTypes.Point3DCollection] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point3DCollection");
types[KnownTypes.Point3DCollectionConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point3DCollectionConverter");
types[KnownTypes.Point3DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point3DConverter");
types[KnownTypes.Point3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DKeyFrame");
types[KnownTypes.Point3DKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DKeyFrameCollection");
types[KnownTypes.Point4D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point4D");
types[KnownTypes.Point4DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Point4DConverter");
types[KnownTypes.PointAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointAnimation");
types[KnownTypes.PointAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointAnimationBase");
types[KnownTypes.PointAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointAnimationUsingKeyFrames");
types[KnownTypes.PointAnimationUsingPath] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointAnimationUsingPath");
types[KnownTypes.PointCollection] = InitType(assemblies[3], "System.Windows.Media", "PointCollection");
types[KnownTypes.PointCollectionConverter] = InitType(assemblies[3], "System.Windows.Media", "PointCollectionConverter");
types[KnownTypes.PointConverter] = InitType(assemblies[2], "System.Windows", "PointConverter");
types[KnownTypes.PointIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "PointIListConverter");
types[KnownTypes.PointKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointKeyFrame");
types[KnownTypes.PointKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "PointKeyFrameCollection");
types[KnownTypes.PointLight] = InitType(assemblies[3], "System.Windows.Media.Media3D", "PointLight");
types[KnownTypes.PointLightBase] = InitType(assemblies[3], "System.Windows.Media.Media3D", "PointLightBase");
types[KnownTypes.PolyBezierSegment] = InitType(assemblies[3], "System.Windows.Media", "PolyBezierSegment");
types[KnownTypes.PolyLineSegment] = InitType(assemblies[3], "System.Windows.Media", "PolyLineSegment");
types[KnownTypes.PolyQuadraticBezierSegment] = InitType(assemblies[3], "System.Windows.Media", "PolyQuadraticBezierSegment");
types[KnownTypes.Polygon] = InitType(assemblies[4], "System.Windows.Shapes", "Polygon");
types[KnownTypes.Polyline] = InitType(assemblies[4], "System.Windows.Shapes", "Polyline");
types[KnownTypes.Popup] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "Popup");
types[KnownTypes.PresentationSource] = InitType(assemblies[3], "System.Windows", "PresentationSource");
types[KnownTypes.PriorityBinding] = InitType(assemblies[4], "System.Windows.Data", "PriorityBinding");
types[KnownTypes.PriorityBindingExpression] = InitType(assemblies[4], "System.Windows.Data", "PriorityBindingExpression");
types[KnownTypes.ProgressBar] = InitType(assemblies[4], "System.Windows.Controls", "ProgressBar");
types[KnownTypes.ProjectionCamera] = InitType(assemblies[3], "System.Windows.Media.Media3D", "ProjectionCamera");
types[KnownTypes.PropertyPath] = InitType(assemblies[4], "System.Windows", "PropertyPath");
types[KnownTypes.PropertyPathConverter] = InitType(assemblies[4], "System.Windows", "PropertyPathConverter");
types[KnownTypes.QuadraticBezierSegment] = InitType(assemblies[3], "System.Windows.Media", "QuadraticBezierSegment");
types[KnownTypes.Quaternion] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Quaternion");
types[KnownTypes.QuaternionAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionAnimation");
types[KnownTypes.QuaternionAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionAnimationBase");
types[KnownTypes.QuaternionAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionAnimationUsingKeyFrames");
types[KnownTypes.QuaternionConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "QuaternionConverter");
types[KnownTypes.QuaternionKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionKeyFrame");
types[KnownTypes.QuaternionKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionKeyFrameCollection");
types[KnownTypes.QuaternionRotation3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "QuaternionRotation3D");
types[KnownTypes.RadialGradientBrush] = InitType(assemblies[3], "System.Windows.Media", "RadialGradientBrush");
types[KnownTypes.RadioButton] = InitType(assemblies[4], "System.Windows.Controls", "RadioButton");
types[KnownTypes.RangeBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "RangeBase");
types[KnownTypes.Rect] = InitType(assemblies[2], "System.Windows", "Rect");
types[KnownTypes.Rect3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Rect3D");
types[KnownTypes.Rect3DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Rect3DConverter");
types[KnownTypes.RectAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "RectAnimation");
types[KnownTypes.RectAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "RectAnimationBase");
types[KnownTypes.RectAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "RectAnimationUsingKeyFrames");
types[KnownTypes.RectConverter] = InitType(assemblies[2], "System.Windows", "RectConverter");
types[KnownTypes.RectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "RectKeyFrame");
types[KnownTypes.RectKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "RectKeyFrameCollection");
types[KnownTypes.Rectangle] = InitType(assemblies[4], "System.Windows.Shapes", "Rectangle");
types[KnownTypes.RectangleGeometry] = InitType(assemblies[3], "System.Windows.Media", "RectangleGeometry");
types[KnownTypes.RelativeSource] = InitType(assemblies[4], "System.Windows.Data", "RelativeSource");
types[KnownTypes.RemoveStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "RemoveStoryboard");
types[KnownTypes.RenderOptions] = InitType(assemblies[3], "System.Windows.Media", "RenderOptions");
types[KnownTypes.RenderTargetBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "RenderTargetBitmap");
types[KnownTypes.RepeatBehavior] = InitType(assemblies[3], "System.Windows.Media.Animation", "RepeatBehavior");
types[KnownTypes.RepeatBehaviorConverter] = InitType(assemblies[3], "System.Windows.Media.Animation", "RepeatBehaviorConverter");
types[KnownTypes.RepeatButton] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "RepeatButton");
types[KnownTypes.ResizeGrip] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ResizeGrip");
types[KnownTypes.ResourceDictionary] = InitType(assemblies[4], "System.Windows", "ResourceDictionary");
types[KnownTypes.ResourceKey] = InitType(assemblies[4], "System.Windows", "ResourceKey");
types[KnownTypes.ResumeStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "ResumeStoryboard");
types[KnownTypes.RichTextBox] = InitType(assemblies[4], "System.Windows.Controls", "RichTextBox");
types[KnownTypes.RotateTransform] = InitType(assemblies[3], "System.Windows.Media", "RotateTransform");
types[KnownTypes.RotateTransform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "RotateTransform3D");
types[KnownTypes.Rotation3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Rotation3D");
types[KnownTypes.Rotation3DAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DAnimation");
types[KnownTypes.Rotation3DAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DAnimationBase");
types[KnownTypes.Rotation3DAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DAnimationUsingKeyFrames");
types[KnownTypes.Rotation3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DKeyFrame");
types[KnownTypes.Rotation3DKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DKeyFrameCollection");
types[KnownTypes.RoutedCommand] = InitType(assemblies[3], "System.Windows.Input", "RoutedCommand");
types[KnownTypes.RoutedEvent] = InitType(assemblies[3], "System.Windows", "RoutedEvent");
types[KnownTypes.RoutedEventConverter] = InitType(assemblies[4], "System.Windows.Markup", "RoutedEventConverter");
types[KnownTypes.RoutedUICommand] = InitType(assemblies[3], "System.Windows.Input", "RoutedUICommand");
types[KnownTypes.RoutingStrategy] = InitType(assemblies[3], "System.Windows", "RoutingStrategy");
types[KnownTypes.RowDefinition] = InitType(assemblies[4], "System.Windows.Controls", "RowDefinition");
types[KnownTypes.Run] = InitType(assemblies[4], "System.Windows.Documents", "Run");
types[KnownTypes.RuntimeNamePropertyAttribute] = InitType(assemblies[2], "System.Windows.Markup", "RuntimeNamePropertyAttribute");
types[KnownTypes.SByte] = InitType(assemblies[0], "System", "SByte");
types[KnownTypes.SByteConverter] = InitType(assemblies[1], "System.ComponentModel", "SByteConverter");
types[KnownTypes.ScaleTransform] = InitType(assemblies[3], "System.Windows.Media", "ScaleTransform");
types[KnownTypes.ScaleTransform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "ScaleTransform3D");
types[KnownTypes.ScrollBar] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ScrollBar");
types[KnownTypes.ScrollContentPresenter] = InitType(assemblies[4], "System.Windows.Controls", "ScrollContentPresenter");
types[KnownTypes.ScrollViewer] = InitType(assemblies[4], "System.Windows.Controls", "ScrollViewer");
types[KnownTypes.Section] = InitType(assemblies[4], "System.Windows.Documents", "Section");
types[KnownTypes.SeekStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "SeekStoryboard");
types[KnownTypes.Selector] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "Selector");
types[KnownTypes.Separator] = InitType(assemblies[4], "System.Windows.Controls", "Separator");
types[KnownTypes.SetStoryboardSpeedRatio] = InitType(assemblies[4], "System.Windows.Media.Animation", "SetStoryboardSpeedRatio");
types[KnownTypes.Setter] = InitType(assemblies[4], "System.Windows", "Setter");
types[KnownTypes.SetterBase] = InitType(assemblies[4], "System.Windows", "SetterBase");
types[KnownTypes.Shape] = InitType(assemblies[4], "System.Windows.Shapes", "Shape");
types[KnownTypes.Single] = InitType(assemblies[0], "System", "Single");
types[KnownTypes.SingleAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "SingleAnimation");
types[KnownTypes.SingleAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "SingleAnimationBase");
types[KnownTypes.SingleAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "SingleAnimationUsingKeyFrames");
types[KnownTypes.SingleConverter] = InitType(assemblies[1], "System.ComponentModel", "SingleConverter");
types[KnownTypes.SingleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SingleKeyFrame");
types[KnownTypes.SingleKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "SingleKeyFrameCollection");
types[KnownTypes.Size] = InitType(assemblies[2], "System.Windows", "Size");
types[KnownTypes.Size3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Size3D");
types[KnownTypes.Size3DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Size3DConverter");
types[KnownTypes.SizeAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "SizeAnimation");
types[KnownTypes.SizeAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "SizeAnimationBase");
types[KnownTypes.SizeAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "SizeAnimationUsingKeyFrames");
types[KnownTypes.SizeConverter] = InitType(assemblies[2], "System.Windows", "SizeConverter");
types[KnownTypes.SizeKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SizeKeyFrame");
types[KnownTypes.SizeKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "SizeKeyFrameCollection");
types[KnownTypes.SkewTransform] = InitType(assemblies[3], "System.Windows.Media", "SkewTransform");
types[KnownTypes.SkipStoryboardToFill] = InitType(assemblies[4], "System.Windows.Media.Animation", "SkipStoryboardToFill");
types[KnownTypes.Slider] = InitType(assemblies[4], "System.Windows.Controls", "Slider");
types[KnownTypes.SolidColorBrush] = InitType(assemblies[3], "System.Windows.Media", "SolidColorBrush");
types[KnownTypes.SoundPlayerAction] = InitType(assemblies[4], "System.Windows.Controls", "SoundPlayerAction");
types[KnownTypes.Span] = InitType(assemblies[4], "System.Windows.Documents", "Span");
types[KnownTypes.SpecularMaterial] = InitType(assemblies[3], "System.Windows.Media.Media3D", "SpecularMaterial");
types[KnownTypes.SpellCheck] = InitType(assemblies[4], "System.Windows.Controls", "SpellCheck");
types[KnownTypes.SplineByteKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineByteKeyFrame");
types[KnownTypes.SplineColorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineColorKeyFrame");
types[KnownTypes.SplineDecimalKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineDecimalKeyFrame");
types[KnownTypes.SplineDoubleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineDoubleKeyFrame");
types[KnownTypes.SplineInt16KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineInt16KeyFrame");
types[KnownTypes.SplineInt32KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineInt32KeyFrame");
types[KnownTypes.SplineInt64KeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineInt64KeyFrame");
types[KnownTypes.SplinePoint3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplinePoint3DKeyFrame");
types[KnownTypes.SplinePointKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplinePointKeyFrame");
types[KnownTypes.SplineQuaternionKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineQuaternionKeyFrame");
types[KnownTypes.SplineRectKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineRectKeyFrame");
types[KnownTypes.SplineRotation3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineRotation3DKeyFrame");
types[KnownTypes.SplineSingleKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineSingleKeyFrame");
types[KnownTypes.SplineSizeKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineSizeKeyFrame");
types[KnownTypes.SplineThicknessKeyFrame] = InitType(assemblies[4], "System.Windows.Media.Animation", "SplineThicknessKeyFrame");
types[KnownTypes.SplineVector3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineVector3DKeyFrame");
types[KnownTypes.SplineVectorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "SplineVectorKeyFrame");
types[KnownTypes.SpotLight] = InitType(assemblies[3], "System.Windows.Media.Media3D", "SpotLight");
types[KnownTypes.StackPanel] = InitType(assemblies[4], "System.Windows.Controls", "StackPanel");
types[KnownTypes.StaticExtension] = InitType(assemblies[4], "System.Windows.Markup", "StaticExtension");
types[KnownTypes.StaticResourceExtension] = InitType(assemblies[4], "System.Windows", "StaticResourceExtension");
types[KnownTypes.StatusBar] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "StatusBar");
types[KnownTypes.StatusBarItem] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "StatusBarItem");
types[KnownTypes.StickyNoteControl] = InitType(assemblies[4], "System.Windows.Controls", "StickyNoteControl");
types[KnownTypes.StopStoryboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "StopStoryboard");
types[KnownTypes.Storyboard] = InitType(assemblies[4], "System.Windows.Media.Animation", "Storyboard");
types[KnownTypes.StreamGeometry] = InitType(assemblies[3], "System.Windows.Media", "StreamGeometry");
types[KnownTypes.StreamGeometryContext] = InitType(assemblies[3], "System.Windows.Media", "StreamGeometryContext");
types[KnownTypes.StreamResourceInfo] = InitType(assemblies[4], "System.Windows.Resources", "StreamResourceInfo");
types[KnownTypes.String] = InitType(assemblies[0], "System", "String");
types[KnownTypes.StringAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "StringAnimationBase");
types[KnownTypes.StringAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "StringAnimationUsingKeyFrames");
types[KnownTypes.StringConverter] = InitType(assemblies[1], "System.ComponentModel", "StringConverter");
types[KnownTypes.StringKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "StringKeyFrame");
types[KnownTypes.StringKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "StringKeyFrameCollection");
types[KnownTypes.StrokeCollection] = InitType(assemblies[3], "System.Windows.Ink", "StrokeCollection");
types[KnownTypes.StrokeCollectionConverter] = InitType(assemblies[3], "System.Windows", "StrokeCollectionConverter");
types[KnownTypes.Style] = InitType(assemblies[4], "System.Windows", "Style");
types[KnownTypes.Stylus] = InitType(assemblies[3], "System.Windows.Input", "Stylus");
types[KnownTypes.StylusDevice] = InitType(assemblies[3], "System.Windows.Input", "StylusDevice");
types[KnownTypes.TabControl] = InitType(assemblies[4], "System.Windows.Controls", "TabControl");
types[KnownTypes.TabItem] = InitType(assemblies[4], "System.Windows.Controls", "TabItem");
types[KnownTypes.TabPanel] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "TabPanel");
types[KnownTypes.Table] = InitType(assemblies[4], "System.Windows.Documents", "Table");
types[KnownTypes.TableCell] = InitType(assemblies[4], "System.Windows.Documents", "TableCell");
types[KnownTypes.TableColumn] = InitType(assemblies[4], "System.Windows.Documents", "TableColumn");
types[KnownTypes.TableRow] = InitType(assemblies[4], "System.Windows.Documents", "TableRow");
types[KnownTypes.TableRowGroup] = InitType(assemblies[4], "System.Windows.Documents", "TableRowGroup");
types[KnownTypes.TabletDevice] = InitType(assemblies[3], "System.Windows.Input", "TabletDevice");
types[KnownTypes.TemplateBindingExpression] = InitType(assemblies[4], "System.Windows", "TemplateBindingExpression");
types[KnownTypes.TemplateBindingExpressionConverter] = InitType(assemblies[4], "System.Windows", "TemplateBindingExpressionConverter");
types[KnownTypes.TemplateBindingExtension] = InitType(assemblies[4], "System.Windows", "TemplateBindingExtension");
types[KnownTypes.TemplateBindingExtensionConverter] = InitType(assemblies[4], "System.Windows", "TemplateBindingExtensionConverter");
types[KnownTypes.TemplateKey] = InitType(assemblies[4], "System.Windows", "TemplateKey");
types[KnownTypes.TemplateKeyConverter] = InitType(assemblies[4], "System.Windows.Markup", "TemplateKeyConverter");
types[KnownTypes.TextBlock] = InitType(assemblies[4], "System.Windows.Controls", "TextBlock");
types[KnownTypes.TextBox] = InitType(assemblies[4], "System.Windows.Controls", "TextBox");
types[KnownTypes.TextBoxBase] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "TextBoxBase");
types[KnownTypes.TextComposition] = InitType(assemblies[3], "System.Windows.Input", "TextComposition");
types[KnownTypes.TextCompositionManager] = InitType(assemblies[3], "System.Windows.Input", "TextCompositionManager");
types[KnownTypes.TextDecoration] = InitType(assemblies[3], "System.Windows", "TextDecoration");
types[KnownTypes.TextDecorationCollection] = InitType(assemblies[3], "System.Windows", "TextDecorationCollection");
types[KnownTypes.TextDecorationCollectionConverter] = InitType(assemblies[3], "System.Windows", "TextDecorationCollectionConverter");
types[KnownTypes.TextEffect] = InitType(assemblies[3], "System.Windows.Media", "TextEffect");
types[KnownTypes.TextEffectCollection] = InitType(assemblies[3], "System.Windows.Media", "TextEffectCollection");
types[KnownTypes.TextElement] = InitType(assemblies[4], "System.Windows.Documents", "TextElement");
types[KnownTypes.TextSearch] = InitType(assemblies[4], "System.Windows.Controls", "TextSearch");
types[KnownTypes.ThemeDictionaryExtension] = InitType(assemblies[4], "System.Windows", "ThemeDictionaryExtension");
types[KnownTypes.Thickness] = InitType(assemblies[4], "System.Windows", "Thickness");
types[KnownTypes.ThicknessAnimation] = InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessAnimation");
types[KnownTypes.ThicknessAnimationBase] = InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessAnimationBase");
types[KnownTypes.ThicknessAnimationUsingKeyFrames] = InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessAnimationUsingKeyFrames");
types[KnownTypes.ThicknessConverter] = InitType(assemblies[4], "System.Windows", "ThicknessConverter");
types[KnownTypes.ThicknessKeyFrame] = InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessKeyFrame");
types[KnownTypes.ThicknessKeyFrameCollection] = InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessKeyFrameCollection");
types[KnownTypes.Thumb] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "Thumb");
types[KnownTypes.TickBar] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "TickBar");
types[KnownTypes.TiffBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "TiffBitmapDecoder");
types[KnownTypes.TiffBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "TiffBitmapEncoder");
types[KnownTypes.TileBrush] = InitType(assemblies[3], "System.Windows.Media", "TileBrush");
types[KnownTypes.TimeSpan] = InitType(assemblies[0], "System", "TimeSpan");
types[KnownTypes.TimeSpanConverter] = InitType(assemblies[1], "System.ComponentModel", "TimeSpanConverter");
types[KnownTypes.Timeline] = InitType(assemblies[3], "System.Windows.Media.Animation", "Timeline");
types[KnownTypes.TimelineCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "TimelineCollection");
types[KnownTypes.TimelineGroup] = InitType(assemblies[3], "System.Windows.Media.Animation", "TimelineGroup");
types[KnownTypes.ToggleButton] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ToggleButton");
types[KnownTypes.ToolBar] = InitType(assemblies[4], "System.Windows.Controls", "ToolBar");
types[KnownTypes.ToolBarOverflowPanel] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ToolBarOverflowPanel");
types[KnownTypes.ToolBarPanel] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "ToolBarPanel");
types[KnownTypes.ToolBarTray] = InitType(assemblies[4], "System.Windows.Controls", "ToolBarTray");
types[KnownTypes.ToolTip] = InitType(assemblies[4], "System.Windows.Controls", "ToolTip");
types[KnownTypes.ToolTipService] = InitType(assemblies[4], "System.Windows.Controls", "ToolTipService");
types[KnownTypes.Track] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "Track");
types[KnownTypes.Transform] = InitType(assemblies[3], "System.Windows.Media", "Transform");
types[KnownTypes.Transform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Transform3D");
types[KnownTypes.Transform3DCollection] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Transform3DCollection");
types[KnownTypes.Transform3DGroup] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Transform3DGroup");
types[KnownTypes.TransformCollection] = InitType(assemblies[3], "System.Windows.Media", "TransformCollection");
types[KnownTypes.TransformConverter] = InitType(assemblies[3], "System.Windows.Media", "TransformConverter");
types[KnownTypes.TransformGroup] = InitType(assemblies[3], "System.Windows.Media", "TransformGroup");
types[KnownTypes.TransformedBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "TransformedBitmap");
types[KnownTypes.TranslateTransform] = InitType(assemblies[3], "System.Windows.Media", "TranslateTransform");
types[KnownTypes.TranslateTransform3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "TranslateTransform3D");
types[KnownTypes.TreeView] = InitType(assemblies[4], "System.Windows.Controls", "TreeView");
types[KnownTypes.TreeViewItem] = InitType(assemblies[4], "System.Windows.Controls", "TreeViewItem");
types[KnownTypes.Trigger] = InitType(assemblies[4], "System.Windows", "Trigger");
types[KnownTypes.TriggerAction] = InitType(assemblies[4], "System.Windows", "TriggerAction");
types[KnownTypes.TriggerBase] = InitType(assemblies[4], "System.Windows", "TriggerBase");
types[KnownTypes.TypeExtension] = InitType(assemblies[4], "System.Windows.Markup", "TypeExtension");
types[KnownTypes.TypeTypeConverter] = InitType(assemblies[2], "System.Windows.Markup", "TypeTypeConverter");
types[KnownTypes.Typography] = InitType(assemblies[4], "System.Windows.Documents", "Typography");
types[KnownTypes.UIElement] = InitType(assemblies[3], "System.Windows", "UIElement");
types[KnownTypes.UInt16] = InitType(assemblies[0], "System", "UInt16");
types[KnownTypes.UInt16Converter] = InitType(assemblies[1], "System.ComponentModel", "UInt16Converter");
types[KnownTypes.UInt32] = InitType(assemblies[0], "System", "UInt32");
types[KnownTypes.UInt32Converter] = InitType(assemblies[1], "System.ComponentModel", "UInt32Converter");
types[KnownTypes.UInt64] = InitType(assemblies[0], "System", "UInt64");
types[KnownTypes.UInt64Converter] = InitType(assemblies[1], "System.ComponentModel", "UInt64Converter");
types[KnownTypes.UShortIListConverter] = InitType(assemblies[3], "System.Windows.Media.Converters", "UShortIListConverter");
types[KnownTypes.Underline] = InitType(assemblies[4], "System.Windows.Documents", "Underline");
types[KnownTypes.UniformGrid] = InitType(assemblies[4], "System.Windows.Controls.Primitives", "UniformGrid");
types[KnownTypes.Uri] = InitType(assemblies[1], "System", "Uri");
types[KnownTypes.UriTypeConverter] = InitType(assemblies[1], "System", "UriTypeConverter");
types[KnownTypes.UserControl] = InitType(assemblies[4], "System.Windows.Controls", "UserControl");
types[KnownTypes.Validation] = InitType(assemblies[4], "System.Windows.Controls", "Validation");
types[KnownTypes.Vector] = InitType(assemblies[2], "System.Windows", "Vector");
types[KnownTypes.Vector3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Vector3D");
types[KnownTypes.Vector3DAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DAnimation");
types[KnownTypes.Vector3DAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DAnimationBase");
types[KnownTypes.Vector3DAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DAnimationUsingKeyFrames");
types[KnownTypes.Vector3DCollection] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Vector3DCollection");
types[KnownTypes.Vector3DCollectionConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Vector3DCollectionConverter");
types[KnownTypes.Vector3DConverter] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Vector3DConverter");
types[KnownTypes.Vector3DKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DKeyFrame");
types[KnownTypes.Vector3DKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DKeyFrameCollection");
types[KnownTypes.VectorAnimation] = InitType(assemblies[3], "System.Windows.Media.Animation", "VectorAnimation");
types[KnownTypes.VectorAnimationBase] = InitType(assemblies[3], "System.Windows.Media.Animation", "VectorAnimationBase");
types[KnownTypes.VectorAnimationUsingKeyFrames] = InitType(assemblies[3], "System.Windows.Media.Animation", "VectorAnimationUsingKeyFrames");
types[KnownTypes.VectorCollection] = InitType(assemblies[3], "System.Windows.Media", "VectorCollection");
types[KnownTypes.VectorCollectionConverter] = InitType(assemblies[3], "System.Windows.Media", "VectorCollectionConverter");
types[KnownTypes.VectorConverter] = InitType(assemblies[2], "System.Windows", "VectorConverter");
types[KnownTypes.VectorKeyFrame] = InitType(assemblies[3], "System.Windows.Media.Animation", "VectorKeyFrame");
types[KnownTypes.VectorKeyFrameCollection] = InitType(assemblies[3], "System.Windows.Media.Animation", "VectorKeyFrameCollection");
types[KnownTypes.VideoDrawing] = InitType(assemblies[3], "System.Windows.Media", "VideoDrawing");
types[KnownTypes.ViewBase] = InitType(assemblies[4], "System.Windows.Controls", "ViewBase");
types[KnownTypes.Viewbox] = InitType(assemblies[4], "System.Windows.Controls", "Viewbox");
types[KnownTypes.Viewport3D] = InitType(assemblies[4], "System.Windows.Controls", "Viewport3D");
types[KnownTypes.Viewport3DVisual] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Viewport3DVisual");
types[KnownTypes.VirtualizingPanel] = InitType(assemblies[4], "System.Windows.Controls", "VirtualizingPanel");
types[KnownTypes.VirtualizingStackPanel] = InitType(assemblies[4], "System.Windows.Controls", "VirtualizingStackPanel");
types[KnownTypes.Visual] = InitType(assemblies[3], "System.Windows.Media", "Visual");
types[KnownTypes.Visual3D] = InitType(assemblies[3], "System.Windows.Media.Media3D", "Visual3D");
types[KnownTypes.VisualBrush] = InitType(assemblies[3], "System.Windows.Media", "VisualBrush");
types[KnownTypes.VisualTarget] = InitType(assemblies[3], "System.Windows.Media", "VisualTarget");
types[KnownTypes.WeakEventManager] = InitType(assemblies[2], "System.Windows", "WeakEventManager");
types[KnownTypes.WhitespaceSignificantCollectionAttribute] = InitType(assemblies[2], "System.Windows.Markup", "WhitespaceSignificantCollectionAttribute");
types[KnownTypes.Window] = InitType(assemblies[4], "System.Windows", "Window");
types[KnownTypes.WmpBitmapDecoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "WmpBitmapDecoder");
types[KnownTypes.WmpBitmapEncoder] = InitType(assemblies[3], "System.Windows.Media.Imaging", "WmpBitmapEncoder");
types[KnownTypes.WrapPanel] = InitType(assemblies[4], "System.Windows.Controls", "WrapPanel");
types[KnownTypes.WriteableBitmap] = InitType(assemblies[3], "System.Windows.Media.Imaging", "WriteableBitmap");
types[KnownTypes.XamlBrushSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlBrushSerializer");
types[KnownTypes.XamlInt32CollectionSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlInt32CollectionSerializer");
types[KnownTypes.XamlPathDataSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlPathDataSerializer");
types[KnownTypes.XamlPoint3DCollectionSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlPoint3DCollectionSerializer");
types[KnownTypes.XamlPointCollectionSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlPointCollectionSerializer");
types[KnownTypes.XamlReader] = InitType(assemblies[4], "System.Windows.Markup", "XamlReader");
types[KnownTypes.XamlStyleSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlStyleSerializer");
types[KnownTypes.XamlTemplateSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlTemplateSerializer");
types[KnownTypes.XamlVector3DCollectionSerializer] = InitType(assemblies[4], "System.Windows.Markup", "XamlVector3DCollectionSerializer");
types[KnownTypes.XamlWriter] = InitType(assemblies[4], "System.Windows.Markup", "XamlWriter");
types[KnownTypes.XmlDataProvider] = InitType(assemblies[4], "System.Windows.Data", "XmlDataProvider");
types[KnownTypes.XmlLangPropertyAttribute] = InitType(assemblies[2], "System.Windows.Markup", "XmlLangPropertyAttribute");
types[KnownTypes.XmlLanguage] = InitType(assemblies[3], "System.Windows.Markup", "XmlLanguage");
types[KnownTypes.XmlLanguageConverter] = InitType(assemblies[3], "System.Windows.Markup", "XmlLanguageConverter");
types[KnownTypes.XmlNamespaceMapping] = InitType(assemblies[4], "System.Windows.Data", "XmlNamespaceMapping");
types[KnownTypes.ZoomPercentageConverter] = InitType(assemblies[4], "System.Windows.Documents", "ZoomPercentageConverter");
}
void InitMembers()
{
members[KnownMembers.AccessText_Text] = InitMember(KnownTypes.AccessText, "Text", InitType(assemblies[0], "System", "String"));
members[KnownMembers.BeginStoryboard_Storyboard] = InitMember(KnownTypes.BeginStoryboard, "Storyboard", InitType(assemblies[4], "System.Windows.Media.Animation", "Storyboard"));
members[KnownMembers.BitmapEffectGroup_Children] = InitMember(KnownTypes.BitmapEffectGroup, "Children", InitType(assemblies[3], "System.Windows.Media.Effects", "BitmapEffectCollection"));
members[KnownMembers.Border_Background] = InitMember(KnownTypes.Border, "Background", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Border_BorderBrush] = InitMember(KnownTypes.Border, "BorderBrush", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Border_BorderThickness] = InitMember(KnownTypes.Border, "BorderThickness", InitType(assemblies[4], "System.Windows", "Thickness"));
members[KnownMembers.ButtonBase_Command] = InitMember(KnownTypes.ButtonBase, "Command", InitType(assemblies[3], "System.Windows.Input", "ICommand"));
members[KnownMembers.ButtonBase_CommandParameter] = InitMember(KnownTypes.ButtonBase, "CommandParameter", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ButtonBase_CommandTarget] = InitMember(KnownTypes.ButtonBase, "CommandTarget", InitType(assemblies[3], "System.Windows", "IInputElement"));
members[KnownMembers.ButtonBase_IsPressed] = InitMember(KnownTypes.ButtonBase, "IsPressed", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.ColumnDefinition_MaxWidth] = InitMember(KnownTypes.ColumnDefinition, "MaxWidth", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.ColumnDefinition_MinWidth] = InitMember(KnownTypes.ColumnDefinition, "MinWidth", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.ColumnDefinition_Width] = InitMember(KnownTypes.ColumnDefinition, "Width", InitType(assemblies[4], "System.Windows", "GridLength"));
members[KnownMembers.ContentControl_Content] = InitMember(KnownTypes.ContentControl, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ContentControl_ContentTemplate] = InitMember(KnownTypes.ContentControl, "ContentTemplate", InitType(assemblies[4], "System.Windows", "DataTemplate"));
members[KnownMembers.ContentControl_ContentTemplateSelector] = InitMember(KnownTypes.ContentControl, "ContentTemplateSelector", InitType(assemblies[4], "System.Windows.Controls", "DataTemplateSelector"));
members[KnownMembers.ContentControl_HasContent] = InitMember(KnownTypes.ContentControl, "HasContent", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.ContentElement_Focusable] = InitMember(KnownTypes.ContentElement, "Focusable", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.ContentPresenter_Content] = InitMember(KnownTypes.ContentPresenter, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ContentPresenter_ContentSource] = InitMember(KnownTypes.ContentPresenter, "ContentSource", InitType(assemblies[0], "System", "String"));
members[KnownMembers.ContentPresenter_ContentTemplate] = InitMember(KnownTypes.ContentPresenter, "ContentTemplate", InitType(assemblies[4], "System.Windows", "DataTemplate"));
members[KnownMembers.ContentPresenter_ContentTemplateSelector] = InitMember(KnownTypes.ContentPresenter, "ContentTemplateSelector", InitType(assemblies[4], "System.Windows.Controls", "DataTemplateSelector"));
members[KnownMembers.ContentPresenter_RecognizesAccessKey] = InitMember(KnownTypes.ContentPresenter, "RecognizesAccessKey", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.Control_Background] = InitMember(KnownTypes.Control, "Background", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Control_BorderBrush] = InitMember(KnownTypes.Control, "BorderBrush", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Control_BorderThickness] = InitMember(KnownTypes.Control, "BorderThickness", InitType(assemblies[4], "System.Windows", "Thickness"));
members[KnownMembers.Control_FontFamily] = InitMember(KnownTypes.Control, "FontFamily", InitType(assemblies[3], "System.Windows.Media", "FontFamily"));
members[KnownMembers.Control_FontSize] = InitMember(KnownTypes.Control, "FontSize", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.Control_FontStretch] = InitMember(KnownTypes.Control, "FontStretch", InitType(assemblies[3], "System.Windows", "FontStretch"));
members[KnownMembers.Control_FontStyle] = InitMember(KnownTypes.Control, "FontStyle", InitType(assemblies[3], "System.Windows", "FontStyle"));
members[KnownMembers.Control_FontWeight] = InitMember(KnownTypes.Control, "FontWeight", InitType(assemblies[3], "System.Windows", "FontWeight"));
members[KnownMembers.Control_Foreground] = InitMember(KnownTypes.Control, "Foreground", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Control_HorizontalContentAlignment] = InitMember(KnownTypes.Control, "HorizontalContentAlignment", InitType(assemblies[4], "System.Windows", "HorizontalAlignment"));
members[KnownMembers.Control_IsTabStop] = InitMember(KnownTypes.Control, "IsTabStop", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.Control_Padding] = InitMember(KnownTypes.Control, "Padding", InitType(assemblies[4], "System.Windows", "Thickness"));
members[KnownMembers.Control_TabIndex] = InitMember(KnownTypes.Control, "TabIndex", InitType(assemblies[0], "System", "Int32"));
members[KnownMembers.Control_Template] = InitMember(KnownTypes.Control, "Template", InitType(assemblies[4], "System.Windows.Controls", "ControlTemplate"));
members[KnownMembers.Control_VerticalContentAlignment] = InitMember(KnownTypes.Control, "VerticalContentAlignment", InitType(assemblies[4], "System.Windows", "VerticalAlignment"));
members[KnownMembers.DockPanel_Dock] = InitMember(KnownTypes.DockPanel, "Dock", InitType(assemblies[4], "System.Windows.Controls", "Dock"));
members[KnownMembers.DockPanel_LastChildFill] = InitMember(KnownTypes.DockPanel, "LastChildFill", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.DocumentViewerBase_Document] = InitMember(KnownTypes.DocumentViewerBase, "Document", InitType(assemblies[3], "System.Windows.Documents", "IDocumentPaginatorSource"));
members[KnownMembers.DrawingGroup_Children] = InitMember(KnownTypes.DrawingGroup, "Children", InitType(assemblies[3], "System.Windows.Media", "DrawingCollection"));
members[KnownMembers.FlowDocumentReader_Document] = InitMember(KnownTypes.FlowDocumentReader, "Document", InitType(assemblies[4], "System.Windows.Documents", "FlowDocument"));
members[KnownMembers.FlowDocumentScrollViewer_Document] = InitMember(KnownTypes.FlowDocumentScrollViewer, "Document", InitType(assemblies[4], "System.Windows.Documents", "FlowDocument"));
members[KnownMembers.FrameworkContentElement_Style] = InitMember(KnownTypes.FrameworkContentElement, "Style", InitType(assemblies[4], "System.Windows", "Style"));
members[KnownMembers.FrameworkElement_FlowDirection] = InitMember(KnownTypes.FrameworkElement, "FlowDirection", InitType(assemblies[3], "System.Windows", "FlowDirection"));
members[KnownMembers.FrameworkElement_Height] = InitMember(KnownTypes.FrameworkElement, "Height", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.FrameworkElement_HorizontalAlignment] = InitMember(KnownTypes.FrameworkElement, "HorizontalAlignment", InitType(assemblies[4], "System.Windows", "HorizontalAlignment"));
members[KnownMembers.FrameworkElement_Margin] = InitMember(KnownTypes.FrameworkElement, "Margin", InitType(assemblies[4], "System.Windows", "Thickness"));
members[KnownMembers.FrameworkElement_MaxHeight] = InitMember(KnownTypes.FrameworkElement, "MaxHeight", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.FrameworkElement_MaxWidth] = InitMember(KnownTypes.FrameworkElement, "MaxWidth", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.FrameworkElement_MinHeight] = InitMember(KnownTypes.FrameworkElement, "MinHeight", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.FrameworkElement_MinWidth] = InitMember(KnownTypes.FrameworkElement, "MinWidth", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.FrameworkElement_Name] = InitMember(KnownTypes.FrameworkElement, "Name", InitType(assemblies[0], "System", "String"));
members[KnownMembers.FrameworkElement_Style] = InitMember(KnownTypes.FrameworkElement, "Style", InitType(assemblies[4], "System.Windows", "Style"));
members[KnownMembers.FrameworkElement_VerticalAlignment] = InitMember(KnownTypes.FrameworkElement, "VerticalAlignment", InitType(assemblies[4], "System.Windows", "VerticalAlignment"));
members[KnownMembers.FrameworkElement_Width] = InitMember(KnownTypes.FrameworkElement, "Width", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.GeneralTransformGroup_Children] = InitMember(KnownTypes.GeneralTransformGroup, "Children", InitType(assemblies[3], "System.Windows.Media", "GeneralTransformCollection"));
members[KnownMembers.GeometryGroup_Children] = InitMember(KnownTypes.GeometryGroup, "Children", InitType(assemblies[3], "System.Windows.Media", "GeometryCollection"));
members[KnownMembers.GradientBrush_GradientStops] = InitMember(KnownTypes.GradientBrush, "GradientStops", InitType(assemblies[3], "System.Windows.Media", "GradientStopCollection"));
members[KnownMembers.Grid_Column] = InitMember(KnownTypes.Grid, "Column", InitType(assemblies[0], "System", "Int32"));
members[KnownMembers.Grid_ColumnSpan] = InitMember(KnownTypes.Grid, "ColumnSpan", InitType(assemblies[0], "System", "Int32"));
members[KnownMembers.Grid_Row] = InitMember(KnownTypes.Grid, "Row", InitType(assemblies[0], "System", "Int32"));
members[KnownMembers.Grid_RowSpan] = InitMember(KnownTypes.Grid, "RowSpan", InitType(assemblies[0], "System", "Int32"));
members[KnownMembers.GridViewColumn_Header] = InitMember(KnownTypes.GridViewColumn, "Header", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.HeaderedContentControl_HasHeader] = InitMember(KnownTypes.HeaderedContentControl, "HasHeader", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.HeaderedContentControl_Header] = InitMember(KnownTypes.HeaderedContentControl, "Header", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.HeaderedContentControl_HeaderTemplate] = InitMember(KnownTypes.HeaderedContentControl, "HeaderTemplate", InitType(assemblies[4], "System.Windows", "DataTemplate"));
members[KnownMembers.HeaderedContentControl_HeaderTemplateSelector] = InitMember(KnownTypes.HeaderedContentControl, "HeaderTemplateSelector", InitType(assemblies[4], "System.Windows.Controls", "DataTemplateSelector"));
members[KnownMembers.HeaderedItemsControl_HasHeader] = InitMember(KnownTypes.HeaderedItemsControl, "HasHeader", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.HeaderedItemsControl_Header] = InitMember(KnownTypes.HeaderedItemsControl, "Header", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.HeaderedItemsControl_HeaderTemplate] = InitMember(KnownTypes.HeaderedItemsControl, "HeaderTemplate", InitType(assemblies[4], "System.Windows", "DataTemplate"));
members[KnownMembers.HeaderedItemsControl_HeaderTemplateSelector] = InitMember(KnownTypes.HeaderedItemsControl, "HeaderTemplateSelector", InitType(assemblies[4], "System.Windows.Controls", "DataTemplateSelector"));
members[KnownMembers.Hyperlink_NavigateUri] = InitMember(KnownTypes.Hyperlink, "NavigateUri", InitType(assemblies[1], "System", "Uri"));
members[KnownMembers.Image_Source] = InitMember(KnownTypes.Image, "Source", InitType(assemblies[3], "System.Windows.Media", "ImageSource"));
members[KnownMembers.Image_Stretch] = InitMember(KnownTypes.Image, "Stretch", InitType(assemblies[3], "System.Windows.Media", "Stretch"));
members[KnownMembers.ItemsControl_ItemContainerStyle] = InitMember(KnownTypes.ItemsControl, "ItemContainerStyle", InitType(assemblies[4], "System.Windows", "Style"));
members[KnownMembers.ItemsControl_ItemContainerStyleSelector] = InitMember(KnownTypes.ItemsControl, "ItemContainerStyleSelector", InitType(assemblies[4], "System.Windows.Controls", "StyleSelector"));
members[KnownMembers.ItemsControl_ItemTemplate] = InitMember(KnownTypes.ItemsControl, "ItemTemplate", InitType(assemblies[4], "System.Windows", "DataTemplate"));
members[KnownMembers.ItemsControl_ItemTemplateSelector] = InitMember(KnownTypes.ItemsControl, "ItemTemplateSelector", InitType(assemblies[4], "System.Windows.Controls", "DataTemplateSelector"));
members[KnownMembers.ItemsControl_ItemsPanel] = InitMember(KnownTypes.ItemsControl, "ItemsPanel", InitType(assemblies[4], "System.Windows.Controls", "ItemsPanelTemplate"));
members[KnownMembers.ItemsControl_ItemsSource] = InitMember(KnownTypes.ItemsControl, "ItemsSource", InitType(assemblies[0], "System.Collections", "IEnumerable"));
members[KnownMembers.MaterialGroup_Children] = InitMember(KnownTypes.MaterialGroup, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "MaterialCollection"));
members[KnownMembers.Model3DGroup_Children] = InitMember(KnownTypes.Model3DGroup, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "Model3DCollection"));
members[KnownMembers.Page_Content] = InitMember(KnownTypes.Page, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Panel_Background] = InitMember(KnownTypes.Panel, "Background", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Path_Data] = InitMember(KnownTypes.Path, "Data", InitType(assemblies[3], "System.Windows.Media", "Geometry"));
members[KnownMembers.PathFigure_Segments] = InitMember(KnownTypes.PathFigure, "Segments", InitType(assemblies[3], "System.Windows.Media", "PathSegmentCollection"));
members[KnownMembers.PathGeometry_Figures] = InitMember(KnownTypes.PathGeometry, "Figures", InitType(assemblies[3], "System.Windows.Media", "PathFigureCollection"));
members[KnownMembers.Popup_Child] = InitMember(KnownTypes.Popup, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.Popup_IsOpen] = InitMember(KnownTypes.Popup, "IsOpen", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.Popup_Placement] = InitMember(KnownTypes.Popup, "Placement", InitType(assemblies[4], "System.Windows.Controls.Primitives", "PlacementMode"));
members[KnownMembers.Popup_PopupAnimation] = InitMember(KnownTypes.Popup, "PopupAnimation", InitType(assemblies[4], "System.Windows.Controls.Primitives", "PopupAnimation"));
members[KnownMembers.RowDefinition_Height] = InitMember(KnownTypes.RowDefinition, "Height", InitType(assemblies[4], "System.Windows", "GridLength"));
members[KnownMembers.RowDefinition_MaxHeight] = InitMember(KnownTypes.RowDefinition, "MaxHeight", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.RowDefinition_MinHeight] = InitMember(KnownTypes.RowDefinition, "MinHeight", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.ScrollViewer_CanContentScroll] = InitMember(KnownTypes.ScrollViewer, "CanContentScroll", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.ScrollViewer_HorizontalScrollBarVisibility] = InitMember(KnownTypes.ScrollViewer, "HorizontalScrollBarVisibility", InitType(assemblies[4], "System.Windows.Controls", "ScrollBarVisibility"));
members[KnownMembers.ScrollViewer_VerticalScrollBarVisibility] = InitMember(KnownTypes.ScrollViewer, "VerticalScrollBarVisibility", InitType(assemblies[4], "System.Windows.Controls", "ScrollBarVisibility"));
members[KnownMembers.Shape_Fill] = InitMember(KnownTypes.Shape, "Fill", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Shape_Stroke] = InitMember(KnownTypes.Shape, "Stroke", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.Shape_StrokeThickness] = InitMember(KnownTypes.Shape, "StrokeThickness", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.TextBlock_Background] = InitMember(KnownTypes.TextBlock, "Background", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.TextBlock_FontFamily] = InitMember(KnownTypes.TextBlock, "FontFamily", InitType(assemblies[3], "System.Windows.Media", "FontFamily"));
members[KnownMembers.TextBlock_FontSize] = InitMember(KnownTypes.TextBlock, "FontSize", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.TextBlock_FontStretch] = InitMember(KnownTypes.TextBlock, "FontStretch", InitType(assemblies[3], "System.Windows", "FontStretch"));
members[KnownMembers.TextBlock_FontStyle] = InitMember(KnownTypes.TextBlock, "FontStyle", InitType(assemblies[3], "System.Windows", "FontStyle"));
members[KnownMembers.TextBlock_FontWeight] = InitMember(KnownTypes.TextBlock, "FontWeight", InitType(assemblies[3], "System.Windows", "FontWeight"));
members[KnownMembers.TextBlock_Foreground] = InitMember(KnownTypes.TextBlock, "Foreground", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.TextBlock_Text] = InitMember(KnownTypes.TextBlock, "Text", InitType(assemblies[0], "System", "String"));
members[KnownMembers.TextBlock_TextDecorations] = InitMember(KnownTypes.TextBlock, "TextDecorations", InitType(assemblies[3], "System.Windows", "TextDecorationCollection"));
members[KnownMembers.TextBlock_TextTrimming] = InitMember(KnownTypes.TextBlock, "TextTrimming", InitType(assemblies[3], "System.Windows", "TextTrimming"));
members[KnownMembers.TextBlock_TextWrapping] = InitMember(KnownTypes.TextBlock, "TextWrapping", InitType(assemblies[3], "System.Windows", "TextWrapping"));
members[KnownMembers.TextBox_Text] = InitMember(KnownTypes.TextBox, "Text", InitType(assemblies[0], "System", "String"));
members[KnownMembers.TextElement_Background] = InitMember(KnownTypes.TextElement, "Background", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.TextElement_FontFamily] = InitMember(KnownTypes.TextElement, "FontFamily", InitType(assemblies[3], "System.Windows.Media", "FontFamily"));
members[KnownMembers.TextElement_FontSize] = InitMember(KnownTypes.TextElement, "FontSize", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.TextElement_FontStretch] = InitMember(KnownTypes.TextElement, "FontStretch", InitType(assemblies[3], "System.Windows", "FontStretch"));
members[KnownMembers.TextElement_FontStyle] = InitMember(KnownTypes.TextElement, "FontStyle", InitType(assemblies[3], "System.Windows", "FontStyle"));
members[KnownMembers.TextElement_FontWeight] = InitMember(KnownTypes.TextElement, "FontWeight", InitType(assemblies[3], "System.Windows", "FontWeight"));
members[KnownMembers.TextElement_Foreground] = InitMember(KnownTypes.TextElement, "Foreground", InitType(assemblies[3], "System.Windows.Media", "Brush"));
members[KnownMembers.TimelineGroup_Children] = InitMember(KnownTypes.TimelineGroup, "Children", InitType(assemblies[3], "System.Windows.Media.Animation", "TimelineCollection"));
members[KnownMembers.Track_IsDirectionReversed] = InitMember(KnownTypes.Track, "IsDirectionReversed", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.Track_Maximum] = InitMember(KnownTypes.Track, "Maximum", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.Track_Minimum] = InitMember(KnownTypes.Track, "Minimum", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.Track_Orientation] = InitMember(KnownTypes.Track, "Orientation", InitType(assemblies[4], "System.Windows.Controls", "Orientation"));
members[KnownMembers.Track_Value] = InitMember(KnownTypes.Track, "Value", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.Track_ViewportSize] = InitMember(KnownTypes.Track, "ViewportSize", InitType(assemblies[0], "System", "Double"));
members[KnownMembers.Transform3DGroup_Children] = InitMember(KnownTypes.Transform3DGroup, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "Transform3DCollection"));
members[KnownMembers.TransformGroup_Children] = InitMember(KnownTypes.TransformGroup, "Children", InitType(assemblies[3], "System.Windows.Media", "TransformCollection"));
members[KnownMembers.UIElement_ClipToBounds] = InitMember(KnownTypes.UIElement, "ClipToBounds", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.UIElement_Focusable] = InitMember(KnownTypes.UIElement, "Focusable", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.UIElement_IsEnabled] = InitMember(KnownTypes.UIElement, "IsEnabled", InitType(assemblies[0], "System", "Boolean"));
members[KnownMembers.UIElement_RenderTransform] = InitMember(KnownTypes.UIElement, "RenderTransform", InitType(assemblies[3], "System.Windows.Media", "Transform"));
members[KnownMembers.UIElement_Visibility] = InitMember(KnownTypes.UIElement, "Visibility", InitType(assemblies[3], "System.Windows", "Visibility"));
members[KnownMembers.Viewport3D_Children] = InitMember(KnownTypes.Viewport3D, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "Visual3DCollection"));
members[KnownMembers.AdornedElementPlaceholder_Child] = InitMember(KnownTypes.AdornedElementPlaceholder, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.AdornerDecorator_Child] = InitMember(KnownTypes.AdornerDecorator, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.AnchoredBlock_Blocks] = InitMember(KnownTypes.AnchoredBlock, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.ArrayExtension_Items] = InitMember(KnownTypes.ArrayExtension, "Items", InitType(assemblies[0], "System.Collections", "IList"));
members[KnownMembers.BlockUIContainer_Child] = InitMember(KnownTypes.BlockUIContainer, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.Bold_Inlines] = InitMember(KnownTypes.Bold, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.BooleanAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.BooleanAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "BooleanKeyFrameCollection"));
members[KnownMembers.Border_Child] = InitMember(KnownTypes.Border, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.BulletDecorator_Child] = InitMember(KnownTypes.BulletDecorator, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.Button_Content] = InitMember(KnownTypes.Button, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ButtonBase_Content] = InitMember(KnownTypes.ButtonBase, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ByteAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.ByteAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "ByteKeyFrameCollection"));
members[KnownMembers.Canvas_Children] = InitMember(KnownTypes.Canvas, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.CharAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.CharAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "CharKeyFrameCollection"));
members[KnownMembers.CheckBox_Content] = InitMember(KnownTypes.CheckBox, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ColorAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.ColorAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "ColorKeyFrameCollection"));
members[KnownMembers.ComboBox_Items] = InitMember(KnownTypes.ComboBox, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ComboBoxItem_Content] = InitMember(KnownTypes.ComboBoxItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ContextMenu_Items] = InitMember(KnownTypes.ContextMenu, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ControlTemplate_VisualTree] = InitMember(KnownTypes.ControlTemplate, "VisualTree", InitType(assemblies[4], "System.Windows", "FrameworkElementFactory"));
members[KnownMembers.DataTemplate_VisualTree] = InitMember(KnownTypes.DataTemplate, "VisualTree", InitType(assemblies[4], "System.Windows", "FrameworkElementFactory"));
members[KnownMembers.DataTrigger_Setters] = InitMember(KnownTypes.DataTrigger, "Setters", InitType(assemblies[4], "System.Windows", "SetterBaseCollection"));
members[KnownMembers.DecimalAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.DecimalAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "DecimalKeyFrameCollection"));
members[KnownMembers.Decorator_Child] = InitMember(KnownTypes.Decorator, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.DockPanel_Children] = InitMember(KnownTypes.DockPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.DocumentViewer_Document] = InitMember(KnownTypes.DocumentViewer, "Document", InitType(assemblies[3], "System.Windows.Documents", "IDocumentPaginatorSource"));
members[KnownMembers.DoubleAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.DoubleAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "DoubleKeyFrameCollection"));
members[KnownMembers.EventTrigger_Actions] = InitMember(KnownTypes.EventTrigger, "Actions", InitType(assemblies[4], "System.Windows", "TriggerActionCollection"));
members[KnownMembers.Expander_Content] = InitMember(KnownTypes.Expander, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Figure_Blocks] = InitMember(KnownTypes.Figure, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.FixedDocument_Pages] = InitMember(KnownTypes.FixedDocument, "Pages", InitType(assemblies[4], "System.Windows.Documents", "PageContentCollection"));
members[KnownMembers.FixedDocumentSequence_References] = InitMember(KnownTypes.FixedDocumentSequence, "References", InitType(assemblies[4], "System.Windows.Documents", "DocumentReferenceCollection"));
members[KnownMembers.FixedPage_Children] = InitMember(KnownTypes.FixedPage, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.Floater_Blocks] = InitMember(KnownTypes.Floater, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.FlowDocument_Blocks] = InitMember(KnownTypes.FlowDocument, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.FlowDocumentPageViewer_Document] = InitMember(KnownTypes.FlowDocumentPageViewer, "Document", InitType(assemblies[3], "System.Windows.Documents", "IDocumentPaginatorSource"));
members[KnownMembers.FrameworkTemplate_VisualTree] = InitMember(KnownTypes.FrameworkTemplate, "VisualTree", InitType(assemblies[4], "System.Windows", "FrameworkElementFactory"));
members[KnownMembers.Grid_Children] = InitMember(KnownTypes.Grid, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.GridView_Columns] = InitMember(KnownTypes.GridView, "Columns", InitType(assemblies[4], "System.Windows.Controls", "GridViewColumnCollection"));
members[KnownMembers.GridViewColumnHeader_Content] = InitMember(KnownTypes.GridViewColumnHeader, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.GroupBox_Content] = InitMember(KnownTypes.GroupBox, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.GroupItem_Content] = InitMember(KnownTypes.GroupItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.HeaderedContentControl_Content] = InitMember(KnownTypes.HeaderedContentControl, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.HeaderedItemsControl_Items] = InitMember(KnownTypes.HeaderedItemsControl, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.HierarchicalDataTemplate_VisualTree] = InitMember(KnownTypes.HierarchicalDataTemplate, "VisualTree", InitType(assemblies[4], "System.Windows", "FrameworkElementFactory"));
members[KnownMembers.Hyperlink_Inlines] = InitMember(KnownTypes.Hyperlink, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.InkCanvas_Children] = InitMember(KnownTypes.InkCanvas, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.InkPresenter_Child] = InitMember(KnownTypes.InkPresenter, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.InlineUIContainer_Child] = InitMember(KnownTypes.InlineUIContainer, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.InputScopeName_NameValue] = InitMember(KnownTypes.InputScopeName, "NameValue", InitType(assemblies[3], "System.Windows.Input", "InputScopeNameValue"));
members[KnownMembers.Int16AnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Int16AnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Int16KeyFrameCollection"));
members[KnownMembers.Int32AnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Int32AnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Int32KeyFrameCollection"));
members[KnownMembers.Int64AnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Int64AnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Int64KeyFrameCollection"));
members[KnownMembers.Italic_Inlines] = InitMember(KnownTypes.Italic, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.ItemsControl_Items] = InitMember(KnownTypes.ItemsControl, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ItemsPanelTemplate_VisualTree] = InitMember(KnownTypes.ItemsPanelTemplate, "VisualTree", InitType(assemblies[4], "System.Windows", "FrameworkElementFactory"));
members[KnownMembers.Label_Content] = InitMember(KnownTypes.Label, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.LinearGradientBrush_GradientStops] = InitMember(KnownTypes.LinearGradientBrush, "GradientStops", InitType(assemblies[3], "System.Windows.Media", "GradientStopCollection"));
members[KnownMembers.List_ListItems] = InitMember(KnownTypes.List, "ListItems", InitType(assemblies[4], "System.Windows.Documents", "ListItemCollection"));
members[KnownMembers.ListBox_Items] = InitMember(KnownTypes.ListBox, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ListBoxItem_Content] = InitMember(KnownTypes.ListBoxItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ListItem_Blocks] = InitMember(KnownTypes.ListItem, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.ListView_Items] = InitMember(KnownTypes.ListView, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ListViewItem_Content] = InitMember(KnownTypes.ListViewItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.MatrixAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.MatrixAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "MatrixKeyFrameCollection"));
members[KnownMembers.Menu_Items] = InitMember(KnownTypes.Menu, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.MenuBase_Items] = InitMember(KnownTypes.MenuBase, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.MenuItem_Items] = InitMember(KnownTypes.MenuItem, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ModelVisual3D_Children] = InitMember(KnownTypes.ModelVisual3D, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "Visual3DCollection"));
members[KnownMembers.MultiBinding_Bindings] = InitMember(KnownTypes.MultiBinding, "Bindings", InitType(assemblies[0], "System.Collections.ObjectModel", "Collection`1"));
members[KnownMembers.MultiDataTrigger_Setters] = InitMember(KnownTypes.MultiDataTrigger, "Setters", InitType(assemblies[4], "System.Windows", "SetterBaseCollection"));
members[KnownMembers.MultiTrigger_Setters] = InitMember(KnownTypes.MultiTrigger, "Setters", InitType(assemblies[4], "System.Windows", "SetterBaseCollection"));
members[KnownMembers.ObjectAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.ObjectAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "ObjectKeyFrameCollection"));
members[KnownMembers.PageContent_Child] = InitMember(KnownTypes.PageContent, "Child", InitType(assemblies[4], "System.Windows.Documents", "FixedPage"));
members[KnownMembers.PageFunctionBase_Content] = InitMember(KnownTypes.PageFunctionBase, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Panel_Children] = InitMember(KnownTypes.Panel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.Paragraph_Inlines] = InitMember(KnownTypes.Paragraph, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.ParallelTimeline_Children] = InitMember(KnownTypes.ParallelTimeline, "Children", InitType(assemblies[3], "System.Windows.Media.Animation", "TimelineCollection"));
members[KnownMembers.Point3DAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Point3DAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Point3DKeyFrameCollection"));
members[KnownMembers.PointAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.PointAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "PointKeyFrameCollection"));
members[KnownMembers.PriorityBinding_Bindings] = InitMember(KnownTypes.PriorityBinding, "Bindings", InitType(assemblies[0], "System.Collections.ObjectModel", "Collection`1"));
members[KnownMembers.QuaternionAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.QuaternionAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "QuaternionKeyFrameCollection"));
members[KnownMembers.RadialGradientBrush_GradientStops] = InitMember(KnownTypes.RadialGradientBrush, "GradientStops", InitType(assemblies[3], "System.Windows.Media", "GradientStopCollection"));
members[KnownMembers.RadioButton_Content] = InitMember(KnownTypes.RadioButton, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.RectAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.RectAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "RectKeyFrameCollection"));
members[KnownMembers.RepeatButton_Content] = InitMember(KnownTypes.RepeatButton, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.RichTextBox_Document] = InitMember(KnownTypes.RichTextBox, "Document", InitType(assemblies[4], "System.Windows.Documents", "FlowDocument"));
members[KnownMembers.Rotation3DAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Rotation3DAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Rotation3DKeyFrameCollection"));
members[KnownMembers.Run_Text] = InitMember(KnownTypes.Run, "Text", InitType(assemblies[0], "System", "String"));
members[KnownMembers.ScrollViewer_Content] = InitMember(KnownTypes.ScrollViewer, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Section_Blocks] = InitMember(KnownTypes.Section, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.Selector_Items] = InitMember(KnownTypes.Selector, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.SingleAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.SingleAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "SingleKeyFrameCollection"));
members[KnownMembers.SizeAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.SizeAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "SizeKeyFrameCollection"));
members[KnownMembers.Span_Inlines] = InitMember(KnownTypes.Span, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.StackPanel_Children] = InitMember(KnownTypes.StackPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.StatusBar_Items] = InitMember(KnownTypes.StatusBar, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.StatusBarItem_Content] = InitMember(KnownTypes.StatusBarItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Storyboard_Children] = InitMember(KnownTypes.Storyboard, "Children", InitType(assemblies[3], "System.Windows.Media.Animation", "TimelineCollection"));
members[KnownMembers.StringAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.StringAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "StringKeyFrameCollection"));
members[KnownMembers.Style_Setters] = InitMember(KnownTypes.Style, "Setters", InitType(assemblies[4], "System.Windows", "SetterBaseCollection"));
members[KnownMembers.TabControl_Items] = InitMember(KnownTypes.TabControl, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.TabItem_Content] = InitMember(KnownTypes.TabItem, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.TabPanel_Children] = InitMember(KnownTypes.TabPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.Table_RowGroups] = InitMember(KnownTypes.Table, "RowGroups", InitType(assemblies[4], "System.Windows.Documents", "TableRowGroupCollection"));
members[KnownMembers.TableCell_Blocks] = InitMember(KnownTypes.TableCell, "Blocks", InitType(assemblies[4], "System.Windows.Documents", "BlockCollection"));
members[KnownMembers.TableRow_Cells] = InitMember(KnownTypes.TableRow, "Cells", InitType(assemblies[4], "System.Windows.Documents", "TableCellCollection"));
members[KnownMembers.TableRowGroup_Rows] = InitMember(KnownTypes.TableRowGroup, "Rows", InitType(assemblies[4], "System.Windows.Documents", "TableRowCollection"));
members[KnownMembers.TextBlock_Inlines] = InitMember(KnownTypes.TextBlock, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.ThicknessAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.ThicknessAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[4], "System.Windows.Media.Animation", "ThicknessKeyFrameCollection"));
members[KnownMembers.ToggleButton_Content] = InitMember(KnownTypes.ToggleButton, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.ToolBar_Items] = InitMember(KnownTypes.ToolBar, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.ToolBarOverflowPanel_Children] = InitMember(KnownTypes.ToolBarOverflowPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.ToolBarPanel_Children] = InitMember(KnownTypes.ToolBarPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.ToolBarTray_ToolBars] = InitMember(KnownTypes.ToolBarTray, "ToolBars", InitType(assemblies[0], "System.Collections.ObjectModel", "Collection`1"));
members[KnownMembers.ToolTip_Content] = InitMember(KnownTypes.ToolTip, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.TreeView_Items] = InitMember(KnownTypes.TreeView, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.TreeViewItem_Items] = InitMember(KnownTypes.TreeViewItem, "Items", InitType(assemblies[4], "System.Windows.Controls", "ItemCollection"));
members[KnownMembers.Trigger_Setters] = InitMember(KnownTypes.Trigger, "Setters", InitType(assemblies[4], "System.Windows", "SetterBaseCollection"));
members[KnownMembers.Underline_Inlines] = InitMember(KnownTypes.Underline, "Inlines", InitType(assemblies[4], "System.Windows.Documents", "InlineCollection"));
members[KnownMembers.UniformGrid_Children] = InitMember(KnownTypes.UniformGrid, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.UserControl_Content] = InitMember(KnownTypes.UserControl, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.Vector3DAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.Vector3DAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "Vector3DKeyFrameCollection"));
members[KnownMembers.VectorAnimationUsingKeyFrames_KeyFrames] = InitMember(KnownTypes.VectorAnimationUsingKeyFrames, "KeyFrames", InitType(assemblies[3], "System.Windows.Media.Animation", "VectorKeyFrameCollection"));
members[KnownMembers.Viewbox_Child] = InitMember(KnownTypes.Viewbox, "Child", InitType(assemblies[3], "System.Windows", "UIElement"));
members[KnownMembers.Viewport3DVisual_Children] = InitMember(KnownTypes.Viewport3DVisual, "Children", InitType(assemblies[3], "System.Windows.Media.Media3D", "Visual3DCollection"));
members[KnownMembers.VirtualizingPanel_Children] = InitMember(KnownTypes.VirtualizingPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.VirtualizingStackPanel_Children] = InitMember(KnownTypes.VirtualizingStackPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.Window_Content] = InitMember(KnownTypes.Window, "Content", InitType(assemblies[0], "System", "Object"));
members[KnownMembers.WrapPanel_Children] = InitMember(KnownTypes.WrapPanel, "Children", InitType(assemblies[4], "System.Windows.Controls", "UIElementCollection"));
members[KnownMembers.XmlDataProvider_XmlSerializer] = InitMember(KnownTypes.XmlDataProvider, "XmlSerializer", InitType(assemblies[5], "System.Xml.Serialization", "IXmlSerializable"));
}
void InitStrings()
{
strings[1] = "Name";
strings[2] = "Uid";
}
void InitResources()
{
resources[1] = ("SystemColors", "ActiveBorderBrushKey", "ActiveBorderBrush");
resources[2] = ("SystemColors", "ActiveCaptionBrushKey", "ActiveCaptionBrush");
resources[3] = ("SystemColors", "ActiveCaptionTextBrushKey", "ActiveCaptionTextBrush");
resources[4] = ("SystemColors", "AppWorkspaceBrushKey", "AppWorkspaceBrush");
resources[5] = ("SystemColors", "ControlBrushKey", "ControlBrush");
resources[6] = ("SystemColors", "ControlDarkBrushKey", "ControlDarkBrush");
resources[7] = ("SystemColors", "ControlDarkDarkBrushKey", "ControlDarkDarkBrush");
resources[8] = ("SystemColors", "ControlLightBrushKey", "ControlLightBrush");
resources[9] = ("SystemColors", "ControlLightLightBrushKey", "ControlLightLightBrush");
resources[10] = ("SystemColors", "ControlTextBrushKey", "ControlTextBrush");
resources[11] = ("SystemColors", "DesktopBrushKey", "DesktopBrush");
resources[12] = ("SystemColors", "GradientActiveCaptionBrushKey", "GradientActiveCaptionBrush");
resources[13] = ("SystemColors", "GradientInactiveCaptionBrushKey", "GradientInactiveCaptionBrush");
resources[14] = ("SystemColors", "GrayTextBrushKey", "GrayTextBrush");
resources[15] = ("SystemColors", "HighlightBrushKey", "HighlightBrush");
resources[16] = ("SystemColors", "HighlightTextBrushKey", "HighlightTextBrush");
resources[17] = ("SystemColors", "HotTrackBrushKey", "HotTrackBrush");
resources[18] = ("SystemColors", "InactiveBorderBrushKey", "InactiveBorderBrush");
resources[19] = ("SystemColors", "InactiveCaptionBrushKey", "InactiveCaptionBrush");
resources[20] = ("SystemColors", "InactiveCaptionTextBrushKey", "InactiveCaptionTextBrush");
resources[21] = ("SystemColors", "InfoBrushKey", "InfoBrush");
resources[22] = ("SystemColors", "InfoTextBrushKey", "InfoTextBrush");
resources[23] = ("SystemColors", "MenuBrushKey", "MenuBrush");
resources[24] = ("SystemColors", "MenuBarBrushKey", "MenuBarBrush");
resources[25] = ("SystemColors", "MenuHighlightBrushKey", "MenuHighlightBrush");
resources[26] = ("SystemColors", "MenuTextBrushKey", "MenuTextBrush");
resources[27] = ("SystemColors", "ScrollBarBrushKey", "ScrollBarBrush");
resources[28] = ("SystemColors", "WindowBrushKey", "WindowBrush");
resources[29] = ("SystemColors", "WindowFrameBrushKey", "WindowFrameBrush");
resources[30] = ("SystemColors", "WindowTextBrushKey", "WindowTextBrush");
resources[31] = ("SystemColors", "ActiveBorderColorKey", "ActiveBorderColor");
resources[32] = ("SystemColors", "ActiveCaptionColorKey", "ActiveCaptionColor");
resources[33] = ("SystemColors", "ActiveCaptionTextColorKey", "ActiveCaptionTextColor");
resources[34] = ("SystemColors", "AppWorkspaceColorKey", "AppWorkspaceColor");
resources[35] = ("SystemColors", "ControlColorKey", "ControlColor");
resources[36] = ("SystemColors", "ControlDarkColorKey", "ControlDarkColor");
resources[37] = ("SystemColors", "ControlDarkDarkColorKey", "ControlDarkDarkColor");
resources[38] = ("SystemColors", "ControlLightColorKey", "ControlLightColor");
resources[39] = ("SystemColors", "ControlLightLightColorKey", "ControlLightLightColor");
resources[40] = ("SystemColors", "ControlTextColorKey", "ControlTextColor");
resources[41] = ("SystemColors", "DesktopColorKey", "DesktopColor");
resources[42] = ("SystemColors", "GradientActiveCaptionColorKey", "GradientActiveCaptionColor");
resources[43] = ("SystemColors", "GradientInactiveCaptionColorKey", "GradientInactiveCaptionColor");
resources[44] = ("SystemColors", "GrayTextColorKey", "GrayTextColor");
resources[45] = ("SystemColors", "HighlightColorKey", "HighlightColor");
resources[46] = ("SystemColors", "HighlightTextColorKey", "HighlightTextColor");
resources[47] = ("SystemColors", "HotTrackColorKey", "HotTrackColor");
resources[48] = ("SystemColors", "InactiveBorderColorKey", "InactiveBorderColor");
resources[49] = ("SystemColors", "InactiveCaptionColorKey", "InactiveCaptionColor");
resources[50] = ("SystemColors", "InactiveCaptionTextColorKey", "InactiveCaptionTextColor");
resources[51] = ("SystemColors", "InfoColorKey", "InfoColor");
resources[52] = ("SystemColors", "InfoTextColorKey", "InfoTextColor");
resources[53] = ("SystemColors", "MenuColorKey", "MenuColor");
resources[54] = ("SystemColors", "MenuBarColorKey", "MenuBarColor");
resources[55] = ("SystemColors", "MenuHighlightColorKey", "MenuHighlightColor");
resources[56] = ("SystemColors", "MenuTextColorKey", "MenuTextColor");
resources[57] = ("SystemColors", "ScrollBarColorKey", "ScrollBarColor");
resources[58] = ("SystemColors", "WindowColorKey", "WindowColor");
resources[59] = ("SystemColors", "WindowFrameColorKey", "WindowFrameColor");
resources[60] = ("SystemColors", "WindowTextColorKey", "WindowTextColor");
resources[63] = ("SystemFonts", "CaptionFontSizeKey", "CaptionFontSize");
resources[64] = ("SystemFonts", "CaptionFontFamilyKey", "CaptionFontFamily");
resources[65] = ("SystemFonts", "CaptionFontStyleKey", "CaptionFontStyle");
resources[66] = ("SystemFonts", "CaptionFontWeightKey", "CaptionFontWeight");
resources[67] = ("SystemFonts", "CaptionFontTextDecorationsKey", "CaptionFontTextDecorations");
resources[68] = ("SystemFonts", "SmallCaptionFontSizeKey", "SmallCaptionFontSize");
resources[69] = ("SystemFonts", "SmallCaptionFontFamilyKey", "SmallCaptionFontFamily");
resources[70] = ("SystemFonts", "SmallCaptionFontStyleKey", "SmallCaptionFontStyle");
resources[71] = ("SystemFonts", "SmallCaptionFontWeightKey", "SmallCaptionFontWeight");
resources[72] = ("SystemFonts", "SmallCaptionFontTextDecorationsKey", "SmallCaptionFontTextDecorations");
resources[73] = ("SystemFonts", "MenuFontSizeKey", "MenuFontSize");
resources[74] = ("SystemFonts", "MenuFontFamilyKey", "MenuFontFamily");
resources[75] = ("SystemFonts", "MenuFontStyleKey", "MenuFontStyle");
resources[76] = ("SystemFonts", "MenuFontWeightKey", "MenuFontWeight");
resources[77] = ("SystemFonts", "MenuFontTextDecorationsKey", "MenuFontTextDecorations");
resources[78] = ("SystemFonts", "StatusFontSizeKey", "StatusFontSize");
resources[79] = ("SystemFonts", "StatusFontFamilyKey", "StatusFontFamily");
resources[80] = ("SystemFonts", "StatusFontStyleKey", "StatusFontStyle");
resources[81] = ("SystemFonts", "StatusFontWeightKey", "StatusFontWeight");
resources[82] = ("SystemFonts", "StatusFontTextDecorationsKey", "StatusFontTextDecorations");
resources[83] = ("SystemFonts", "MessageFontSizeKey", "MessageFontSize");
resources[84] = ("SystemFonts", "MessageFontFamilyKey", "MessageFontFamily");
resources[85] = ("SystemFonts", "MessageFontStyleKey", "MessageFontStyle");
resources[86] = ("SystemFonts", "MessageFontWeightKey", "MessageFontWeight");
resources[87] = ("SystemFonts", "MessageFontTextDecorationsKey", "MessageFontTextDecorations");
resources[88] = ("SystemFonts", "IconFontSizeKey", "IconFontSize");
resources[89] = ("SystemFonts", "IconFontFamilyKey", "IconFontFamily");
resources[90] = ("SystemFonts", "IconFontStyleKey", "IconFontStyle");
resources[91] = ("SystemFonts", "IconFontWeightKey", "IconFontWeight");
resources[92] = ("SystemFonts", "IconFontTextDecorationsKey", "IconFontTextDecorations");
resources[95] = ("SystemParameters", "ThinHorizontalBorderHeightKey", "ThinHorizontalBorderHeight");
resources[96] = ("SystemParameters", "ThinVerticalBorderWidthKey", "ThinVerticalBorderWidth");
resources[97] = ("SystemParameters", "CursorWidthKey", "CursorWidth");
resources[98] = ("SystemParameters", "CursorHeightKey", "CursorHeight");
resources[99] = ("SystemParameters", "ThickHorizontalBorderHeightKey", "ThickHorizontalBorderHeight");
resources[100] = ("SystemParameters", "ThickVerticalBorderWidthKey", "ThickVerticalBorderWidth");
resources[101] = ("SystemParameters", "FixedFrameHorizontalBorderHeightKey", "FixedFrameHorizontalBorderHeight");
resources[102] = ("SystemParameters", "FixedFrameVerticalBorderWidthKey", "FixedFrameVerticalBorderWidth");
resources[103] = ("SystemParameters", "FocusHorizontalBorderHeightKey", "FocusHorizontalBorderHeight");
resources[104] = ("SystemParameters", "FocusVerticalBorderWidthKey", "FocusVerticalBorderWidth");
resources[105] = ("SystemParameters", "FullPrimaryScreenWidthKey", "FullPrimaryScreenWidth");
resources[106] = ("SystemParameters", "FullPrimaryScreenHeightKey", "FullPrimaryScreenHeight");
resources[107] = ("SystemParameters", "HorizontalScrollBarButtonWidthKey", "HorizontalScrollBarButtonWidth");
resources[108] = ("SystemParameters", "HorizontalScrollBarHeightKey", "HorizontalScrollBarHeight");
resources[109] = ("SystemParameters", "HorizontalScrollBarThumbWidthKey", "HorizontalScrollBarThumbWidth");
resources[110] = ("SystemParameters", "IconWidthKey", "IconWidth");
resources[111] = ("SystemParameters", "IconHeightKey", "IconHeight");
resources[112] = ("SystemParameters", "IconGridWidthKey", "IconGridWidth");
resources[113] = ("SystemParameters", "IconGridHeightKey", "IconGridHeight");
resources[114] = ("SystemParameters", "MaximizedPrimaryScreenWidthKey", "MaximizedPrimaryScreenWidth");
resources[115] = ("SystemParameters", "MaximizedPrimaryScreenHeightKey", "MaximizedPrimaryScreenHeight");
resources[116] = ("SystemParameters", "MaximumWindowTrackWidthKey", "MaximumWindowTrackWidth");
resources[117] = ("SystemParameters", "MaximumWindowTrackHeightKey", "MaximumWindowTrackHeight");
resources[118] = ("SystemParameters", "MenuCheckmarkWidthKey", "MenuCheckmarkWidth");
resources[119] = ("SystemParameters", "MenuCheckmarkHeightKey", "MenuCheckmarkHeight");
resources[120] = ("SystemParameters", "MenuButtonWidthKey", "MenuButtonWidth");
resources[121] = ("SystemParameters", "MenuButtonHeightKey", "MenuButtonHeight");
resources[122] = ("SystemParameters", "MinimumWindowWidthKey", "MinimumWindowWidth");
resources[123] = ("SystemParameters", "MinimumWindowHeightKey", "MinimumWindowHeight");
resources[124] = ("SystemParameters", "MinimizedWindowWidthKey", "MinimizedWindowWidth");
resources[125] = ("SystemParameters", "MinimizedWindowHeightKey", "MinimizedWindowHeight");
resources[126] = ("SystemParameters", "MinimizedGridWidthKey", "MinimizedGridWidth");
resources[127] = ("SystemParameters", "MinimizedGridHeightKey", "MinimizedGridHeight");
resources[128] = ("SystemParameters", "MinimumWindowTrackWidthKey", "MinimumWindowTrackWidth");
resources[129] = ("SystemParameters", "MinimumWindowTrackHeightKey", "MinimumWindowTrackHeight");
resources[130] = ("SystemParameters", "PrimaryScreenWidthKey", "PrimaryScreenWidth");
resources[131] = ("SystemParameters", "PrimaryScreenHeightKey", "PrimaryScreenHeight");
resources[132] = ("SystemParameters", "WindowCaptionButtonWidthKey", "WindowCaptionButtonWidth");
resources[133] = ("SystemParameters", "WindowCaptionButtonHeightKey", "WindowCaptionButtonHeight");
resources[134] = ("SystemParameters", "ResizeFrameHorizontalBorderHeightKey", "ResizeFrameHorizontalBorderHeight");
resources[135] = ("SystemParameters", "ResizeFrameVerticalBorderWidthKey", "ResizeFrameVerticalBorderWidth");
resources[136] = ("SystemParameters", "SmallIconWidthKey", "SmallIconWidth");
resources[137] = ("SystemParameters", "SmallIconHeightKey", "SmallIconHeight");
resources[138] = ("SystemParameters", "SmallWindowCaptionButtonWidthKey", "SmallWindowCaptionButtonWidth");
resources[139] = ("SystemParameters", "SmallWindowCaptionButtonHeightKey", "SmallWindowCaptionButtonHeight");
resources[140] = ("SystemParameters", "VirtualScreenWidthKey", "VirtualScreenWidth");
resources[141] = ("SystemParameters", "VirtualScreenHeightKey", "VirtualScreenHeight");
resources[142] = ("SystemParameters", "VerticalScrollBarWidthKey", "VerticalScrollBarWidth");
resources[143] = ("SystemParameters", "VerticalScrollBarButtonHeightKey", "VerticalScrollBarButtonHeight");
resources[144] = ("SystemParameters", "WindowCaptionHeightKey", "WindowCaptionHeight");
resources[145] = ("SystemParameters", "KanjiWindowHeightKey", "KanjiWindowHeight");
resources[146] = ("SystemParameters", "MenuBarHeightKey", "MenuBarHeight");
resources[147] = ("SystemParameters", "SmallCaptionHeightKey", "SmallCaptionHeight");
resources[148] = ("SystemParameters", "VerticalScrollBarThumbHeightKey", "VerticalScrollBarThumbHeight");
resources[149] = ("SystemParameters", "IsImmEnabledKey", "IsImmEnabled");
resources[150] = ("SystemParameters", "IsMediaCenterKey", "IsMediaCenter");
resources[151] = ("SystemParameters", "IsMenuDropRightAlignedKey", "IsMenuDropRightAligned");
resources[152] = ("SystemParameters", "IsMiddleEastEnabledKey", "IsMiddleEastEnabled");
resources[153] = ("SystemParameters", "IsMousePresentKey", "IsMousePresent");
resources[154] = ("SystemParameters", "IsMouseWheelPresentKey", "IsMouseWheelPresent");
resources[155] = ("SystemParameters", "IsPenWindowsKey", "IsPenWindows");
resources[156] = ("SystemParameters", "IsRemotelyControlledKey", "IsRemotelyControlled");
resources[157] = ("SystemParameters", "IsRemoteSessionKey", "IsRemoteSession");
resources[158] = ("SystemParameters", "ShowSoundsKey", "ShowSounds");
resources[159] = ("SystemParameters", "IsSlowMachineKey", "IsSlowMachine");
resources[160] = ("SystemParameters", "SwapButtonsKey", "SwapButtons");
resources[161] = ("SystemParameters", "IsTabletPCKey", "IsTabletPC");
resources[162] = ("SystemParameters", "VirtualScreenLeftKey", "VirtualScreenLeft");
resources[163] = ("SystemParameters", "VirtualScreenTopKey", "VirtualScreenTop");
resources[164] = ("SystemParameters", "FocusBorderWidthKey", "FocusBorderWidth");
resources[165] = ("SystemParameters", "FocusBorderHeightKey", "FocusBorderHeight");
resources[166] = ("SystemParameters", "HighContrastKey", "HighContrast");
resources[167] = ("SystemParameters", "DropShadowKey", "DropShadow");
resources[168] = ("SystemParameters", "FlatMenuKey", "FlatMenu");
resources[169] = ("SystemParameters", "WorkAreaKey", "WorkArea");
resources[170] = ("SystemParameters", "IconHorizontalSpacingKey", "IconHorizontalSpacing");
resources[171] = ("SystemParameters", "IconVerticalSpacingKey", "IconVerticalSpacing");
resources[172] = ("SystemParameters", "IconTitleWrapKey", "IconTitleWrap");
resources[173] = ("SystemParameters", "KeyboardCuesKey", "KeyboardCues");
resources[174] = ("SystemParameters", "KeyboardDelayKey", "KeyboardDelay");
resources[175] = ("SystemParameters", "KeyboardPreferenceKey", "KeyboardPreference");
resources[176] = ("SystemParameters", "KeyboardSpeedKey", "KeyboardSpeed");
resources[177] = ("SystemParameters", "SnapToDefaultButtonKey", "SnapToDefaultButton");
resources[178] = ("SystemParameters", "WheelScrollLinesKey", "WheelScrollLines");
resources[179] = ("SystemParameters", "MouseHoverTimeKey", "MouseHoverTime");
resources[180] = ("SystemParameters", "MouseHoverHeightKey", "MouseHoverHeight");
resources[181] = ("SystemParameters", "MouseHoverWidthKey", "MouseHoverWidth");
resources[182] = ("SystemParameters", "MenuDropAlignmentKey", "MenuDropAlignment");
resources[183] = ("SystemParameters", "MenuFadeKey", "MenuFade");
resources[184] = ("SystemParameters", "MenuShowDelayKey", "MenuShowDelay");
resources[185] = ("SystemParameters", "ComboBoxAnimationKey", "ComboBoxAnimation");
resources[186] = ("SystemParameters", "ClientAreaAnimationKey", "ClientAreaAnimation");
resources[187] = ("SystemParameters", "CursorShadowKey", "CursorShadow");
resources[188] = ("SystemParameters", "GradientCaptionsKey", "GradientCaptions");
resources[189] = ("SystemParameters", "HotTrackingKey", "HotTracking");
resources[190] = ("SystemParameters", "ListBoxSmoothScrollingKey", "ListBoxSmoothScrolling");
resources[191] = ("SystemParameters", "MenuAnimationKey", "MenuAnimation");
resources[192] = ("SystemParameters", "SelectionFadeKey", "SelectionFade");
resources[193] = ("SystemParameters", "StylusHotTrackingKey", "StylusHotTracking");
resources[194] = ("SystemParameters", "ToolTipAnimationKey", "ToolTipAnimation");
resources[195] = ("SystemParameters", "ToolTipFadeKey", "ToolTipFade");
resources[196] = ("SystemParameters", "UIEffectsKey", "UIEffects");
resources[197] = ("SystemParameters", "MinimizeAnimationKey", "MinimizeAnimation");
resources[198] = ("SystemParameters", "BorderKey", "Border");
resources[199] = ("SystemParameters", "CaretWidthKey", "CaretWidth");
resources[200] = ("SystemParameters", "ForegroundFlashCountKey", "ForegroundFlashCount");
resources[201] = ("SystemParameters", "DragFullWindowsKey", "DragFullWindows");
resources[202] = ("SystemParameters", "BorderWidthKey", "BorderWidth");
resources[203] = ("SystemParameters", "ScrollWidthKey", "ScrollWidth");
resources[204] = ("SystemParameters", "ScrollHeightKey", "ScrollHeight");
resources[205] = ("SystemParameters", "CaptionWidthKey", "CaptionWidth");
resources[206] = ("SystemParameters", "CaptionHeightKey", "CaptionHeight");
resources[207] = ("SystemParameters", "SmallCaptionWidthKey", "SmallCaptionWidth");
resources[208] = ("SystemParameters", "MenuWidthKey", "MenuWidth");
resources[209] = ("SystemParameters", "MenuHeightKey", "MenuHeight");
resources[210] = ("SystemParameters", "ComboBoxPopupAnimationKey", "ComboBoxPopupAnimation");
resources[211] = ("SystemParameters", "MenuPopupAnimationKey", "MenuPopupAnimation");
resources[212] = ("SystemParameters", "ToolTipPopupAnimationKey", "ToolTipPopupAnimation");
resources[213] = ("SystemParameters", "PowerLineStatusKey", "PowerLineStatus");
resources[215] = ("SystemParameters", "FocusVisualStyleKey", "FocusVisualStyle");
resources[216] = ("SystemParameters", "NavigationChromeDownLevelStyleKey", "NavigationChromeDownLevelStyle");
resources[217] = ("SystemParameters", "NavigationChromeStyleKey", "NavigationChromeStyle");
resources[219] = ("MenuItem", "SeparatorStyleKey", "MenuItemSeparatorStyle");
resources[220] = ("GridView", "GridViewScrollViewerStyleKey", "GridViewScrollViewerStyle");
resources[221] = ("GridView", "GridViewStyleKey", "GridViewStyle");
resources[222] = ("GridView", "GridViewItemContainerStyleKey", "GridViewItemContainerStyle");
resources[223] = ("StatusBar", "SeparatorStyleKey", "StatusBarSeparatorStyle");
resources[224] = ("ToolBar", "ButtonStyleKey", "ToolBarButtonStyle");
resources[225] = ("ToolBar", "ToggleButtonStyleKey", "ToolBarToggleButtonStyle");
resources[226] = ("ToolBar", "SeparatorStyleKey", "ToolBarSeparatorStyle");
resources[227] = ("ToolBar", "CheckBoxStyleKey", "ToolBarCheckBoxStyle");
resources[228] = ("ToolBar", "RadioButtonStyleKey", "ToolBarRadioButtonStyle");
resources[229] = ("ToolBar", "ComboBoxStyleKey", "ToolBarComboBoxStyle");
resources[230] = ("ToolBar", "TextBoxStyleKey", "ToolBarTextBoxStyle");
resources[231] = ("ToolBar", "MenuStyleKey", "ToolBarMenuStyle");
resources[234] = ("SystemColors", "InactiveSelectionHighlightBrushKey", "InactiveSelectionHighlightBrush");
resources[235] = ("SystemColors", "InactiveSelectionHighlightTextBrushKey", "InactiveSelectionHighlightTextBrush");
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/KnownThings.gen.cs
================================================
/*
Copyright (c) 2015 Ki
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.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
namespace Test {
internal class Program {
static T GetMember(Func func, string name) =>
func(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
static Assembly GetDeclAssembly(Type type) {
if (type.IsDefined(typeof(TypeForwardedFromAttribute), false)) {
var attr = (TypeForwardedFromAttribute)type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), false)[0];
return Assembly.Load(attr.AssemblyFullName);
}
return type.Assembly;
}
static void Main(string[] args) {
var asmName = "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
var assembly = Assembly.Load(asmName);
var ctx = assembly.GetType("System.Windows.Baml2006.WpfSharedBamlSchemaContext");
var instance = Activator.CreateInstance(ctx);
var assemblies = ExtractAssemblies(ctx, instance);
var types = ExtractTypes(ctx, instance);
var members = ExtractMembers(ctx, instance);
var strings = ExtractStrings(ctx, instance);
var resources = ExtractResources(assembly);
var code = new StringBuilder();
foreach (var type in types) {
if (type == null)
continue;
if (!assemblies.Contains(GetDeclAssembly(type)))
assemblies.Add(GetDeclAssembly(type));
}
foreach (var member in members) {
if (member == null)
continue;
if (!assemblies.Contains(GetDeclAssembly(member.Item3)))
assemblies.Add(GetDeclAssembly(member.Item3));
}
code.AppendLine("\tinternal enum KnownTypes : short {");
code.AppendLine("\t\tUnknown = 0,");
for (int i = 1; i < types.Count; i++) {
if (types[i] == null) {
code.AppendLine();
continue;
}
var line = "\t\t{0} = {1},";
code.AppendLine(string.Format(line, types[i].Name, i));
}
code.AppendLine("\t}").AppendLine();
code.AppendLine("\tinternal enum KnownMembers : short {");
code.AppendLine("\t\tUnknown = 0,");
for (int i = 1; i < members.Count; i++) {
if (members[i] == null) {
code.AppendLine();
continue;
}
var line = "\t\t{0}_{1} = {2},";
code.AppendLine(string.Format(line, members[i].Item1.Name, members[i].Item2, i));
}
code.AppendLine("\t}").AppendLine();
code.AppendLine("\t\tvoid InitAssemblies() {");
for (int i = 0; i < assemblies.Count; i++) {
var line = "\t\t\tassemblies[{0}] = ResolveAssembly(\"{1}\");";
code.AppendLine(string.Format(line, i, assemblies[i]));
}
code.AppendLine("\t\t}").AppendLine();
code.AppendLine("\t\tvoid InitTypes() {");
for (int i = 0; i < types.Count; i++) {
var type = types[i];
if (type == null) {
code.AppendLine();
continue;
}
var line = "\t\t\ttypes[KnownTypes.{0}] = InitType(assemblies[{1}], \"{2}\", \"{3}\");";
code.AppendLine(string.Format(line, new object[] {
type.Name,
assemblies.IndexOf(GetDeclAssembly(type)),
type.Namespace,
type.Name
}));
}
code.AppendLine("\t\t}").AppendLine();
code.AppendLine("\t\tvoid InitMembers() {");
for (int i = 0; i < members.Count; i++) {
var member = members[i];
if (member == null) {
code.AppendLine();
continue;
}
var line = "\t\t\tmembers[KnownMembers.{0}_{1}] = InitMember(KnownTypes.{0}, \"{1}\", InitType(assemblies[{2}], \"{3}\", \"{4}\"));";
code.AppendLine(string.Format(line, new object[] {
member.Item1.Name,
member.Item2,
assemblies.IndexOf(GetDeclAssembly(member.Item3)),
member.Item3.Namespace,
member.Item3.Name
}));
}
code.AppendLine("\t\t}").AppendLine();
code.AppendLine("\t\tvoid InitStrings() {");
for (int i = 0; i < strings.Count; i++) {
if (strings[i] == null)
continue;
var line = "\t\t\tstrings[{0}] = \"{1}\";";
code.AppendLine(string.Format(line, i, strings[i]));
}
code.AppendLine("\t\t}").AppendLine();
code.AppendLine("\t\tvoid InitResources() {");
for (int i = 0; i < resources.Count; i++) {
if (resources[i] == null) {
code.AppendLine();
continue;
}
var res = resources[i];
var line = "\t\t\tresources[{0}] = (\"{1}\", \"{2}\", \"{3}\");";
code.AppendLine(string.Format(line, i, res.Item1.Name, res.Item2, res.Item3));
}
code.AppendLine("\t\t}").AppendLine();
Console.WriteLine(code);
}
static List ExtractAssemblies(Type ctx, object instance) {
var getAssembly = GetMember(ctx.GetMethod, "GetKnownBamlAssembly");
var assemblies = (Array)GetMember(ctx.GetField, "_knownBamlAssemblies").GetValue(instance);
var bamlAssembly = ctx.Assembly.GetType("System.Windows.Baml2006.Baml6Assembly");
var property = GetMember(bamlAssembly.GetProperty, "Assembly");
var extract = new List();
for (int i = 0; i < assemblies.Length; i++) {
try {
var asm = getAssembly.Invoke(instance, new object[] { (short)(-i) });
var asmValue = (Assembly)property.GetValue(asm, null);
extract.Add(asmValue);
}
catch {
extract.Add(null);
}
}
return extract;
}
static List ExtractTypes(Type ctx, object instance) {
var getType = GetMember(ctx.GetMethod, "GetKnownBamlType");
var types = (Array)GetMember(ctx.GetField, "_knownBamlTypes").GetValue(instance);
var bamlType = ctx.Assembly.GetType("System.Windows.Baml2006.WpfKnownType");
var field = GetMember(bamlType.GetField, "_underlyingType");
var extract = new List() { null };
for (int i = 1; i < types.Length; i++) {
try {
var type = getType.Invoke(instance, new object[] { (short)(-i) });
var typeValue = (Type)field.GetValue(type);
extract.Add(typeValue);
}
catch {
extract.Add(null);
}
}
return extract;
}
static List> ExtractMembers(Type ctx, object instance) {
var getMember = GetMember(ctx.GetMethod, "GetKnownBamlMember");
var members = (Array)GetMember(ctx.GetField, "_knownBamlMembers").GetValue(instance);
var bamlMember = ctx.Assembly.GetType("System.Windows.Baml2006.WpfKnownMember");
var propertyName = GetMember(bamlMember.GetProperty, "Name");
var propertyType = GetMember(bamlMember.GetProperty, "Type");
var bamlType = ctx.Assembly.GetType("System.Windows.Baml2006.WpfKnownType");
var propertyUnderlyType = GetMember(bamlType.GetProperty, "UnderlyingType");
var mapTable = ctx.Assembly.GetType("System.Windows.Markup.BamlMapTable");
var getAttrRecord = mapTable.GetMethod("GetAttributeInfoFromId", BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(short) }, null);
var getAttrOwner = GetMember(mapTable.GetMethod, "GetAttributeOwnerType");
var tbl = mapTable.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0].Invoke(new object[] { null });
var extract = new List>() { null };
for (int i = 1; i < members.Length; i++) {
try {
var member = getMember.Invoke(instance, new object[] { (short)(-i) });
var name = (string)propertyName.GetValue(member, null);
var type = (Type)propertyUnderlyType.GetValue(propertyType.GetValue(member, null), null);
var declType = (Type)getAttrOwner.Invoke(tbl, new object[] { getAttrRecord.Invoke(tbl, new object[] { (short)(-i) }) });
extract.Add(Tuple.Create(declType, name, type));
}
catch {
extract.Add(null);
}
}
return extract;
}
static List ExtractStrings(Type ctx, object instance) {
var getString = GetMember(ctx.GetMethod, "GetKnownBamlString");
var extract = new List();
for (int i = 0; i < 10; i++) {
try {
var str = (string)getString.Invoke(instance, new object[] { (short)(-i) });
extract.Add(str);
}
catch {
extract.Add(null);
}
}
return extract;
}
static List> ExtractResources(Assembly asm) {
var resIdType = asm.GetType("System.Windows.SystemResourceKeyID");
var cvrtType = asm.GetType("System.Windows.Markup.SystemKeyConverter");
var getSysType = GetMember(cvrtType.GetMethod, "GetSystemClassType");
var getSysKeyName = GetMember(cvrtType.GetMethod, "GetSystemKeyName");
var getSysPropertyName = GetMember(cvrtType.GetMethod, "GetSystemPropertyName");
var values = Enum.GetValues(resIdType);
var extract = new List>();
for (int i = 0; i < values.Length; i++) {
var value = values.GetValue(i);
if (Enum.GetName(resIdType, value).StartsWith("Internal")) {
extract.Add(null);
continue;
}
var type = (Type)getSysType.Invoke(null, new object[] { value });
var keyName = (string)getSysKeyName.Invoke(null, new object[] { value });
var propName = (string)getSysPropertyName.Invoke(null, new object[] { value });
extract.Add(Tuple.Create(type, keyName, propName));
}
return extract;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Baml/KnownTypes.cs
================================================
/*
Copyright (c) 2015 Ki
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.
*/
namespace ICSharpCode.BamlDecompiler.Baml
{
// Auto generated. Do not modify.
internal enum KnownTypes : short
{
Unknown = 0,
AccessText = 1,
AdornedElementPlaceholder = 2,
Adorner = 3,
AdornerDecorator = 4,
AdornerLayer = 5,
AffineTransform3D = 6,
AmbientLight = 7,
AnchoredBlock = 8,
Animatable = 9,
AnimationClock = 10,
AnimationTimeline = 11,
Application = 12,
ArcSegment = 13,
ArrayExtension = 14,
AxisAngleRotation3D = 15,
BaseIListConverter = 16,
BeginStoryboard = 17,
BevelBitmapEffect = 18,
BezierSegment = 19,
Binding = 20,
BindingBase = 21,
BindingExpression = 22,
BindingExpressionBase = 23,
BindingListCollectionView = 24,
BitmapDecoder = 25,
BitmapEffect = 26,
BitmapEffectCollection = 27,
BitmapEffectGroup = 28,
BitmapEffectInput = 29,
BitmapEncoder = 30,
BitmapFrame = 31,
BitmapImage = 32,
BitmapMetadata = 33,
BitmapPalette = 34,
BitmapSource = 35,
Block = 36,
BlockUIContainer = 37,
BlurBitmapEffect = 38,
BmpBitmapDecoder = 39,
BmpBitmapEncoder = 40,
Bold = 41,
BoolIListConverter = 42,
Boolean = 43,
BooleanAnimationBase = 44,
BooleanAnimationUsingKeyFrames = 45,
BooleanConverter = 46,
BooleanKeyFrame = 47,
BooleanKeyFrameCollection = 48,
BooleanToVisibilityConverter = 49,
Border = 50,
BorderGapMaskConverter = 51,
Brush = 52,
BrushConverter = 53,
BulletDecorator = 54,
Button = 55,
ButtonBase = 56,
Byte = 57,
ByteAnimation = 58,
ByteAnimationBase = 59,
ByteAnimationUsingKeyFrames = 60,
ByteConverter = 61,
ByteKeyFrame = 62,
ByteKeyFrameCollection = 63,
CachedBitmap = 64,
Camera = 65,
Canvas = 66,
Char = 67,
CharAnimationBase = 68,
CharAnimationUsingKeyFrames = 69,
CharConverter = 70,
CharIListConverter = 71,
CharKeyFrame = 72,
CharKeyFrameCollection = 73,
CheckBox = 74,
Clock = 75,
ClockController = 76,
ClockGroup = 77,
CollectionContainer = 78,
CollectionView = 79,
CollectionViewSource = 80,
Color = 81,
ColorAnimation = 82,
ColorAnimationBase = 83,
ColorAnimationUsingKeyFrames = 84,
ColorConvertedBitmap = 85,
ColorConvertedBitmapExtension = 86,
ColorConverter = 87,
ColorKeyFrame = 88,
ColorKeyFrameCollection = 89,
ColumnDefinition = 90,
CombinedGeometry = 91,
ComboBox = 92,
ComboBoxItem = 93,
CommandConverter = 94,
ComponentResourceKey = 95,
ComponentResourceKeyConverter = 96,
CompositionTarget = 97,
Condition = 98,
ContainerVisual = 99,
ContentControl = 100,
ContentElement = 101,
ContentPresenter = 102,
ContentPropertyAttribute = 103,
ContentWrapperAttribute = 104,
ContextMenu = 105,
ContextMenuService = 106,
Control = 107,
ControlTemplate = 108,
ControllableStoryboardAction = 109,
CornerRadius = 110,
CornerRadiusConverter = 111,
CroppedBitmap = 112,
CultureInfo = 113,
CultureInfoConverter = 114,
CultureInfoIetfLanguageTagConverter = 115,
Cursor = 116,
CursorConverter = 117,
DashStyle = 118,
DataChangedEventManager = 119,
DataTemplate = 120,
DataTemplateKey = 121,
DataTrigger = 122,
DateTime = 123,
DateTimeConverter = 124,
DateTimeConverter2 = 125,
Decimal = 126,
DecimalAnimation = 127,
DecimalAnimationBase = 128,
DecimalAnimationUsingKeyFrames = 129,
DecimalConverter = 130,
DecimalKeyFrame = 131,
DecimalKeyFrameCollection = 132,
Decorator = 133,
DefinitionBase = 134,
DependencyObject = 135,
DependencyProperty = 136,
DependencyPropertyConverter = 137,
DialogResultConverter = 138,
DiffuseMaterial = 139,
DirectionalLight = 140,
DiscreteBooleanKeyFrame = 141,
DiscreteByteKeyFrame = 142,
DiscreteCharKeyFrame = 143,
DiscreteColorKeyFrame = 144,
DiscreteDecimalKeyFrame = 145,
DiscreteDoubleKeyFrame = 146,
DiscreteInt16KeyFrame = 147,
DiscreteInt32KeyFrame = 148,
DiscreteInt64KeyFrame = 149,
DiscreteMatrixKeyFrame = 150,
DiscreteObjectKeyFrame = 151,
DiscretePoint3DKeyFrame = 152,
DiscretePointKeyFrame = 153,
DiscreteQuaternionKeyFrame = 154,
DiscreteRectKeyFrame = 155,
DiscreteRotation3DKeyFrame = 156,
DiscreteSingleKeyFrame = 157,
DiscreteSizeKeyFrame = 158,
DiscreteStringKeyFrame = 159,
DiscreteThicknessKeyFrame = 160,
DiscreteVector3DKeyFrame = 161,
DiscreteVectorKeyFrame = 162,
DockPanel = 163,
DocumentPageView = 164,
DocumentReference = 165,
DocumentViewer = 166,
DocumentViewerBase = 167,
Double = 168,
DoubleAnimation = 169,
DoubleAnimationBase = 170,
DoubleAnimationUsingKeyFrames = 171,
DoubleAnimationUsingPath = 172,
DoubleCollection = 173,
DoubleCollectionConverter = 174,
DoubleConverter = 175,
DoubleIListConverter = 176,
DoubleKeyFrame = 177,
DoubleKeyFrameCollection = 178,
Drawing = 179,
DrawingBrush = 180,
DrawingCollection = 181,
DrawingContext = 182,
DrawingGroup = 183,
DrawingImage = 184,
DrawingVisual = 185,
DropShadowBitmapEffect = 186,
Duration = 187,
DurationConverter = 188,
DynamicResourceExtension = 189,
DynamicResourceExtensionConverter = 190,
Ellipse = 191,
EllipseGeometry = 192,
EmbossBitmapEffect = 193,
EmissiveMaterial = 194,
EnumConverter = 195,
EventManager = 196,
EventSetter = 197,
EventTrigger = 198,
Expander = 199,
Expression = 200,
ExpressionConverter = 201,
Figure = 202,
FigureLength = 203,
FigureLengthConverter = 204,
FixedDocument = 205,
FixedDocumentSequence = 206,
FixedPage = 207,
Floater = 208,
FlowDocument = 209,
FlowDocumentPageViewer = 210,
FlowDocumentReader = 211,
FlowDocumentScrollViewer = 212,
FocusManager = 213,
FontFamily = 214,
FontFamilyConverter = 215,
FontSizeConverter = 216,
FontStretch = 217,
FontStretchConverter = 218,
FontStyle = 219,
FontStyleConverter = 220,
FontWeight = 221,
FontWeightConverter = 222,
FormatConvertedBitmap = 223,
Frame = 224,
FrameworkContentElement = 225,
FrameworkElement = 226,
FrameworkElementFactory = 227,
FrameworkPropertyMetadata = 228,
FrameworkPropertyMetadataOptions = 229,
FrameworkRichTextComposition = 230,
FrameworkTemplate = 231,
FrameworkTextComposition = 232,
Freezable = 233,
GeneralTransform = 234,
GeneralTransformCollection = 235,
GeneralTransformGroup = 236,
Geometry = 237,
Geometry3D = 238,
GeometryCollection = 239,
GeometryConverter = 240,
GeometryDrawing = 241,
GeometryGroup = 242,
GeometryModel3D = 243,
GestureRecognizer = 244,
GifBitmapDecoder = 245,
GifBitmapEncoder = 246,
GlyphRun = 247,
GlyphRunDrawing = 248,
GlyphTypeface = 249,
Glyphs = 250,
GradientBrush = 251,
GradientStop = 252,
GradientStopCollection = 253,
Grid = 254,
GridLength = 255,
GridLengthConverter = 256,
GridSplitter = 257,
GridView = 258,
GridViewColumn = 259,
GridViewColumnHeader = 260,
GridViewHeaderRowPresenter = 261,
GridViewRowPresenter = 262,
GridViewRowPresenterBase = 263,
GroupBox = 264,
GroupItem = 265,
Guid = 266,
GuidConverter = 267,
GuidelineSet = 268,
HeaderedContentControl = 269,
HeaderedItemsControl = 270,
HierarchicalDataTemplate = 271,
HostVisual = 272,
Hyperlink = 273,
IAddChild = 274,
IAddChildInternal = 275,
ICommand = 276,
IComponentConnector = 277,
INameScope = 278,
IStyleConnector = 279,
IconBitmapDecoder = 280,
Image = 281,
ImageBrush = 282,
ImageDrawing = 283,
ImageMetadata = 284,
ImageSource = 285,
ImageSourceConverter = 286,
InPlaceBitmapMetadataWriter = 287,
InkCanvas = 288,
InkPresenter = 289,
Inline = 290,
InlineCollection = 291,
InlineUIContainer = 292,
InputBinding = 293,
InputDevice = 294,
InputLanguageManager = 295,
InputManager = 296,
InputMethod = 297,
InputScope = 298,
InputScopeConverter = 299,
InputScopeName = 300,
InputScopeNameConverter = 301,
Int16 = 302,
Int16Animation = 303,
Int16AnimationBase = 304,
Int16AnimationUsingKeyFrames = 305,
Int16Converter = 306,
Int16KeyFrame = 307,
Int16KeyFrameCollection = 308,
Int32 = 309,
Int32Animation = 310,
Int32AnimationBase = 311,
Int32AnimationUsingKeyFrames = 312,
Int32Collection = 313,
Int32CollectionConverter = 314,
Int32Converter = 315,
Int32KeyFrame = 316,
Int32KeyFrameCollection = 317,
Int32Rect = 318,
Int32RectConverter = 319,
Int64 = 320,
Int64Animation = 321,
Int64AnimationBase = 322,
Int64AnimationUsingKeyFrames = 323,
Int64Converter = 324,
Int64KeyFrame = 325,
Int64KeyFrameCollection = 326,
Italic = 327,
ItemCollection = 328,
ItemsControl = 329,
ItemsPanelTemplate = 330,
ItemsPresenter = 331,
JournalEntry = 332,
JournalEntryListConverter = 333,
JournalEntryUnifiedViewConverter = 334,
JpegBitmapDecoder = 335,
JpegBitmapEncoder = 336,
KeyBinding = 337,
KeyConverter = 338,
KeyGesture = 339,
KeyGestureConverter = 340,
KeySpline = 341,
KeySplineConverter = 342,
KeyTime = 343,
KeyTimeConverter = 344,
KeyboardDevice = 345,
Label = 346,
LateBoundBitmapDecoder = 347,
LengthConverter = 348,
Light = 349,
Line = 350,
LineBreak = 351,
LineGeometry = 352,
LineSegment = 353,
LinearByteKeyFrame = 354,
LinearColorKeyFrame = 355,
LinearDecimalKeyFrame = 356,
LinearDoubleKeyFrame = 357,
LinearGradientBrush = 358,
LinearInt16KeyFrame = 359,
LinearInt32KeyFrame = 360,
LinearInt64KeyFrame = 361,
LinearPoint3DKeyFrame = 362,
LinearPointKeyFrame = 363,
LinearQuaternionKeyFrame = 364,
LinearRectKeyFrame = 365,
LinearRotation3DKeyFrame = 366,
LinearSingleKeyFrame = 367,
LinearSizeKeyFrame = 368,
LinearThicknessKeyFrame = 369,
LinearVector3DKeyFrame = 370,
LinearVectorKeyFrame = 371,
List = 372,
ListBox = 373,
ListBoxItem = 374,
ListCollectionView = 375,
ListItem = 376,
ListView = 377,
ListViewItem = 378,
Localization = 379,
LostFocusEventManager = 380,
MarkupExtension = 381,
Material = 382,
MaterialCollection = 383,
MaterialGroup = 384,
Matrix = 385,
Matrix3D = 386,
Matrix3DConverter = 387,
MatrixAnimationBase = 388,
MatrixAnimationUsingKeyFrames = 389,
MatrixAnimationUsingPath = 390,
MatrixCamera = 391,
MatrixConverter = 392,
MatrixKeyFrame = 393,
MatrixKeyFrameCollection = 394,
MatrixTransform = 395,
MatrixTransform3D = 396,
MediaClock = 397,
MediaElement = 398,
MediaPlayer = 399,
MediaTimeline = 400,
Menu = 401,
MenuBase = 402,
MenuItem = 403,
MenuScrollingVisibilityConverter = 404,
MeshGeometry3D = 405,
Model3D = 406,
Model3DCollection = 407,
Model3DGroup = 408,
ModelVisual3D = 409,
ModifierKeysConverter = 410,
MouseActionConverter = 411,
MouseBinding = 412,
MouseDevice = 413,
MouseGesture = 414,
MouseGestureConverter = 415,
MultiBinding = 416,
MultiBindingExpression = 417,
MultiDataTrigger = 418,
MultiTrigger = 419,
NameScope = 420,
NavigationWindow = 421,
NullExtension = 422,
NullableBoolConverter = 423,
NullableConverter = 424,
NumberSubstitution = 425,
Object = 426,
ObjectAnimationBase = 427,
ObjectAnimationUsingKeyFrames = 428,
ObjectDataProvider = 429,
ObjectKeyFrame = 430,
ObjectKeyFrameCollection = 431,
OrthographicCamera = 432,
OuterGlowBitmapEffect = 433,
Page = 434,
PageContent = 435,
PageFunctionBase = 436,
Panel = 437,
Paragraph = 438,
ParallelTimeline = 439,
ParserContext = 440,
PasswordBox = 441,
Path = 442,
PathFigure = 443,
PathFigureCollection = 444,
PathFigureCollectionConverter = 445,
PathGeometry = 446,
PathSegment = 447,
PathSegmentCollection = 448,
PauseStoryboard = 449,
Pen = 450,
PerspectiveCamera = 451,
PixelFormat = 452,
PixelFormatConverter = 453,
PngBitmapDecoder = 454,
PngBitmapEncoder = 455,
Point = 456,
Point3D = 457,
Point3DAnimation = 458,
Point3DAnimationBase = 459,
Point3DAnimationUsingKeyFrames = 460,
Point3DCollection = 461,
Point3DCollectionConverter = 462,
Point3DConverter = 463,
Point3DKeyFrame = 464,
Point3DKeyFrameCollection = 465,
Point4D = 466,
Point4DConverter = 467,
PointAnimation = 468,
PointAnimationBase = 469,
PointAnimationUsingKeyFrames = 470,
PointAnimationUsingPath = 471,
PointCollection = 472,
PointCollectionConverter = 473,
PointConverter = 474,
PointIListConverter = 475,
PointKeyFrame = 476,
PointKeyFrameCollection = 477,
PointLight = 478,
PointLightBase = 479,
PolyBezierSegment = 480,
PolyLineSegment = 481,
PolyQuadraticBezierSegment = 482,
Polygon = 483,
Polyline = 484,
Popup = 485,
PresentationSource = 486,
PriorityBinding = 487,
PriorityBindingExpression = 488,
ProgressBar = 489,
ProjectionCamera = 490,
PropertyPath = 491,
PropertyPathConverter = 492,
QuadraticBezierSegment = 493,
Quaternion = 494,
QuaternionAnimation = 495,
QuaternionAnimationBase = 496,
QuaternionAnimationUsingKeyFrames = 497,
QuaternionConverter = 498,
QuaternionKeyFrame = 499,
QuaternionKeyFrameCollection = 500,
QuaternionRotation3D = 501,
RadialGradientBrush = 502,
RadioButton = 503,
RangeBase = 504,
Rect = 505,
Rect3D = 506,
Rect3DConverter = 507,
RectAnimation = 508,
RectAnimationBase = 509,
RectAnimationUsingKeyFrames = 510,
RectConverter = 511,
RectKeyFrame = 512,
RectKeyFrameCollection = 513,
Rectangle = 514,
RectangleGeometry = 515,
RelativeSource = 516,
RemoveStoryboard = 517,
RenderOptions = 518,
RenderTargetBitmap = 519,
RepeatBehavior = 520,
RepeatBehaviorConverter = 521,
RepeatButton = 522,
ResizeGrip = 523,
ResourceDictionary = 524,
ResourceKey = 525,
ResumeStoryboard = 526,
RichTextBox = 527,
RotateTransform = 528,
RotateTransform3D = 529,
Rotation3D = 530,
Rotation3DAnimation = 531,
Rotation3DAnimationBase = 532,
Rotation3DAnimationUsingKeyFrames = 533,
Rotation3DKeyFrame = 534,
Rotation3DKeyFrameCollection = 535,
RoutedCommand = 536,
RoutedEvent = 537,
RoutedEventConverter = 538,
RoutedUICommand = 539,
RoutingStrategy = 540,
RowDefinition = 541,
Run = 542,
RuntimeNamePropertyAttribute = 543,
SByte = 544,
SByteConverter = 545,
ScaleTransform = 546,
ScaleTransform3D = 547,
ScrollBar = 548,
ScrollContentPresenter = 549,
ScrollViewer = 550,
Section = 551,
SeekStoryboard = 552,
Selector = 553,
Separator = 554,
SetStoryboardSpeedRatio = 555,
Setter = 556,
SetterBase = 557,
Shape = 558,
Single = 559,
SingleAnimation = 560,
SingleAnimationBase = 561,
SingleAnimationUsingKeyFrames = 562,
SingleConverter = 563,
SingleKeyFrame = 564,
SingleKeyFrameCollection = 565,
Size = 566,
Size3D = 567,
Size3DConverter = 568,
SizeAnimation = 569,
SizeAnimationBase = 570,
SizeAnimationUsingKeyFrames = 571,
SizeConverter = 572,
SizeKeyFrame = 573,
SizeKeyFrameCollection = 574,
SkewTransform = 575,
SkipStoryboardToFill = 576,
Slider = 577,
SolidColorBrush = 578,
SoundPlayerAction = 579,
Span = 580,
SpecularMaterial = 581,
SpellCheck = 582,
SplineByteKeyFrame = 583,
SplineColorKeyFrame = 584,
SplineDecimalKeyFrame = 585,
SplineDoubleKeyFrame = 586,
SplineInt16KeyFrame = 587,
SplineInt32KeyFrame = 588,
SplineInt64KeyFrame = 589,
SplinePoint3DKeyFrame = 590,
SplinePointKeyFrame = 591,
SplineQuaternionKeyFrame = 592,
SplineRectKeyFrame = 593,
SplineRotation3DKeyFrame = 594,
SplineSingleKeyFrame = 595,
SplineSizeKeyFrame = 596,
SplineThicknessKeyFrame = 597,
SplineVector3DKeyFrame = 598,
SplineVectorKeyFrame = 599,
SpotLight = 600,
StackPanel = 601,
StaticExtension = 602,
StaticResourceExtension = 603,
StatusBar = 604,
StatusBarItem = 605,
StickyNoteControl = 606,
StopStoryboard = 607,
Storyboard = 608,
StreamGeometry = 609,
StreamGeometryContext = 610,
StreamResourceInfo = 611,
String = 612,
StringAnimationBase = 613,
StringAnimationUsingKeyFrames = 614,
StringConverter = 615,
StringKeyFrame = 616,
StringKeyFrameCollection = 617,
StrokeCollection = 618,
StrokeCollectionConverter = 619,
Style = 620,
Stylus = 621,
StylusDevice = 622,
TabControl = 623,
TabItem = 624,
TabPanel = 625,
Table = 626,
TableCell = 627,
TableColumn = 628,
TableRow = 629,
TableRowGroup = 630,
TabletDevice = 631,
TemplateBindingExpression = 632,
TemplateBindingExpressionConverter = 633,
TemplateBindingExtension = 634,
TemplateBindingExtensionConverter = 635,
TemplateKey = 636,
TemplateKeyConverter = 637,
TextBlock = 638,
TextBox = 639,
TextBoxBase = 640,
TextComposition = 641,
TextCompositionManager = 642,
TextDecoration = 643,
TextDecorationCollection = 644,
TextDecorationCollectionConverter = 645,
TextEffect = 646,
TextEffectCollection = 647,
TextElement = 648,
TextSearch = 649,
ThemeDictionaryExtension = 650,
Thickness = 651,
ThicknessAnimation = 652,
ThicknessAnimationBase = 653,
ThicknessAnimationUsingKeyFrames = 654,
ThicknessConverter = 655,
ThicknessKeyFrame = 656,
ThicknessKeyFrameCollection = 657,
Thumb = 658,
TickBar = 659,
TiffBitmapDecoder = 660,
TiffBitmapEncoder = 661,
TileBrush = 662,
TimeSpan = 663,
TimeSpanConverter = 664,
Timeline = 665,
TimelineCollection = 666,
TimelineGroup = 667,
ToggleButton = 668,
ToolBar = 669,
ToolBarOverflowPanel = 670,
ToolBarPanel = 671,
ToolBarTray = 672,
ToolTip = 673,
ToolTipService = 674,
Track = 675,
Transform = 676,
Transform3D = 677,
Transform3DCollection = 678,
Transform3DGroup = 679,
TransformCollection = 680,
TransformConverter = 681,
TransformGroup = 682,
TransformedBitmap = 683,
TranslateTransform = 684,
TranslateTransform3D = 685,
TreeView = 686,
TreeViewItem = 687,
Trigger = 688,
TriggerAction = 689,
TriggerBase = 690,
TypeExtension = 691,
TypeTypeConverter = 692,
Typography = 693,
UIElement = 694,
UInt16 = 695,
UInt16Converter = 696,
UInt32 = 697,
UInt32Converter = 698,
UInt64 = 699,
UInt64Converter = 700,
UShortIListConverter = 701,
Underline = 702,
UniformGrid = 703,
Uri = 704,
UriTypeConverter = 705,
UserControl = 706,
Validation = 707,
Vector = 708,
Vector3D = 709,
Vector3DAnimation = 710,
Vector3DAnimationBase = 711,
Vector3DAnimationUsingKeyFrames = 712,
Vector3DCollection = 713,
Vector3DCollectionConverter = 714,
Vector3DConverter = 715,
Vector3DKeyFrame = 716,
Vector3DKeyFrameCollection = 717,
VectorAnimation = 718,
VectorAnimationBase = 719,
VectorAnimationUsingKeyFrames = 720,
VectorCollection = 721,
VectorCollectionConverter = 722,
VectorConverter = 723,
VectorKeyFrame = 724,
VectorKeyFrameCollection = 725,
VideoDrawing = 726,
ViewBase = 727,
Viewbox = 728,
Viewport3D = 729,
Viewport3DVisual = 730,
VirtualizingPanel = 731,
VirtualizingStackPanel = 732,
Visual = 733,
Visual3D = 734,
VisualBrush = 735,
VisualTarget = 736,
WeakEventManager = 737,
WhitespaceSignificantCollectionAttribute = 738,
Window = 739,
WmpBitmapDecoder = 740,
WmpBitmapEncoder = 741,
WrapPanel = 742,
WriteableBitmap = 743,
XamlBrushSerializer = 744,
XamlInt32CollectionSerializer = 745,
XamlPathDataSerializer = 746,
XamlPoint3DCollectionSerializer = 747,
XamlPointCollectionSerializer = 748,
XamlReader = 749,
XamlStyleSerializer = 750,
XamlTemplateSerializer = 751,
XamlVector3DCollectionSerializer = 752,
XamlWriter = 753,
XmlDataProvider = 754,
XmlLangPropertyAttribute = 755,
XmlLanguage = 756,
XmlLanguageConverter = 757,
XmlNamespaceMapping = 758,
ZoomPercentageConverter = 759,
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/BamlConnectionId.cs
================================================
/*
Copyright (c) 2019 Siegfried Pammer
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 ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.BamlDecompiler
{
///
/// Represents a field assignment of a XAML code-behind class.
///
internal sealed class FieldAssignment
{
public IField Field;
}
///
/// Represents an event registration of a XAML code-behind class.
///
internal sealed class EventRegistration
{
public string EventName, MethodName;
}
internal class BamlConnectionId
{
public uint Id { get; }
public BamlConnectionId(uint id) => Id = id;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/BamlDecompilationResult.cs
================================================
// Copyright (c) 2021 Siegfried Pammer
//
// 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.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Xml.Linq;
using ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.BamlDecompiler
{
public class BamlDecompilationResult
{
public XDocument Xaml { get; }
public List AssemblyReferences { get; }
public FullTypeName? TypeName { get; }
public List GeneratedMembers { get; }
public BamlDecompilationResult(XDocument xaml, FullTypeName? typeName, IEnumerable assemblyReferences, IEnumerable generatedMembers)
{
this.Xaml = xaml;
this.TypeName = typeName;
this.AssemblyReferences = assemblyReferences.ToList();
this.GeneratedMembers = generatedMembers.ToList();
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/BamlDecompilerSettings.cs
================================================
// Copyright (c) 2021 Siegfried Pammer
//
// 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.ComponentModel;
using System.Runtime.CompilerServices;
namespace ICSharpCode.BamlDecompiler
{
public class BamlDecompilerSettings : INotifyPropertyChanged
{
bool throwOnAssemblyResolveErrors = true;
[Browsable(false)]
public bool ThrowOnAssemblyResolveErrors {
get { return throwOnAssemblyResolveErrors; }
set {
if (throwOnAssemblyResolveErrors != value)
{
throwOnAssemblyResolveErrors = value;
OnPropertyChanged();
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/BamlDecompilerTypeSystem.cs
================================================
// Copyright (c) 2021 Siegfried Pammer
//
// 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.Reflection.Metadata;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.Decompiler.TypeSystem.Implementation;
using ICSharpCode.Decompiler.Util;
namespace ICSharpCode.BamlDecompiler
{
public class BamlDecompilerTypeSystem : SimpleCompilation, IDecompilerTypeSystem
{
string[] defaultBamlReferences = new[] {
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
};
public BamlDecompilerTypeSystem(MetadataFile mainModule, IAssemblyResolver assemblyResolver)
{
if (mainModule == null)
throw new ArgumentNullException(nameof(mainModule));
if (assemblyResolver == null)
throw new ArgumentNullException(nameof(assemblyResolver));
// Load referenced assemblies and type-forwarder references.
// This is necessary to make .NET Core/PCL binaries work better.
var referencedAssemblies = new List();
var assemblyReferenceQueue = new Queue<(bool IsAssembly, MetadataFile MainModule, object Reference)>();
var mainMetadata = mainModule.Metadata;
foreach (var h in mainMetadata.GetModuleReferences())
{
var moduleRef = mainMetadata.GetModuleReference(h);
var moduleName = mainMetadata.GetString(moduleRef.Name);
foreach (var fileHandle in mainMetadata.AssemblyFiles)
{
var file = mainMetadata.GetAssemblyFile(fileHandle);
if (mainMetadata.StringComparer.Equals(file.Name, moduleName) && file.ContainsMetadata)
{
assemblyReferenceQueue.Enqueue((false, mainModule, moduleName));
break;
}
}
}
foreach (var refs in mainModule.AssemblyReferences)
{
assemblyReferenceQueue.Enqueue((true, mainModule, refs));
}
foreach (var bamlReference in defaultBamlReferences)
{
assemblyReferenceQueue.Enqueue((true, mainModule, AssemblyNameReference.Parse(bamlReference)));
}
var comparer = KeyComparer.Create(((bool IsAssembly, MetadataFile MainModule, object Reference) reference) =>
reference.IsAssembly ? "A:" + ((IAssemblyReference)reference.Reference).FullName :
"M:" + reference.Reference);
var processedAssemblyReferences = new HashSet<(bool IsAssembly, MetadataFile Parent, object Reference)>(comparer);
while (assemblyReferenceQueue.Count > 0)
{
var asmRef = assemblyReferenceQueue.Dequeue();
if (!processedAssemblyReferences.Add(asmRef))
continue;
MetadataFile asm;
if (asmRef.IsAssembly)
{
asm = assemblyResolver.Resolve((IAssemblyReference)asmRef.Reference);
}
else
{
asm = assemblyResolver.ResolveModule(asmRef.MainModule, (string)asmRef.Reference);
}
if (asm != null)
{
referencedAssemblies.Add(asm);
var metadata = asm.Metadata;
foreach (var h in metadata.ExportedTypes)
{
var exportedType = metadata.GetExportedType(h);
switch (exportedType.Implementation.Kind)
{
case HandleKind.AssemblyReference:
assemblyReferenceQueue.Enqueue((true, asm, new ICSharpCode.Decompiler.Metadata.AssemblyReference(asm, (AssemblyReferenceHandle)exportedType.Implementation)));
break;
case HandleKind.AssemblyFile:
var file = metadata.GetAssemblyFile((AssemblyFileHandle)exportedType.Implementation);
assemblyReferenceQueue.Enqueue((false, asm, metadata.GetString(file.Name)));
break;
}
}
}
}
var mainModuleWithOptions = mainModule.WithOptions(TypeSystemOptions.Default);
var referencedAssembliesWithOptions = referencedAssemblies.Select(file => file.WithOptions(TypeSystemOptions.Default));
// Primitive types are necessary to avoid assertions in ILReader.
// Fallback to MinimalCorlib to provide the primitive types.
if (!HasType(KnownTypeCode.Void) || !HasType(KnownTypeCode.Int32))
{
Init(mainModule.WithOptions(TypeSystemOptions.Default), referencedAssembliesWithOptions.Concat(new[] { MinimalCorlib.Instance }));
}
else
{
Init(mainModuleWithOptions, referencedAssembliesWithOptions);
}
this.MainModule = (MetadataModule)base.MainModule;
bool HasType(KnownTypeCode code)
{
TopLevelTypeName name = KnownTypeReference.Get(code).TypeName;
if (!mainModule.GetTypeDefinition(name).IsNil)
return true;
foreach (var file in referencedAssemblies)
{
if (!file.GetTypeDefinition(name).IsNil)
return true;
}
return false;
}
}
public new MetadataModule MainModule { get; }
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/BamlElement.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
using System.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler
{
internal readonly struct XamlNode
{
XamlNode(XElement value)
{
Element = value;
String = null;
}
XamlNode(string value)
{
Element = null;
String = value;
}
public readonly XElement Element;
public readonly string String;
public static implicit operator XamlNode(XElement value) => new XamlNode(value);
public static implicit operator XamlNode(string value) => new XamlNode(value);
public static implicit operator XElement(XamlNode node) => node.Element;
public static implicit operator string(XamlNode node) => node.String;
}
internal class BamlElement
{
public BamlNode Node { get; }
public XamlNode Xaml { get; set; }
public BamlElement Parent { get; set; }
public IList Children { get; }
public BamlElement(BamlNode node)
{
Node = node;
Children = new List();
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/ConstructorParametersHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class ConstructorParametersStartHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.ConstructorParametersStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var doc = new BamlElement(node);
doc.Xaml = new XElement(ctx.GetPseudoName("Ctor"));
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/DocumentHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class DocumentHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.DocumentStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var doc = new BamlElement(node);
doc.Xaml = new XElement(ctx.GetPseudoName("Document"));
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/ElementHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class ElementHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.ElementStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (ElementStartRecord)((BamlBlockNode)node).Header;
var doc = new BamlElement(node);
var elemType = ctx.ResolveType(record.TypeId);
doc.Xaml = new XElement(elemType.ToXName(ctx));
doc.Xaml.Element.AddAnnotation(elemType);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
if (node.Annotation is XamlResourceKey key && key.KeyNode.Record != node.Record)
{
var handler = (IDeferHandler)HandlerMap.LookupHandler(key.KeyNode.Record.Type);
var keyElem = handler.TranslateDefer(ctx, key.KeyNode, doc);
doc.Children.Add(keyElem);
keyElem.Parent = doc;
}
elemType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemType.ToXName(ctx);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/KeyElementStartHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class KeyElementStartHandler : ElementHandler, IHandler, IDeferHandler
{
BamlRecordType IHandler.Type => BamlRecordType.KeyElementStart;
BamlElement IHandler.Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
XamlResourceKey.Create(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (KeyElementStartRecord)((BamlBlockNode)node).Header;
var key = (XamlResourceKey)node.Annotation;
var bamlElem = new BamlElement(node);
bamlElem.Xaml = new XElement(ctx.GetKnownNamespace("Key", XamlContext.KnownNamespace_Xaml, parent.Xaml));
parent.Xaml.Element.Add(bamlElem.Xaml.Element);
key.KeyElement = bamlElem;
base.Translate(ctx, node, bamlElem);
return bamlElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyArrayHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyArrayHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyArrayStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyArrayStartRecord)((BamlBlockNode)node).Header;
var doc = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
doc.Xaml = new XElement(elemAttr.ToXName(ctx, null));
doc.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
elemAttr.DeclaringType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyComplexHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyComplexHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyComplexStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyComplexStartRecord)((BamlBlockNode)node).Header;
var doc = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
doc.Xaml = new XElement(elemAttr.ToXName(ctx, null));
doc.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
elemAttr.DeclaringType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyDictionaryHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyDictionaryHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyDictionaryStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyDictionaryStartRecord)((BamlBlockNode)node).Header;
var doc = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
doc.Xaml = new XElement(elemAttr.ToXName(ctx, null));
doc.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
elemAttr.DeclaringType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Blocks/PropertyListHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyListHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyListStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyListStartRecord)((BamlBlockNode)node).Header;
var doc = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
doc.Xaml = new XElement(elemAttr.ToXName(ctx, null));
doc.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
elemAttr.DeclaringType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/AssemblyInfoHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class AssemblyInfoHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.AssemblyInfo;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/AttributeInfoHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class AttributeInfoHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.AttributeInfo;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/ConnectionIdHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class ConnectionIdHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.ConnectionId;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (ConnectionIdRecord)((BamlRecordNode)node).Record;
parent.Xaml.Element.AddAnnotation(new BamlConnectionId(record.ConnectionId));
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/ConstructorParameterTypeHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class ConstructorParameterTypeHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.ConstructorParameterType;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (ConstructorParameterTypeRecord)((BamlRecordNode)node).Record;
var elem = new XElement(ctx.GetKnownNamespace("TypeExtension", XamlContext.KnownNamespace_Xaml, parent.Xaml));
elem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
var bamlElem = new BamlElement(node);
bamlElem.Xaml = elem;
parent.Xaml.Element.Add(elem);
var type = ctx.ResolveType(record.TypeId);
var typeName = ctx.ToString(parent.Xaml, type);
elem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
return bamlElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/ContentPropertyHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class ContentPropertyHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.ContentProperty;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (ContentPropertyRecord)((BamlRecordNode)node).Record;
// TODO: What to do here?
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class DefAttributeHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.DefAttribute;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (DefAttributeRecord)((BamlRecordNode)node).Record;
var attrName = ctx.ResolveString(record.NameId);
parent.Xaml.Element.Add(new XAttribute(ctx.GetKnownNamespace(attrName, XamlContext.KnownNamespace_Xaml), record.Value));
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyStringHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class DefAttributeStringHandler : IHandler, IDeferHandler
{
public BamlRecordType Type => BamlRecordType.DefAttributeKeyString;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
XamlResourceKey.Create(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (DefAttributeKeyStringRecord)((BamlRecordNode)node).Record;
var key = (XamlResourceKey)node.Annotation;
var bamlElem = new BamlElement(node);
bamlElem.Xaml = new XElement(ctx.GetKnownNamespace("Key", XamlContext.KnownNamespace_Xaml, parent.Xaml));
parent.Xaml.Element.Add(bamlElem.Xaml.Element);
bamlElem.Xaml.Element.Value = ctx.ResolveString(record.ValueId);
key.KeyElement = bamlElem;
return bamlElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/DefAttributeKeyTypeHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class DefAttributeTypeHandler : IHandler, IDeferHandler
{
public BamlRecordType Type => BamlRecordType.DefAttributeKeyType;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
XamlResourceKey.Create(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (DefAttributeKeyTypeRecord)((BamlRecordNode)node).Record;
var type = ctx.ResolveType(record.TypeId);
var typeName = ctx.ToString(parent.Xaml, type);
var key = (XamlResourceKey)node.Annotation;
var bamlElem = new BamlElement(node);
bamlElem.Xaml = new XElement(ctx.GetKnownNamespace("Key", XamlContext.KnownNamespace_Xaml, parent.Xaml));
parent.Xaml.Element.Add(bamlElem.Xaml.Element);
var typeElem = new XElement(ctx.GetKnownNamespace("TypeExtension", XamlContext.KnownNamespace_Xaml, parent.Xaml));
typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
bamlElem.Xaml.Element.Add(typeElem);
key.KeyElement = bamlElem;
return bamlElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/DeferableContentStartHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class DeferableContentStartHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.DeferableContentStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (DeferableContentStartRecord)((BamlRecordNode)node).Record;
Debug.Assert(record.Record == ((BamlBlockNode)parent.Node).Footer);
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/LineNumberAndPositionHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class LineNumberAndPositionHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.LineNumberAndPosition;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/LinePositionHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class LinePositionHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.LinePosition;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/LiteralContentHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class LiteralContentHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.LiteralContent;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (LiteralContentRecord)((BamlRecordNode)node).Record;
var elem = new XElement(ctx.GetKnownNamespace("XData", XamlContext.KnownNamespace_Xaml, parent.Xaml));
var content = XElement.Parse(record.Value);
elem.Add(content);
parent.Xaml.Element.Add(elem);
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/OptimizedStaticResourceHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class OptimizedStaticResourceHandler : IHandler, IDeferHandler
{
public BamlRecordType Type => BamlRecordType.OptimizedStaticResource;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
var key = XamlResourceKey.FindKeyInSiblings(node);
key.StaticResources.Add(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
var bamlElem = new BamlElement(node);
object key;
if (record.IsType)
{
var value = ctx.ResolveType(record.ValueId);
var typeElem = new XElement(ctx.GetKnownNamespace("TypeExtension", XamlContext.KnownNamespace_Xaml, parent.Xaml));
typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), ctx.ToString(parent.Xaml, value)));
key = typeElem;
}
else if (record.IsStatic)
{
string attrName;
if (record.ValueId > 0x7fff)
{
bool isKey = true;
short bamlId = unchecked((short)-record.ValueId);
if (bamlId > 232 && bamlId < 464)
{
bamlId -= 232;
isKey = false;
}
else if (bamlId > 464 && bamlId < 467)
{
bamlId -= 231;
}
else if (bamlId > 467 && bamlId < 470)
{
bamlId -= 234;
isKey = false;
}
var res = ctx.Baml.KnownThings.Resources(bamlId);
string name;
if (isKey)
name = res.Item1 + "." + res.Item2;
else
name = res.Item1 + "." + res.Item3;
var xmlns = ctx.GetXmlNamespace(XamlContext.KnownNamespace_Presentation);
attrName = ctx.ToString(parent.Xaml, xmlns.GetName(name));
}
else
{
var value = ctx.ResolveProperty(record.ValueId);
value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
var xName = value.ToXName(ctx, parent.Xaml);
attrName = ctx.ToString(parent.Xaml, xName);
}
var staticElem = new XElement(ctx.GetKnownNamespace("StaticExtension", XamlContext.KnownNamespace_Xaml, parent.Xaml));
staticElem.AddAnnotation(ctx.ResolveType(0xfda6)); // Known type - StaticExtension
staticElem.Add(new XElement(ctx.GetPseudoName("Ctor"), attrName));
key = staticElem;
}
else
key = ctx.ResolveString(record.ValueId);
var extType = ctx.ResolveType(0xfda5);
var resElem = new XElement(extType.ToXName(ctx));
resElem.AddAnnotation(extType); // Known type - StaticResourceExtension
bamlElem.Xaml = resElem;
parent.Xaml.Element.Add(resElem);
var attrElem = new XElement(ctx.GetPseudoName("Ctor"));
attrElem.Add(key);
resElem.Add(attrElem);
return bamlElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PIMappingHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PIMappingHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PIMapping;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PresentationOptionsAttributeHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PresentationOptionsAttributeHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PresentationOptionsAttribute;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PresentationOptionsAttributeRecord)((BamlRecordNode)node).Record;
var attrName = ctx.ResolveString(record.NameId);
var attr = new XAttribute(ctx.GetKnownNamespace(attrName, XamlContext.KnownNamespace_PresentationOptions, parent.Xaml), record.Value);
parent.Xaml.Element.Add(attr);
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyCustomHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyCustomHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyCustom;
enum IntegerCollectionType : byte
{
Unknown,
Consecutive,
U1,
U2,
I4
}
string Deserialize(XamlContext ctx, XElement elem, KnownTypes ser, byte[] value)
{
using (BinaryReader reader = new BinaryReader(new MemoryStream(value)))
{
switch (ser)
{
case KnownTypes.DependencyPropertyConverter:
{
if (value.Length == 2)
{
var property = ctx.ResolveProperty(reader.ReadUInt16());
return ctx.ToString(elem, property.ToXName(ctx, elem, NeedsFullName(property, ctx, elem)));
}
else
{
var type = ctx.ResolveType(reader.ReadUInt16());
var name = reader.ReadString();
var typeName = ctx.ToString(elem, type);
return typeName + "." + name;
}
}
case KnownTypes.EnumConverter:
{
uint enumVal = reader.ReadUInt32();
// TODO: Convert to enum names
return enumVal.ToString("D", CultureInfo.InvariantCulture);
}
case KnownTypes.BooleanConverter:
{
Debug.Assert(value.Length == 1);
return (reader.ReadByte() == 1).ToString(CultureInfo.InvariantCulture);
}
case KnownTypes.XamlBrushSerializer:
{
switch (reader.ReadByte())
{
case 1: // KnownSolidColor
return string.Format(CultureInfo.InvariantCulture, "#{0:X8}", reader.ReadUInt32());
case 2: // OtherColor
return reader.ReadString();
}
break;
}
case KnownTypes.XamlPathDataSerializer:
return XamlPathDeserializer.Deserialize(reader);
case KnownTypes.XamlPoint3DCollectionSerializer:
case KnownTypes.XamlVector3DCollectionSerializer:
{
var sb = new StringBuilder();
var count = reader.ReadUInt32();
for (uint i = 0; i < count; i++)
{
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:R},{1:R},{2:R} ",
reader.ReadXamlDouble(),
reader.ReadXamlDouble(),
reader.ReadXamlDouble());
}
return sb.ToString().Trim();
}
case KnownTypes.XamlPointCollectionSerializer:
{
var sb = new StringBuilder();
var count = reader.ReadUInt32();
for (uint i = 0; i < count; i++)
{
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:R},{1:R} ",
reader.ReadXamlDouble(),
reader.ReadXamlDouble());
}
return sb.ToString().Trim();
}
case KnownTypes.XamlInt32CollectionSerializer:
{
var sb = new StringBuilder();
var type = (IntegerCollectionType)reader.ReadByte();
var count = reader.ReadInt32();
switch (type)
{
case IntegerCollectionType.Consecutive:
{
var start = reader.ReadInt32();
for (int i = 0; i < count; i++)
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", start + i);
}
break;
case IntegerCollectionType.U1:
{
for (int i = 0; i < count; i++)
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", reader.ReadByte());
}
break;
case IntegerCollectionType.U2:
{
for (int i = 0; i < count; i++)
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", reader.ReadUInt16());
}
break;
case IntegerCollectionType.I4:
{
for (int i = 0; i < count; i++)
sb.AppendFormat(CultureInfo.InvariantCulture, "{0:D}", reader.ReadInt32());
}
break;
default:
throw new NotSupportedException(type.ToString());
}
return sb.ToString().Trim();
}
}
}
throw new NotSupportedException(ser.ToString());
}
private bool NeedsFullName(XamlProperty property, XamlContext ctx, XElement elem)
{
XElement p = elem.Parent;
while (p != null && p.Annotation()?.ResolvedType.FullName != "System.Windows.Style")
{
p = p.Parent;
}
var type = p?.Annotation()?.Type;
if (type == null)
return true;
return property.IsAttachedTo(type);
}
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyCustomRecord)((BamlRecordNode)node).Record;
var serTypeId = ((short)record.SerializerTypeId & 0xfff);
bool valueType = ((short)record.SerializerTypeId & 0x4000) == 0x4000;
var elemType = parent.Xaml.Element.Annotation();
var xamlProp = ctx.ResolveProperty(record.AttributeId);
string value = Deserialize(ctx, parent.Xaml, (KnownTypes)serTypeId, record.Data);
var attr = new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, xamlProp.IsAttachedTo(elemType)), value);
parent.Xaml.Element.Add(attr);
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyHandler : IHandler
{
public virtual BamlRecordType Type => BamlRecordType.Property;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyRecord)((BamlRecordNode)node).Record;
var elemType = parent.Xaml.Element.Annotation();
var xamlProp = ctx.ResolveProperty(record.AttributeId);
var value = XamlUtils.Escape(record.Value);
xamlProp.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
parent.Xaml.Element.Add(ConstructXAttribute());
return null;
XAttribute ConstructXAttribute()
{
if (xamlProp.IsAttachedTo(elemType))
return new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, true), value);
if (xamlProp.PropertyName == "Name" && elemType.ResolvedType.GetDefinition()?.ParentModule.IsMainModule == true)
return new XAttribute(ctx.GetKnownNamespace("Name", XamlContext.KnownNamespace_Xaml), value);
return new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, false), value);
}
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyTypeReferenceHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyTypeReferenceHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyTypeReference;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyTypeReferenceRecord)((BamlRecordNode)node).Record;
var attr = ctx.ResolveProperty(record.AttributeId);
var type = ctx.ResolveType(record.TypeId);
var typeName = ctx.ToString(parent.Xaml, type);
var elem = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
elem.Xaml = new XElement(elemAttr.ToXName(ctx, null));
if (attr.ResolvedMember?.FullNameIs("System.Windows.Style", "TargetType") == true)
{
parent.Xaml.Element.AddAnnotation(new TargetTypeAnnotation(type));
}
elem.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(elem.Xaml.Element);
var typeElem = new XElement(ctx.GetKnownNamespace("TypeExtension", XamlContext.KnownNamespace_Xaml, parent.Xaml));
typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), typeName));
elem.Xaml.Element.Add(typeElem);
elemAttr.DeclaringType.ResolveNamespace(elem.Xaml, ctx);
elem.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return elem;
}
}
internal class TargetTypeAnnotation
{
public XamlType Type { get; }
public TargetTypeAnnotation(XamlType type)
{
this.Type = type;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithConverterHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyWithConverterHandler : PropertyHandler, IHandler
{
BamlRecordType IHandler.Type => BamlRecordType.PropertyWithConverter;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithExtensionHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyWithExtensionHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyWithExtension;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyWithExtensionRecord)((BamlRecordNode)node).Record;
var extTypeId = ((short)record.Flags & 0xfff);
bool valTypeExt = ((short)record.Flags & 0x4000) == 0x4000;
bool valStaticExt = ((short)record.Flags & 0x2000) == 0x2000;
var elemType = parent.Xaml.Element.Annotation();
var xamlProp = ctx.ResolveProperty(record.AttributeId);
var extType = ctx.ResolveType(unchecked((ushort)-extTypeId));
extType.ResolveNamespace(parent.Xaml, ctx);
var ext = new XamlExtension(extType);
if (valTypeExt || extTypeId == (short)KnownTypes.TypeExtension)
{
var value = ctx.ResolveType(record.ValueId);
object[] initializer = new object[] { ctx.ToString(parent.Xaml, value) };
if (valTypeExt)
initializer = new object[] { new XamlExtension(ctx.ResolveType(0xfd4d)) { Initializer = initializer } }; // Known type - TypeExtension
ext.Initializer = initializer;
}
else if (extTypeId == (short)KnownTypes.TemplateBindingExtension)
{
var value = ctx.ResolveProperty(record.ValueId);
value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
var xName = value.ToXName(ctx, parent.Xaml, true);
ext.Initializer = new object[] { ctx.ToString(parent.Xaml, xName) };
}
else if (valStaticExt || extTypeId == (short)KnownTypes.StaticExtension)
{
string attrName;
if (record.ValueId > 0x7fff)
{
bool isKey = true;
short bamlId = unchecked((short)-record.ValueId);
if (bamlId > 232 && bamlId < 464)
{
bamlId -= 232;
isKey = false;
}
else if (bamlId > 464 && bamlId < 467)
{
bamlId -= 231;
}
else if (bamlId > 467 && bamlId < 470)
{
bamlId -= 234;
isKey = false;
}
var res = ctx.Baml.KnownThings.Resources(bamlId);
string name;
if (isKey)
name = res.Item1 + "." + res.Item2;
else
name = res.Item1 + "." + res.Item3;
var xmlns = ctx.GetXmlNamespace(XamlContext.KnownNamespace_Presentation);
attrName = ctx.ToString(parent.Xaml, xmlns.GetName(name));
}
else
{
var value = ctx.ResolveProperty(record.ValueId);
value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
var xName = value.ToXName(ctx, parent.Xaml);
attrName = ctx.ToString(parent.Xaml, xName);
}
object[] initializer = new object[] { attrName };
if (valStaticExt)
initializer = new object[] { new XamlExtension(ctx.ResolveType(0xfda6)) { Initializer = initializer } }; // Known type - StaticExtension
ext.Initializer = initializer;
}
else
{
ext.Initializer = new object[] { XamlUtils.Escape(ctx.ResolveString(record.ValueId)) };
}
var extValue = ext.ToString(ctx, parent.Xaml);
var attr = new XAttribute(xamlProp.ToXName(ctx, parent.Xaml, xamlProp.IsAttachedTo(elemType)), extValue);
parent.Xaml.Element.Add(attr);
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/PropertyWithStaticResourceIdHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class PropertyWithStaticResourceIdHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.PropertyWithStaticResourceId;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (PropertyWithStaticResourceIdRecord)((BamlRecordNode)node).Record;
var doc = new BamlElement(node);
var elemAttr = ctx.ResolveProperty(record.AttributeId);
doc.Xaml = new XElement(elemAttr.ToXName(ctx, null));
doc.Xaml.Element.AddAnnotation(elemAttr);
parent.Xaml.Element.Add(doc.Xaml.Element);
BamlNode found = node;
XamlResourceKey key;
do
{
key = XamlResourceKey.FindKeyInAncestors(found.Parent, out found);
} while (key != null && record.StaticResourceId >= key.StaticResources.Count);
if (key == null)
throw new Exception("Cannot find StaticResource @" + node.Record.Position);
var resNode = key.StaticResources[record.StaticResourceId];
var handler = (IDeferHandler)HandlerMap.LookupHandler(resNode.Type);
var resElem = handler.TranslateDefer(ctx, resNode, doc);
doc.Children.Add(resElem);
resElem.Parent = doc;
elemAttr.DeclaringType.ResolveNamespace(doc.Xaml, ctx);
doc.Xaml.Element.Name = elemAttr.ToXName(ctx, null);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceIdHandler.cs
================================================
// Copyright (c) 2019 Siegfried Pammer
//
// 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.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
class StaticResourceIdHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.StaticResourceId;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (StaticResourceIdRecord)((BamlRecordNode)node).Record;
BamlNode found = node;
XamlResourceKey key;
do
{
key = XamlResourceKey.FindKeyInAncestors(found.Parent, out found);
} while (key != null && record.StaticResourceId >= key.StaticResources.Count);
if (key == null)
throw new Exception("Cannot find StaticResource @" + node.Record.Position);
var resNode = key.StaticResources[record.StaticResourceId];
var handler = (IDeferHandler)HandlerMap.LookupHandler(resNode.Type);
var resElem = handler.TranslateDefer(ctx, resNode, parent);
parent.Children.Add(resElem);
resElem.Parent = parent;
return resElem;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/StaticResourceStartHandler.cs
================================================
// Copyright (c) 2019 Siegfried Pammer
//
// 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.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
class StaticResourceStartHandler : IHandler, IDeferHandler
{
public BamlRecordType Type => BamlRecordType.StaticResourceStart;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (StaticResourceStartRecord)((BamlBlockNode)node).Record;
var key = XamlResourceKey.FindKeyInSiblings(node);
key.StaticResources.Add(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (StaticResourceStartRecord)((BamlBlockNode)node).Record;
var doc = new BamlElement(node);
var elemType = ctx.ResolveType(record.TypeId);
doc.Xaml = new XElement(elemType.ToXName(ctx));
doc.Xaml.Element.AddAnnotation(elemType);
parent.Xaml.Element.Add(doc.Xaml.Element);
HandlerMap.ProcessChildren(ctx, (BamlBlockNode)node, doc);
return doc;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/TextHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class TextHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.Text;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (TextRecord)((BamlRecordNode)node).Record;
parent.Xaml.Element.Add(record.Value);
return null;
}
}
internal class TextWithIdHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.TextWithId;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (TextWithIdRecord)((BamlRecordNode)node).Record;
parent.Xaml.Element.Add(ctx.ResolveString(record.ValueId));
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/TextWithConverterHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class TextWithConverterHandler : TextHandler, IHandler
{
BamlRecordType IHandler.Type => BamlRecordType.TextWithConverter;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/TypeInfoHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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 ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class TypeInfoHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.TypeInfo;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
internal class TypeSerializerInfoHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.TypeSerializerInfo;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) => null;
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Handlers/Records/XmlnsPropertyHandler.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.BamlDecompiler.Baml;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Handlers
{
internal class XmlnsPropertyHandler : IHandler
{
public BamlRecordType Type => BamlRecordType.XmlnsProperty;
IEnumerable ResolveCLRNamespaces(IModule assembly, string ns)
{
foreach (var attr in assembly.GetAssemblyAttributes().Where(a => a.AttributeType.FullName == "System.Windows.Markup.XmlnsDefinitionAttribute"))
{
Debug.Assert(attr.FixedArguments.Length == 2);
var xmlNs = attr.FixedArguments[0].Value;
var clrNs = attr.FixedArguments[1].Value;
Debug.Assert(xmlNs is string && clrNs is string);
if ((string)xmlNs == ns)
yield return (string)clrNs;
}
}
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent)
{
var record = (XmlnsPropertyRecord)((BamlRecordNode)node).Record;
foreach (var asmId in record.AssemblyIds)
{
var assembly = ctx.Baml.ResolveAssembly(asmId);
ctx.XmlNs.Add(new NamespaceMap(record.Prefix, assembly.FullAssemblyName, record.XmlNamespace));
if (assembly.Assembly?.IsMainModule == true)
{
foreach (var clrNs in ResolveCLRNamespaces(assembly.Assembly, record.XmlNamespace))
ctx.XmlNs.Add(new NamespaceMap(record.Prefix, assembly.FullAssemblyName, record.XmlNamespace, clrNs));
}
}
XName xmlnsDef;
if (string.IsNullOrEmpty(record.Prefix))
xmlnsDef = "xmlns";
else
xmlnsDef = XNamespace.Xmlns + XmlConvert.EncodeLocalName(record.Prefix);
parent.Xaml.Element.Add(new XAttribute(xmlnsDef, ctx.GetXmlNamespace(record.XmlNamespace)));
return null;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj
================================================
net10.0
True
..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk
en-US
False
False
False
ICSharpCode.BamlDecompiler
10.0.0.0-noversion
ILSpy BAML Decompiler
ILSpy Contributors
MIT
https://github.com/icsharpcode/ILSpy/
Cross-Platform library for decompiling BAML.
PackageReadme.md
ic#code
BamlDecompiler
git
https://github.com/icsharpcode/ILSpy.git
../ICSharpCode.Decompiler/DecompilerNuGetPackageIcon.png
false
Copyright 2024-$([System.DateTime]::Now.Year) AlphaSierraPapa
C# Decompiler ILSpy
true
embedded
true
true
true
true
true
true
ILSpyUpdateAssemblyInfo;
$(GetPackageVersionDependsOn)
all
runtime; build; native; contentfiles; analyzers; buildtransitive
================================================
FILE: ICSharpCode.BamlDecompiler/IHandlers.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using ICSharpCode.BamlDecompiler.Baml;
namespace ICSharpCode.BamlDecompiler
{
internal interface IHandler
{
BamlRecordType Type { get; }
BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent);
}
internal interface IDeferHandler
{
BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent);
}
internal static class HandlerMap
{
static readonly Dictionary handlers;
static HandlerMap()
{
handlers = new Dictionary();
foreach (var type in typeof(IHandler).Assembly.GetTypes())
{
if (typeof(IHandler).IsAssignableFrom(type) &&
!type.IsInterface && !type.IsAbstract)
{
var handler = (IHandler)Activator.CreateInstance(type);
handlers.Add(handler.Type, handler);
}
}
}
public static IHandler LookupHandler(BamlRecordType type)
{
#if DEBUG
switch (type)
{
case BamlRecordType.AssemblyInfo:
case BamlRecordType.TypeInfo:
case BamlRecordType.AttributeInfo:
case BamlRecordType.StringInfo:
break;
default:
if (!handlers.ContainsKey(type))
throw new NotSupportedException(type.ToString());
break;
}
#endif
return handlers.ContainsKey(type) ? handlers[type] : null;
}
public static void ProcessChildren(XamlContext ctx, BamlBlockNode node, BamlElement nodeElem)
{
ctx.XmlNs.PushScope(nodeElem);
if (nodeElem.Xaml.Element != null)
nodeElem.Xaml.Element.AddAnnotation(ctx.XmlNs.CurrentScope);
foreach (var child in node.Children)
{
var handler = LookupHandler(child.Type);
if (handler == null)
{
Debug.WriteLine("BAML Handler {0} not implemented.", child.Type);
continue;
}
var elem = handler.Translate(ctx, (BamlNode)child, nodeElem);
if (elem != null)
{
nodeElem.Children.Add(elem);
elem.Parent = nodeElem;
}
ctx.CancellationToken.ThrowIfCancellationRequested();
}
ctx.XmlNs.PopScope();
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/IRewritePass.cs
================================================
/*
Copyright (c) 2015 Ki
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.Xml.Linq;
namespace ICSharpCode.BamlDecompiler
{
internal interface IRewritePass
{
void Run(XamlContext ctx, XDocument document);
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/PackageReadme.md
================================================
## About
ICSharpCode.BamlDecompiler is the library used by the BAML Addin in ILSpy to decompile BAML to XAML.
================================================
FILE: ICSharpCode.BamlDecompiler/Properties/AssemblyInfo.cs
================================================
#region Using directives
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
[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)]
[assembly: AssemblyVersion(DecompilerVersionInfo.Major + "." + DecompilerVersionInfo.Minor + "." + DecompilerVersionInfo.Build + "." + DecompilerVersionInfo.Revision)]
[assembly: AssemblyInformationalVersion(DecompilerVersionInfo.FullVersionWithCommitHash)]
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
================================================
FILE: ICSharpCode.BamlDecompiler/Rewrite/AttributeRewritePass.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
using System.Xml.Linq;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Rewrite
{
internal class AttributeRewritePass : IRewritePass
{
XName key;
public void Run(XamlContext ctx, XDocument document)
{
key = ctx.GetKnownNamespace("Key", XamlContext.KnownNamespace_Xaml);
bool doWork;
do
{
doWork = false;
foreach (var elem in document.Elements())
{
doWork |= ProcessElement(ctx, elem);
}
} while (doWork);
}
bool ProcessElement(XamlContext ctx, XElement elem)
{
bool doWork = false;
foreach (var child in elem.Elements())
{
doWork |= RewriteElement(ctx, elem, child);
doWork |= ProcessElement(ctx, child);
}
return doWork;
}
bool RewriteElement(XamlContext ctx, XElement parent, XElement elem)
{
var property = elem.Annotation();
if (property == null && elem.Name != key)
return false;
if (elem.HasAttributes || elem.HasElements)
return false;
ctx.CancellationToken.ThrowIfCancellationRequested();
var value = elem.Value;
var attrName = elem.Name;
if (attrName != key)
attrName = property.ToXName(ctx, parent, property.IsAttachedTo(parent.Annotation()));
var attr = new XAttribute(attrName, value);
var list = new List(parent.Attributes());
if (attrName == key)
list.Insert(0, attr);
else
list.Add(attr);
parent.RemoveAttributes();
parent.ReplaceAttributes(list);
elem.Remove();
return true;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Rewrite/ConnectionIdRewritePass.cs
================================================
// Copyright (c) 2019 Siegfried Pammer
//
// 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.Reflection.Metadata;
using System.Xml.Linq;
using ICSharpCode.BamlDecompiler.Xaml;
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.IL;
using ICSharpCode.Decompiler.IL.Transforms;
using ICSharpCode.Decompiler.Util;
namespace ICSharpCode.BamlDecompiler.Rewrite
{
using ICSharpCode.Decompiler.TypeSystem;
internal class ConnectionIdRewritePass : IRewritePass
{
static readonly TopLevelTypeName componentConnectorTypeName
= new TopLevelTypeName("System.Windows.Markup", "IComponentConnector");
static readonly TopLevelTypeName styleConnectorTypeName
= new TopLevelTypeName("System.Windows.Markup", "IStyleConnector");
public void Run(XamlContext ctx, XDocument document)
{
var connections = DecompileConnections(ctx, document);
ProcessConnectionIds(ctx, document.Root, connections);
}
static void ProcessConnectionIds(XamlContext ctx, XElement element,
(List<(LongSet key, FieldAssignment value)> fieldAssignments,
List<(LongSet key, EventRegistration[] value)> eventMappings) connections)
{
foreach (var child in element.Elements())
ProcessConnectionIds(ctx, child, connections);
var fieldAssignments = connections.fieldAssignments;
var eventMappings = connections.eventMappings;
foreach (var annotation in element.Annotations())
{
int index;
bool found = false;
if ((index = fieldAssignments.FindIndex(item => item.key.Contains(annotation.Id))) > -1)
{
var xName = ctx.GetKnownNamespace("Name", XamlContext.KnownNamespace_Xaml, element);
FieldAssignment fieldAssignment = fieldAssignments[index].value;
if (element.Attribute("Name") is null && element.Attribute(xName) is null)
{
element.Add(new XAttribute(xName, fieldAssignment.Field.Name));
}
// x:FieldModifier can only be "public" or "internal" (in C#), where "internal" is the default and thus omitted
if (fieldAssignment.Field.Accessibility is Accessibility.Public)
{
element.Add(new XAttribute(ctx.GetKnownNamespace("FieldModifier", XamlContext.KnownNamespace_Xaml, element), "public"));
}
ctx.GeneratedMembers.Add(fieldAssignment.Field.MetadataToken);
found = true;
}
if ((index = eventMappings.FindIndex(item => item.key.Contains(annotation.Id))) > -1)
{
foreach (var entry in eventMappings[index].value)
{
string xmlns = ""; // TODO : implement xmlns resolver!
var type = element.Annotation();
if (type?.TypeNamespace + "." + type?.TypeName == "System.Windows.Style")
{
element.Add(new XElement(type.Namespace + "EventSetter",
new XAttribute("Event", entry.EventName),
new XAttribute("Handler", entry.MethodName)));
}
else
{
element.Add(new XAttribute(xmlns + entry.EventName, entry.MethodName));
}
}
found = true;
}
if (!found)
{
element.Add(new XComment($"Unknown connection ID: {annotation.Id}"));
}
}
}
(List<(LongSet, FieldAssignment)>, List<(LongSet, EventRegistration[])>) DecompileConnections
(XamlContext ctx, XDocument document)
{
var fieldAssignments = new List<(LongSet key, FieldAssignment value)>();
var eventMappings = new List<(LongSet, EventRegistration[])>();
var xClass = document.Root
.Elements().First()
.Attribute(ctx.GetKnownNamespace("Class", XamlContext.KnownNamespace_Xaml));
if (xClass == null)
return (fieldAssignments, eventMappings);
var type = ctx.TypeSystem.FindType(new FullTypeName(xClass.Value)).GetDefinition();
if (type == null)
return (fieldAssignments, eventMappings);
DecompileConnections(ctx, fieldAssignments, eventMappings, componentConnectorTypeName, type);
DecompileConnections(ctx, fieldAssignments, eventMappings, styleConnectorTypeName, type);
return (fieldAssignments, eventMappings);
}
void DecompileConnections(XamlContext ctx, List<(LongSet, FieldAssignment)> fieldAssignments,
List<(LongSet, EventRegistration[])> eventMappings, FullTypeName connectorTypeName, ITypeDefinition type)
{
var connectorInterface = ctx.TypeSystem.FindType(connectorTypeName).GetDefinition();
if (connectorInterface == null)
return;
var connect = connectorInterface.GetMethods(m => m.Name == "Connect").SingleOrDefault();
IMethod connectMethod = null;
MethodDefinition connectMetadataEntry = default;
var module = ctx.TypeSystem.MainModule.MetadataFile;
foreach (IMethod m in type.Methods)
{
if (connectMethod == null && m.ExplicitlyImplementedInterfaceMembers.Any(md => md.MemberDefinition.Equals(connect)))
{
connectMethod = m;
connectMetadataEntry = module.Metadata
.GetMethodDefinition((MethodDefinitionHandle)connectMethod.MetadataToken);
}
else if (m.Parameters.Count == 0
&& m.ReturnType.Kind == TypeKind.Void
&& !m.IsStatic
&& m.Accessibility == Accessibility.Public
&& m.Name == "InitializeComponent"
&& m.GetAttributes().Any(a => a.AttributeType.ReflectionName == "System.CodeDom.Compiler.GeneratedCodeAttribute"))
{
ctx.GeneratedMembers.Add(m.MetadataToken);
}
else if (m.Parameters.Count == 0
&& m.ReturnType.Kind == TypeKind.Void
&& m.IsStatic
&& m.Accessibility == Accessibility.Public
&& m.Name == "Main"
&& m.DeclaringTypeDefinition.GetNonInterfaceBaseTypes().Any(t => t.ReflectionName == "System.Windows.Application")
&& m.GetAttributes().Any(a => a.AttributeType.ReflectionName == "System.CodeDom.Compiler.GeneratedCodeAttribute"))
{
ctx.GeneratedMembers.Add(m.MetadataToken);
}
}
if (type.Fields.FirstOrDefault(f => f.Name == "_contentLoaded" && f.Type.IsKnownType(KnownTypeCode.Boolean)) is {
Accessibility: Accessibility.Private, IsStatic: false
} contentLoadedField)
{
ctx.GeneratedMembers.Add(contentLoadedField.MetadataToken);
}
if (connectMethod == null || connectMetadataEntry.RelativeVirtualAddress <= 0)
return;
ctx.GeneratedMembers.Add(connectMethod.MetadataToken);
var body = module.GetMethodBody(connectMetadataEntry.RelativeVirtualAddress);
var genericContext = new GenericContext(
classTypeParameters: connectMethod.DeclaringType?.TypeParameters,
methodTypeParameters: connectMethod.TypeParameters);
// decompile method and optimize the switch
var ilReader = new ILReader(ctx.TypeSystem.MainModule);
var function = ilReader.ReadIL((MethodDefinitionHandle)connectMethod.MetadataToken, body, genericContext,
ILFunctionKind.TopLevelFunction, ctx.CancellationToken);
var context = new ILTransformContext(function, ctx.TypeSystem, null) {
CancellationToken = ctx.CancellationToken
};
function.RunTransforms(CSharpDecompiler.GetILTransforms(), context);
var block = function.Body.Children.OfType().First();
var ilSwitch = block.Descendants.OfType().FirstOrDefault();
var events = new List();
if (ilSwitch != null)
{
foreach (var section in ilSwitch.Sections)
{
Add(section.Labels, section.Body);
}
}
else
{
foreach (var ifInst in function.Descendants.OfType())
{
if (!(ifInst.Condition is Comp comp))
continue;
if (comp.Kind != ComparisonKind.Inequality && comp.Kind != ComparisonKind.Equality)
continue;
if (!comp.Right.MatchLdcI4(out int id))
continue;
var inst = comp.Kind == ComparisonKind.Inequality
? ifInst.FalseInst
: ifInst.TrueInst;
Add(new LongSet(id), inst);
}
}
void Add(LongSet ids, ILInstruction inst)
{
var field = FindField(inst);
if (!(field is null))
{
fieldAssignments.Add((ids, field));
}
events.Clear();
FindEvents(inst, events);
if (events.Count > 0)
{
eventMappings.Add((ids, events.ToArray()));
}
}
}
FieldAssignment FindField(ILInstruction inst)
{
switch (inst)
{
case Block b:
var t = b.Instructions.FirstOrDefault();
if (!(t is null) && MatchFieldAssignment(t, out var field))
return field;
return null;
case Branch br:
return FindField(br.TargetBlock);
default:
if (MatchFieldAssignment(inst, out field))
return field;
return null;
}
}
bool MatchFieldAssignment(ILInstruction inst, out FieldAssignment field)
{
field = null;
if (!inst.MatchStFld(out _, out var fld, out var value) || !value.MatchCastClass(out var arg, out _)
|| !(arg.MatchLdLoc(out var t) && t.Kind == VariableKind.Parameter && t.Index == 1))
return false;
field = new FieldAssignment { Field = fld };
return true;
}
void FindEvents(ILInstruction inst, List events)
{
EventRegistration @event;
switch (inst)
{
case Block b:
for (int i = 0; i < b.Instructions.Count;)
{
if (MatchEventSetterCreation(b, ref i, out @event))
events.Add(@event);
else
i++;
}
foreach (var node in b.Instructions)
{
if (MatchSimpleEventRegistration(node, out @event))
events.Add(@event);
}
break;
case Branch br:
FindEvents(br.TargetBlock, events);
break;
default:
if (MatchSimpleEventRegistration(inst, out @event))
events.Add(@event);
break;
}
}
// stloc v(newobj EventSetter..ctor())
// callvirt set_Event(ldloc v, ldsfld eventName)
// callvirt set_Handler(ldloc v, newobj RoutedEventHandler..ctor(ldloc this, ldftn eventHandler))
// callvirt Add(callvirt get_Setters(castclass System.Windows.Style(ldloc target)), ldloc v)
bool MatchEventSetterCreation(Block b, ref int pos, out EventRegistration @event)
{
@event = null;
if (!b.FinalInstruction.MatchNop())
{
pos = b.Instructions.Count;
return false;
}
var instr = b.Instructions;
// stloc v(newobj EventSetter..ctor())
if (!instr[pos + 0].MatchStLoc(out var v, out var initializer))
return false;
if (!(initializer is NewObj newObj
&& newObj.Method.DeclaringType.FullName == "System.Windows.EventSetter"
&& newObj.Arguments.Count == 0))
{
return false;
}
//callvirt set_Event(ldloc v, ldsfld eventName)
if (!(instr[pos + 1] is CallVirt setEventCall && setEventCall.Arguments.Count == 2))
return false;
if (!setEventCall.Method.IsAccessor)
return false;
if (!setEventCall.Arguments[0].MatchLdLoc(v))
return false;
if (setEventCall.Method.Name != "set_Event")
return false;
if (!setEventCall.Arguments[1].MatchLdsFld(out var eventField))
return false;
string eventName = eventField.Name;
if (eventName.EndsWith("Event"))
{
eventName = eventName.Remove(eventName.Length - "Event".Length);
}
// callvirt set_Handler(ldloc v, newobj RoutedEventHandler..ctor(ldloc this, ldftn eventHandler))
if (!(instr[pos + 2] is CallVirt setHandlerCall && setHandlerCall.Arguments.Count == 2))
return false;
if (!setHandlerCall.Method.IsAccessor)
return false;
if (!setHandlerCall.Arguments[0].MatchLdLoc(v))
return false;
if (setHandlerCall.Method.Name != "set_Handler")
return false;
if (!MatchEventHandlerCreation(setHandlerCall.Arguments[1], out string handlerName))
return false;
@event = new EventRegistration { EventName = eventName, MethodName = handlerName };
// callvirt Add(callvirt get_Setters(castclass System.Windows.Style(ldloc target)), ldloc v)
if (!(instr[pos + 3] is CallVirt addCall && addCall.Arguments.Count == 2))
return false;
if (addCall.Method.Name != "Add")
return false;
if (!(addCall.Arguments[0] is CallVirt getSettersCall && getSettersCall.Arguments.Count == 1))
return false;
if (!getSettersCall.Method.IsAccessor)
return false;
if (getSettersCall.Method.Name != "get_Setters")
return false;
if (!getSettersCall.Arguments[0].MatchCastClass(out var arg, out var type))
return false;
if (type.FullName != "System.Windows.Style")
return false;
if (!(arg.MatchLdLoc(out var t) && t.Kind == VariableKind.Parameter && t.Index == 1))
return false;
if (!addCall.Arguments[1].MatchLdLoc(v))
return false;
pos += 4;
return true;
}
bool MatchSimpleEventRegistration(ILInstruction inst, out EventRegistration @event)
{
@event = null;
if (!(inst is CallInstruction call) || call.OpCode == OpCode.NewObj)
return false;
if (!IsAddEvent(call, out string eventName, out string handlerName)
&& !IsAddAttachedEvent(call, out eventName, out handlerName))
{
return false;
}
@event = new EventRegistration { EventName = eventName, MethodName = handlerName };
return true;
}
bool IsAddAttachedEvent(CallInstruction call, out string eventName, out string handlerName)
{
eventName = "";
handlerName = "";
if (call.Arguments.Count == 3)
{
var addMethod = call.Method;
if (addMethod.Name != "AddHandler" || addMethod.Parameters.Count != 2)
return false;
if (!call.Arguments[1].MatchLdsFld(out IField field))
return false;
eventName = field.DeclaringType.Name + "." + field.Name;
if (eventName.EndsWith("Event", StringComparison.Ordinal)
&& eventName.Length > "Event".Length)
{
eventName = eventName.Remove(eventName.Length - "Event".Length);
}
return MatchEventHandlerCreation(call.Arguments[2], out handlerName);
}
return false;
}
bool IsAddEvent(CallInstruction call, out string eventName, out string handlerName)
{
eventName = "";
handlerName = "";
if (call.Arguments.Count == 2)
{
var addMethod = call.Method;
if (!addMethod.Name.StartsWith("add_", StringComparison.Ordinal)
|| addMethod.Parameters.Count != 1)
{
return false;
}
eventName = addMethod.Name.Substring("add_".Length);
return MatchEventHandlerCreation(call.Arguments[1], out handlerName);
}
return false;
}
bool MatchEventHandlerCreation(ILInstruction inst, out string handlerName)
{
handlerName = "";
if (!(inst is NewObj newObj) || newObj.Arguments.Count != 2)
return false;
var ldftn = newObj.Arguments[1];
if (ldftn.OpCode != OpCode.LdFtn && ldftn.OpCode != OpCode.LdVirtFtn)
return false;
handlerName = ((IInstructionWithMethodOperand)ldftn).Method.Name;
handlerName = XamlUtils.EscapeName(handlerName);
return true;
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Rewrite/DocumentRewritePass.cs
================================================
/*
Copyright (c) 2015 Ki
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.Diagnostics;
using System.Linq;
using System.Xml.Linq;
namespace ICSharpCode.BamlDecompiler.Rewrite
{
internal class DocumentRewritePass : IRewritePass
{
public void Run(XamlContext ctx, XDocument document)
{
foreach (var elem in document.Elements(ctx.GetPseudoName("Document")).ToList())
{
if (elem.Elements().Count() != 1)
continue;
var docElem = elem.Elements().Single();
foreach (var attr in elem.Attributes())
{
Debug.Assert(attr.IsNamespaceDeclaration);
attr.Remove();
docElem.Add(attr);
}
elem.ReplaceWith(docElem);
}
}
}
}
================================================
FILE: ICSharpCode.BamlDecompiler/Rewrite/MarkupExtensionRewritePass.cs
================================================
/*
Copyright (c) 2015 Ki
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.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.BamlDecompiler.Xaml;
namespace ICSharpCode.BamlDecompiler.Rewrite
{
internal class MarkupExtensionRewritePass : IRewritePass
{
XName key;
XName ctor;
public void Run(XamlContext ctx, XDocument document)
{
key = ctx.GetKnownNamespace("Key", XamlContext.KnownNamespace_Xaml);
ctor = ctx.GetPseudoName("Ctor");
bool doWork;
do
{
doWork = false;
foreach (var elem in document.Elements())
{
doWork |= ProcessElement(ctx, elem);
}
} while (doWork);
}
bool ProcessElement(XamlContext ctx, XElement elem)
{
bool doWork = false;
foreach (var child in elem.Elements())
{
doWork |= RewriteElement(ctx, elem, child);
doWork |= ProcessElement(ctx, child);
}
return doWork;
}
bool RewriteElement(XamlContext ctx, XElement parent, XElement elem)
{
var type = parent.Annotation();
var property = elem.Annotation();
if (elem.Name != key)
{
if (property == null || type == null)
return false;
if (property.ResolvedMember is IProperty { CanSet: false })
return false;
}
if (elem.Elements().Count() != 1 || elem.Attributes().Any(t => t.Name.Namespace != XNamespace.Xmlns))
return false;
var value = elem.Elements().Single();
if (!CanInlineExt(ctx, value))
return false;
var ext = InlineExtension(ctx, value);
if (ext == null)
return false;
ctx.CancellationToken.ThrowIfCancellationRequested();
var extValue = ext.ToString(ctx, parent);
var attrName = elem.Name;
if (attrName != key)
attrName = property.ToXName(ctx, parent, property.IsAttachedTo(type));
if (!parent.Attributes(attrName).Any())
{
var attr = new XAttribute(attrName, extValue);
var list = new List(parent.Attributes());
if (attrName == key)
list.Insert(0, attr);
else
list.Add(attr);
parent.RemoveAttributes();
parent.ReplaceAttributes(list);
}
elem.Remove();
return true;
}
bool CanInlineExt(XamlContext ctx, XElement ctxElement)
{
var type = ctxElement.Annotation();
if (type != null && type.ResolvedType != null)
{
var typeDef = type.ResolvedType.GetDefinition()?.DirectBaseTypes.FirstOrDefault();
bool isExt = false;
while (typeDef != null)
{
if (typeDef.FullName == "System.Windows.Markup.MarkupExtension")
{
isExt = true;
break;
}
typeDef = typeDef.DirectBaseTypes.FirstOrDefault();
}
if (!isExt)
return false;
}
else if (ctxElement.Annotation() == null &&
ctxElement.Name != ctor)
return false;
foreach (var child in ctxElement.Elements())
{
if (!CanInlineExt(ctx, child))
return false;
}
return true;
}
object InlineObject(XamlContext ctx, XNode obj)
{
if (obj is XText)
return ((XText)obj).Value;
else if (obj is XElement)
return InlineExtension(ctx, (XElement)obj);
else
return null;
}
object[] InlineCtor(XamlContext ctx, XElement ctor)
{
if (ctor.HasAttributes)
return null;
var args = new List