Example #1
0
        /// <inheritdoc/>
        public virtual void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset)
        {
            decompiler.WriteCommentBegin(output, true);
            output.WriteOffsetComment(this, showOffset);
            const string LTR = "\u200E";

            output.Write(NameUtilities.CleanName(Name) + LTR, this, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
            string extra = null;

            switch (Resource.ResourceType)
            {
            case ResourceType.AssemblyLinked:
                extra = ((AssemblyLinkedResource)Resource).Assembly.FullName;
                break;

            case ResourceType.Linked:
                var file = ((LinkedResource)Resource).File;
                extra = string.Format("{0}, {1}, {2}", file.Name, file.ContainsNoMetaData ? "ContainsNoMetaData" : "ContainsMetaData", SimpleTypeConverter.ByteArrayToString(file.HashValue));
                break;

            case ResourceType.Embedded:
                extra = string.Format(dnSpy_Contracts_DnSpy_Resources.NumberOfBytes, ((EmbeddedResource)Resource).Data.Length);
                break;
            }
            output.Write(string.Format(" ({0}{1}, {2})", extra == null ? string.Empty : string.Format("{0}, ", extra), Resource.ResourceType, Resource.Attributes), BoxedTextColor.Comment);
            decompiler.WriteCommentEnd(output, true);
            output.WriteLine();
        }
Example #2
0
        /// <inheritdoc/>
        public virtual void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset)
        {
            decompiler.WriteCommentBegin(output, true);
            output.WriteOffsetComment(this, showOffset);
            const string LTR = "\u200E";

            output.Write(NameUtilities.CleanName(Name) + LTR, this, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
            output.Write($" = {ValueString}", BoxedTextColor.Comment);
            decompiler.WriteCommentEnd(output, true);
            output.WriteLine();
        }
Example #3
0
        public override void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset)
        {
            if (output is IDocumentViewerOutput documentViewerOutput)
            {
                decompiler.WriteCommentBegin(output, true);
                output.WriteOffsetComment(this, showOffset);
                documentViewerOutput.AddUIElement(() => {
                    return(new System.Windows.Controls.Image {
                        Source = imageSource,
                    });
                });
                output.Write(" = ", BoxedTextColor.Comment);
                const string LTR = "\u200E";
                output.Write(NameUtilities.CleanName(Name) + LTR, this, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
                decompiler.WriteCommentEnd(output, true);
                output.WriteLine();
                return;
            }

            base.WriteShort(output, decompiler, showOffset);
        }
Example #4
0
		/// <inheritdoc/>
		public virtual void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset) {
			decompiler.WriteCommentBegin(output, true);
			output.WriteOffsetComment(this, showOffset);
			const string LTR = "\u200E";
			output.Write(NameUtilities.CleanName(Name) + LTR, this, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
			output.Write($" = {ValueString}", BoxedTextColor.Comment);
			decompiler.WriteCommentEnd(output, true);
			output.WriteLine();
		}
Example #5
0
		public override void WriteShort(IDecompilerOutput output, IDecompiler decompiler, bool showOffset) {
			var documentViewerOutput = output as IDocumentViewerOutput;
			if (documentViewerOutput != null) {
				decompiler.WriteCommentBegin(output, true);
				output.WriteOffsetComment(this, showOffset);
				documentViewerOutput.AddUIElement(() => {
					return new System.Windows.Controls.Image {
						Source = imageSource,
					};
				});
				output.Write(" = ", BoxedTextColor.Comment);
				const string LTR = "\u200E";
				output.Write(NameUtilities.CleanName(Name) + LTR, this, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
				decompiler.WriteCommentEnd(output, true);
				output.WriteLine();
				return;
			}

			base.WriteShort(output, decompiler, showOffset);
		}