object Create(IDocumentViewerToolTipProviderContext context, OpCode opCode) { var provider = context.Create(); var s = ILLanguageHelper.GetOpCodeDocumentation(opCode); string opCodeHex = opCode.Size > 1 ? $"0x{opCode.Value:X4}" : $"0x{opCode.Value:X2}"; provider.Output.Write(BoxedTextColor.OpCode, opCode.Name); provider.Output.WriteSpace(); provider.Output.Write(BoxedTextColor.Punctuation, "("); provider.Output.Write(BoxedTextColor.Number, opCodeHex); provider.Output.Write(BoxedTextColor.Punctuation, ")"); if (s is not null) { provider.Output.Write(BoxedTextColor.Text, " - "); provider.Output.Write(BoxedTextColor.Text, s); } return(provider.Create()); }
object Create(IToolTipContentCreatorContext context, OpCode opCode) { var creator = context.Create(); var s = ILLanguageHelper.GetOpCodeDocumentation(opCode); string opCodeHex = opCode.Size > 1 ? string.Format("0x{0:X4}", opCode.Value) : string.Format("0x{0:X2}", opCode.Value); creator.Output.Write(opCode.Name, TextTokenKind.OpCode); creator.Output.WriteSpace(); creator.Output.Write("(", TextTokenKind.Operator); creator.Output.Write(opCodeHex, TextTokenKind.Number); creator.Output.Write(")", TextTokenKind.Operator); if (s != null) { creator.Output.Write(" - ", TextTokenKind.Text); creator.Output.Write(s, TextTokenKind.Text); } return(creator.Create()); }