コード例 #1
0
ファイル: BamlDisassembler.cs プロジェクト: haise0/dnSurgeon
        void DisassembleRecord(BamlContext ctx, BamlRecord record)
        {
            if (BamlNode.IsFooter(record))
            {
                while (scopeStack.Count > 0 && !BamlNode.IsMatch(scopeStack.Peek(), record))
                {
                    scopeStack.Pop();
                    output.DecreaseIndent();
                }
                if (scopeStack.Count > 0)
                {
                    scopeStack.Pop();
                    output.DecreaseIndent();
                }
            }

            output.Write(record.Type.ToString(), BamlToolTipReference.Create(GetRecordReference(record)), DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Keyword);

            if (handlerMap.TryGetValue(record.Type, out var handler))
            {
                output.Write(" [", BoxedTextColor.Text);
                handler(ctx, record);
                output.Write("]", BoxedTextColor.Text);
            }

            output.WriteLine();

            if (BamlNode.IsHeader(record))
            {
                scopeStack.Push(record);
                output.IncreaseIndent();
            }
        }
コード例 #2
0
 void StartKeywordBlock(IDecompilerOutput output, string keyword, IMemberDef member)
 {
     output.Write(keyword, BoxedTextColor.Keyword);
     output.Write(" ", BoxedTextColor.Text);
     output.Write(IdentifierEscaper.Escape(member.Name), member, DecompilerReferenceFlags.Definition, TextColorHelper.GetColor(member));
     output.Write(" ", BoxedTextColor.Text);
     output.Write("{", BoxedTextColor.Punctuation);
     output.WriteLine();
     output.IncreaseIndent();
 }
コード例 #3
0
        BraceInfo StartKeywordBlock(IDecompilerOutput output, string keyword, IMemberDef member)
        {
            output.Write(keyword, BoxedTextColor.Keyword);
            output.Write(" ", BoxedTextColor.Text);
            output.Write(IdentifierEscaper.Escape(member.Name), member, DecompilerReferenceFlags.Definition, MetadataTextColorProvider.GetColor(member));
            output.Write(" ", BoxedTextColor.Text);
            var start = output.NextPosition;

            output.Write("{", BoxedTextColor.Punctuation);
            output.WriteLine();
            output.IncreaseIndent();
            return(new BraceInfo(start));
        }
コード例 #4
0
ファイル: ILAstDecompiler.cs プロジェクト: manojdjoshi/dnSpy
		void StartKeywordBlock(IDecompilerOutput output, string keyword, IMemberDef member) {
			output.Write(keyword, BoxedTextColor.Keyword);
			output.Write(" ", BoxedTextColor.Text);
			output.Write(IdentifierEscaper.Escape(member.Name), member, DecompilerReferenceFlags.Definition, MetadataTextColorProvider.GetColor(member));
			output.Write(" ", BoxedTextColor.Text);
			output.Write("{", BoxedTextColor.Punctuation);
			output.WriteLine();
			output.IncreaseIndent();
		}
 public void IncreaseIndent() => implementation.IncreaseIndent();
コード例 #6
0
 public void Indent() => output.IncreaseIndent();