Initial project

This commit is contained in:
Merijn Hendriks 2021-09-20 18:20:01 +02:00
commit 3d7a16393f
4550 changed files with 715797 additions and 0 deletions

112
.editorconfig Normal file
View File

@ -0,0 +1,112 @@
root = true
[*]
charset = utf-8
#end_of_line =
indent_size = 4
indent_style = tab
tab_width = 4
[*.json]
[app.config]
[*.yml]
indent_size = 2
indent_style = space
[*.{proj,csproj,vbproj,props,targets,resx,vsixmanifest}]
indent_size = 2
indent_style = space
[app.manifest]
indent_size = 2
indent_style = space
[*.xml]
[*.xaml]
indent_style = space
[*.{cs,vb}]
insert_final_newline = true
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:none
dotnet_style_predefined_type_for_member_access = true:none
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_require_accessibility_modifiers = never:info
[*.cs]
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = flush_left
csharp_indent_switch_labels = false
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = none
csharp_new_line_between_query_expression_clauses = true
csharp_prefer_braces = false
csharp_prefer_simple_default_expression = true:suggestion
#csharp_preferred_modifier_order =
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
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 =
csharp_space_between_square_brackets = false
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_deconstructed_variable_declaration = false:none
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_var_elsewhere = true:suggestion
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = true:suggestion
[*.vb]
#visual_basic_preferred_modifier_order =

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
.vs/
bin/
obj/
*.user
_ReSharper*/
*.ReSharper
*_wpftmp.csproj
launchSettings.json
.idea/

21
.gitmodules vendored Normal file
View File

@ -0,0 +1,21 @@
[submodule "Plugins/ILSpy.Decompiler/NRefactory"]
path = Extensions/ILSpy.Decompiler/NRefactory
url = https://github.com/dnSpy/nrefactory.git
[submodule "Libraries/ICSharpCode.TreeView"]
path = Libraries/ICSharpCode.TreeView
url = https://github.com/dnSpy/ICSharpCode.TreeView.git
[submodule "Plugins/ILSpy.Decompiler/ICSharpCode.Decompiler"]
path = Extensions/ILSpy.Decompiler/ICSharpCode.Decompiler
url = https://github.com/dnSpy/ILSpy.git
[submodule "dnSpy/dnSpy.Images"]
path = dnSpy/dnSpy.Images
url = https://github.com/dnSpy/dnSpy.Images.git
[submodule "Extensions/dnSpy.Debugger/netcorefiles"]
path = Extensions/dnSpy.Debugger/netcorefiles
url = https://github.com/dnSpy/netcorefiles.git
[submodule "dnSpy/Roslyn/Roslyn.ExpressionCompiler"]
path = dnSpy/Roslyn/Roslyn.ExpressionCompiler
url = https://github.com/dnSpy/Roslyn.ExpressionCompiler.git
[submodule "Extensions/dnSpy.Debugger/Mono.Debugger.Soft"]
path = Extensions/dnSpy.Debugger/Mono.Debugger.Soft
url = https://github.com/dnSpy/Mono.Debugger.Soft.git

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\DnSpyCommon.props" />
<PropertyGroup>
<Copyright>$(DnSpyAssemblyCopyright)</Copyright>
<Version>$(DnSpyAssemblyVersion)</Version>
<InformationalVersion>$(DnSpyAssemblyInformationalVersion)</InformationalVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\dnSpy.snk</AssemblyOriginatorKeyFile>
<Nullable>enable</Nullable>
<RuntimeIdentifiers>$(DnSpyRuntimeIdentifiers)</RuntimeIdentifiers>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,133 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
namespace AppHostPatcher {
class Program {
static void Usage() {
Console.WriteLine("apphostpatcher <apphostexe> <origdllpath> <newdllpath>");
Console.WriteLine("apphostpatcher <apphostexe> <newdllpath>");
Console.WriteLine("apphostpatcher <apphostexe> -d <newsubdir>");
Console.WriteLine("example: apphostpatcher my.exe -d bin");
}
const int maxPathBytes = 1024;
static string ChangeExecutableExtension(string apphostExe) =>
// Windows apphosts have an .exe extension. Don't call Path.ChangeExtension() unless it's guaranteed
// to have an .exe extension, eg. 'some.file' => 'some.file.dll', not 'some.dll'
apphostExe.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) ? Path.ChangeExtension(apphostExe, ".dll") : apphostExe + ".dll";
static string GetPathSeparator(string apphostExe) =>
apphostExe.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) ? @"\" : "/";
static int Main(string[] args) {
try {
string apphostExe, origPath, newPath;
if (args.Length == 3) {
if (args[1] == "-d") {
apphostExe = args[0];
origPath = Path.GetFileName(ChangeExecutableExtension(apphostExe));
newPath = args[2] + GetPathSeparator(apphostExe) + origPath;
}
else {
apphostExe = args[0];
origPath = args[1];
newPath = args[2];
}
}
else if (args.Length == 2) {
apphostExe = args[0];
origPath = Path.GetFileName(ChangeExecutableExtension(apphostExe));
newPath = args[1];
}
else {
Usage();
return 1;
}
if (!File.Exists(apphostExe)) {
Console.WriteLine($"Apphost '{apphostExe}' does not exist");
return 1;
}
if (origPath == string.Empty) {
Console.WriteLine("Original path is empty");
return 1;
}
var origPathBytes = Encoding.UTF8.GetBytes(origPath + "\0");
Debug.Assert(origPathBytes.Length > 0);
var newPathBytes = Encoding.UTF8.GetBytes(newPath + "\0");
if (origPathBytes.Length > maxPathBytes) {
Console.WriteLine($"Original path is too long");
return 1;
}
if (newPathBytes.Length > maxPathBytes) {
Console.WriteLine($"New path is too long");
return 1;
}
var apphostExeBytes = File.ReadAllBytes(apphostExe);
int offset = GetOffset(apphostExeBytes, origPathBytes);
if (offset < 0) {
Console.WriteLine($"Could not find original path '{origPath}'");
return 1;
}
if (offset + newPathBytes.Length > apphostExeBytes.Length) {
Console.WriteLine($"New path is too long: {newPath}");
return 1;
}
for (int i = 0; i < newPathBytes.Length; i++)
apphostExeBytes[offset + i] = newPathBytes[i];
File.WriteAllBytes(apphostExe, apphostExeBytes);
return 0;
}
catch (Exception ex) {
Console.WriteLine(ex.ToString());
return 1;
}
}
static int GetOffset(byte[] bytes, byte[] pattern) {
int si = 0;
var b = pattern[0];
while (si < bytes.Length) {
si = Array.IndexOf(bytes, b, si);
if (si < 0)
break;
if (Match(bytes, si, pattern))
return si;
si++;
}
return -1;
}
static bool Match(byte[] bytes, int index, byte[] pattern) {
if (index + pattern.Length > bytes.Length)
return false;
for (int i = 0; i < pattern.Length; i++) {
if (bytes[index + i] != pattern[i])
return false;
}
return true;
}
}
}

View File

@ -0,0 +1,202 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using dnlib.DotNet;
using dnlib.DotNet.Writer;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace ConvertToNetstandardReferences {
public sealed class ConvertToNetstandardReferences : Task {
// Increment it if something changes so the files are re-created
const string VERSION = "cnsrefs_v1";
#pragma warning disable CS8618 // Non-nullable field is uninitialized.
[Required]
public string DestinationDirectory { get; set; }
[Required]
public ITaskItem[] ReferencePath { get; set; }
[Output]
public ITaskItem[] OutputReferencePath { get; private set; }
#pragma warning restore CS8618 // Non-nullable field is uninitialized.
bool ShouldPatchAssembly(string simpleName) {
if (simpleName.StartsWith("Microsoft.VisualStudio."))
return true;
return false;
}
static bool IsPublic(TypeDef type) {
while (type is not null) {
if (!type.IsPublic && !type.IsNestedPublic)
return false;
type = type.DeclaringType;
}
return true;
}
static bool IsPublic(ExportedType type) {
while (type is not null) {
if (!type.IsPublic && !type.IsNestedPublic)
return false;
type = type.DeclaringType;
}
return true;
}
public override bool Execute() {
if (string.IsNullOrWhiteSpace(DestinationDirectory)) {
Log.LogMessageFromText(nameof(DestinationDirectory) + " is an empty string", MessageImportance.High);
return false;
}
using (var assemblyFactory = new AssemblyFactory(ReferencePath.Select(a => a.ItemSpec))) {
AssemblyRef? netstandardAsmRef = null;
AssemblyDef? netstandardAsm = null;
var typeComparer = new TypeEqualityComparer(SigComparerOptions.DontCompareTypeScope);
var netstandardTypes = new HashSet<IType>(typeComparer);
OutputReferencePath = new ITaskItem[ReferencePath.Length];
for (int i = 0; i < ReferencePath.Length; i++) {
var file = ReferencePath[i];
OutputReferencePath[i] = file;
var filename = file.ItemSpec;
var fileExt = Path.GetExtension(filename);
var asmSimpleName = Path.GetFileNameWithoutExtension(filename);
if (!ShouldPatchAssembly(asmSimpleName))
continue;
if (!File.Exists(filename)) {
Log.LogMessageFromText($"File does not exist: {filename}", MessageImportance.High);
return false;
}
var patchDir = DestinationDirectory;
Directory.CreateDirectory(patchDir);
var fileInfo = new FileInfo(filename);
long filesize = fileInfo.Length;
long writeTime = fileInfo.LastWriteTimeUtc.ToBinary();
var extraInfo = $"_{VERSION} {filesize} {writeTime}_";
var patchedFilename = Path.Combine(patchDir, asmSimpleName + extraInfo + fileExt);
if (StringComparer.OrdinalIgnoreCase.Equals(patchedFilename, filename))
continue;
if (!File.Exists(patchedFilename)) {
var asm = assemblyFactory.Resolve(asmSimpleName);
if (asm is null)
throw new Exception($"Couldn't resolve assembly {filename}");
var mod = (ModuleDefMD)asm.ManifestModule;
if (!ShouldPatchAssembly(mod))
continue;
if (netstandardAsm is null) {
netstandardAsm = assemblyFactory.Resolve("netstandard");
if (netstandardAsm is null)
throw new Exception("Couldn't find a netstandard file");
netstandardAsmRef = netstandardAsm.ToAssemblyRef();
foreach (var type in netstandardAsm.ManifestModule.GetTypes()) {
if (type.IsGlobalModuleType)
continue;
if (IsPublic(type))
netstandardTypes.Add(type);
}
foreach (var type in netstandardAsm.ManifestModule.ExportedTypes)
netstandardTypes.Add(type);
}
for (uint rid = 1; ; rid++) {
var tr = mod.ResolveTypeRef(rid);
if (tr is null)
break;
if (!netstandardTypes.Contains(tr))
continue;
if (tr.ResolutionScope is AssemblyRef asmRef && CanReplaceAssemblyRef(asmRef))
tr.ResolutionScope = netstandardAsmRef;
}
var options = new ModuleWriterOptions(mod);
mod.Write(patchedFilename, options);
var xmlDocFile = Path.ChangeExtension(filename, "xml");
if (File.Exists(xmlDocFile)) {
var newXmlDocFile = Path.ChangeExtension(patchedFilename, "xml");
if (File.Exists(newXmlDocFile))
File.Delete(newXmlDocFile);
File.Copy(xmlDocFile, newXmlDocFile);
}
}
OutputReferencePath[i] = new TaskItem(patchedFilename);
}
return true;
}
}
static bool CanReplaceAssemblyRef(AssemblyRef asmRef) => true;
static bool ShouldPatchAssembly(ModuleDefMD mod) {
foreach (var asmRef in mod.GetAssemblyRefs()) {
string name = asmRef.Name;
if (name == "netstandard")
return false;
}
return true;
}
}
sealed class AssemblyFactory : IAssemblyResolver, IDisposable {
readonly Dictionary<string, ModuleDef> modules;
readonly Dictionary<string, string> nameToPath;
readonly ModuleContext context;
public AssemblyFactory(IEnumerable<string> filenames) {
modules = new Dictionary<string, ModuleDef>(StringComparer.Ordinal);
nameToPath = filenames.ToDictionary(key => Path.GetFileNameWithoutExtension(key), value => value, StringComparer.Ordinal);
context = new ModuleContext(this, new Resolver(this));
}
AssemblyDef? IAssemblyResolver.Resolve(IAssembly assembly, ModuleDef sourceModule) =>
Resolve(assembly.Name);
public AssemblyDef? Resolve(string name) {
if (modules.TryGetValue(name, out var module))
return module.Assembly;
if (!nameToPath.TryGetValue(name, out var path))
return null;
var options = new ModuleCreationOptions(context);
options.TryToLoadPdbFromDisk = false;
module = ModuleDefMD.Load(path, options);
modules.Add(name, module);
return module.Assembly ?? throw new InvalidOperationException("It's a netmodule");
}
public void Dispose() {
foreach (var module in modules)
module.Value.Dispose();
}
}
}

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\DnSpyCommon.props" />
<PropertyGroup>
<!-- It should only use netstandard. netxxx/netcorappx.x are added here so dotnet build
with a '-f netxxx/netcorappx.x' arg can be used without failing the build -->
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>
<Copyright>$(DnSpyAssemblyCopyright)</Copyright>
<Version>$(DnSpyAssemblyVersion)</Version>
<InformationalVersion>$(DnSpyAssemblyInformationalVersion)</InformationalVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\dnSpy.snk</AssemblyOriginatorKeyFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dnlib" Version="$(DnlibVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MSBuildNuGetVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MSBuildNuGetVersion)" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project>
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\compiled\ConvertToNetstandardReferences.dll" TaskName="ConvertToNetstandardReferences.ConvertToNetstandardReferences" />
<Target Name="ConvertToNetstandardReferences" AfterTargets="ResolveAssemblyReferences">
<ConvertToNetstandardReferences ReferencePath="@(ReferencePath)" DestinationDirectory="$(IntermediateOutputPath)ConvertToNetstandardReferences">
<Output ItemName="_ConvertToNetstandardReferences_OutputReferencePath" TaskParameter="OutputReferencePath" />
</ConvertToNetstandardReferences>
<ItemGroup>
<ReferencePath Remove="@(ReferencePath)" />
<ReferencePath Include="@(_ConvertToNetstandardReferences_OutputReferencePath)" />
</ItemGroup>
</Target>
</Project>

View File

@ -0,0 +1,194 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
// This code patches an assembly's System.Runtime.CompilerServices.InternalsVisibleToAttribute
// so the string passed to the attribute constructor is the name of another assembly.
// If there's no such attribute or if the new string doesn't fit in the old string, this code fails.
// If it happens, use a smaller public key and/or a shorter assembly name and use no spaces
// or don't use PublicKey=xxxx... (since Roslyn C# compiler seems to ignore the public key).
//
// A more generic patcher would rewrite some of the metadata tables but this isn't needed since
// we only use it to patch Roslyn assemblies which contain a ton of IVT attributes.
//
// PERF is the same as copying a file since it just patches the data in memory, nothing is rewritten.
using System;
using dnlib.DotNet;
using dnlib.DotNet.MD;
using dnlib.IO;
namespace MakeEverythingPublic {
enum IVTPatcherResult {
OK,
NoCustomAttributes,
NoIVTs,
IVTBlobTooSmall,
}
struct IVTPatcher {
// Prefer overwriting IVTs with this public key since they're just test assemblies
const string ROSLYN_OPEN_SOURCE_PUBLIC_KEY = "002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2";
readonly byte[] data;
readonly Metadata md;
readonly byte[] ivtBlob;
public IVTPatcher(byte[] data, Metadata md, byte[] ivtBlob) {
this.data = data;
this.md = md;
this.ivtBlob = ivtBlob;
}
public IVTPatcherResult Patch() {
var rids = md.GetCustomAttributeRidList(Table.Assembly, 1);
if (rids.Count == 0)
return IVTPatcherResult.NoCustomAttributes;
if (FindIVT(rids, out var foundIVT, out uint ivtBlobOffset)) {
Array.Copy(ivtBlob, 0, data, ivtBlobOffset, ivtBlob.Length);
return IVTPatcherResult.OK;
}
if (!foundIVT)
return IVTPatcherResult.NoIVTs;
return IVTPatcherResult.IVTBlobTooSmall;
}
bool FindIVT(RidList rids, out bool foundIVT, out uint ivtBlobDataOffset) {
ivtBlobDataOffset = 0;
foundIVT = false;
uint otherIVTBlobOffset = uint.MaxValue;
var blobStream = md.BlobStream.CreateReader();
var tbl = md.TablesStream.CustomAttributeTable;
uint baseOffset = (uint)tbl.StartOffset;
var columnType = tbl.Columns[1];
var columnValue = tbl.Columns[2];
for (int i = 0; i < rids.Count; i++) {
uint rid = rids[i];
uint offset = baseOffset + (rid - 1) * tbl.RowSize;
uint type = ReadColumn(columnType, offset);
if (!IsIVTCtor(type))
continue;
foundIVT = true;
uint blobOffset = ReadColumn(columnValue, offset);
if (blobOffset + ivtBlob.Length > blobStream.Length)
continue;
blobStream.Position = blobOffset;
if (!blobStream.TryReadCompressedUInt32(out uint len))
continue;
var compressedSize = blobStream.Position - blobOffset;
if (compressedSize + len < ivtBlob.Length)
continue;
if (!ParseIVTBlob(ref blobStream, blobStream.Position + len, out var publicKeyString))
continue;
if (StringComparer.OrdinalIgnoreCase.Equals(publicKeyString, ROSLYN_OPEN_SOURCE_PUBLIC_KEY)) {
ivtBlobDataOffset = (uint)md.BlobStream.StartOffset + blobOffset;
return true;
}
else
otherIVTBlobOffset = (uint)md.BlobStream.StartOffset + blobOffset;
}
if (otherIVTBlobOffset != uint.MaxValue) {
ivtBlobDataOffset = otherIVTBlobOffset;
return true;
}
return false;
}
static bool ParseIVTBlob(ref DataReader reader, uint end, out string? publicKeyString) {
publicKeyString = null;
if ((ulong)reader.Position + 2 > end)
return false;
if (reader.ReadUInt16() != 1)
return false;
if (!reader.TryReadCompressedUInt32(out uint len) || (ulong)reader.Position + len >= end)
return false;
var s = reader.ReadUtf8String((int)len);
const string PublicKeyPattern = "PublicKey=";
int index = s.IndexOf(PublicKeyPattern, StringComparison.OrdinalIgnoreCase);
if (index >= 0)
publicKeyString = s.Substring(index + PublicKeyPattern.Length).Trim();
return true;
}
bool IsIVTCtor(uint codedType) {
if (!CodedToken.CustomAttributeType.Decode(codedType, out MDToken ctor))
return false;
switch (ctor.Table) {
case Table.Method:
uint declTypeDefToken = md.GetOwnerTypeOfMethod(ctor.Rid);
return IsIVT_TypeDef(declTypeDefToken);
case Table.MemberRef:
if (!md.TablesStream.TryReadMemberRefRow(ctor.Rid, out var memberRefRow))
return false;
if (!CodedToken.MemberRefParent.Decode(memberRefRow.Class, out MDToken parentToken))
return false;
switch (parentToken.Table) {
case Table.TypeDef:
return IsIVT_TypeDef(parentToken.Rid);
case Table.TypeRef:
return IsIVT_TypeRef(parentToken.Rid);
case Table.TypeSpec:
default:
return false;
}
default:
return false;
}
}
bool IsIVT_TypeRef(uint typeRefRid) {
if (!md.TablesStream.TryReadTypeRefRow(typeRefRid, out var typeRefRow))
return false;
if (!CodedToken.ResolutionScope.Decode(typeRefRow.ResolutionScope, out MDToken scope) || scope.Table == Table.TypeRef)
return false;
return IsIVTCtor(typeRefRow.Namespace, typeRefRow.Name);
}
bool IsIVT_TypeDef(uint typeDefRid) {
if (!md.TablesStream.TryReadTypeDefRow(typeDefRid, out var typeDefRow))
return false;
if ((typeDefRow.Flags & (uint)TypeAttributes.VisibilityMask) >= (uint)TypeAttributes.NestedPublic)
return false;
return IsIVTCtor(typeDefRow.Namespace, typeDefRow.Name);
}
bool IsIVTCtor(uint @namespace, uint name) =>
md.StringsStream.ReadNoNull(name) == InternalsVisibleToAttribute &&
md.StringsStream.ReadNoNull(@namespace) == System_Runtime_CompilerServices;
static readonly UTF8String System_Runtime_CompilerServices = new UTF8String("System.Runtime.CompilerServices");
static readonly UTF8String InternalsVisibleToAttribute = new UTF8String("InternalsVisibleToAttribute");
uint ReadColumn(ColumnInfo column, uint columnOffset) {
columnOffset += (uint)column.Offset;
switch (column.Size) {
case 1: return data[columnOffset];
case 2: return data[columnOffset++] | ((uint)data[columnOffset] << 8);
case 4: return data[columnOffset++] | ((uint)data[columnOffset++] << 8) | ((uint)data[columnOffset++] << 16) | ((uint)data[columnOffset] << 24);
default: throw new InvalidOperationException();
}
}
}
}

View File

@ -0,0 +1,211 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using dnlib.DotNet.MD;
using dnlib.PE;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace MakeEverythingPublic {
public sealed class MakeEverythingPublic : Task {
// Increment it if something changes so the files are re-created
const string VERSION = "v1";
#pragma warning disable CS8618 // Non-nullable field is uninitialized.
[Required]
public string IVTString { get; set; }
[Required]
public string DestinationDirectory { get; set; }
[Required]
public string AssembliesToMakePublic { get; set; }
[Required]
public ITaskItem[] ReferencePath { get; set; }
[Output]
public ITaskItem[] OutputReferencePath { get; private set; }
#pragma warning restore CS8618 // Non-nullable field is uninitialized.
public override bool Execute() {
if (string.IsNullOrWhiteSpace(IVTString)) {
Log.LogMessageFromText(nameof(IVTString) + " is an empty string", MessageImportance.High);
return false;
}
if (string.IsNullOrWhiteSpace(DestinationDirectory)) {
Log.LogMessageFromText(nameof(DestinationDirectory) + " is an empty string", MessageImportance.High);
return false;
}
var assembliesToFix = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var tmp in AssembliesToMakePublic.Split(';')) {
var asmName = tmp.Trim();
var asmSimpleName = asmName;
int index = asmSimpleName.IndexOf(',');
if (index >= 0)
asmSimpleName = asmSimpleName.Substring(0, index).Trim();
if (asmSimpleName.Length == 0)
continue;
assembliesToFix.Add(asmSimpleName);
}
OutputReferencePath = new ITaskItem[ReferencePath.Length];
byte[]? ivtBlob = null;
for (int i = 0; i < ReferencePath.Length; i++) {
var file = ReferencePath[i];
OutputReferencePath[i] = file;
var filename = file.ItemSpec;
var fileExt = Path.GetExtension(filename);
var asmSimpleName = Path.GetFileNameWithoutExtension(filename);
if (!assembliesToFix.Contains(asmSimpleName))
continue;
if (!File.Exists(filename)) {
Log.LogMessageFromText($"File does not exist: {filename}", MessageImportance.High);
return false;
}
var patchDir = DestinationDirectory;
Directory.CreateDirectory(patchDir);
var fileInfo = new FileInfo(filename);
long filesize = fileInfo.Length;
long writeTime = fileInfo.LastWriteTimeUtc.ToBinary();
var extraInfo = $"_{VERSION} {filesize} {writeTime}_";
var patchedFilename = Path.Combine(patchDir, asmSimpleName + extraInfo + fileExt);
if (StringComparer.OrdinalIgnoreCase.Equals(patchedFilename, filename))
continue;
if (!File.Exists(patchedFilename)) {
if (ivtBlob is null)
ivtBlob = CreateIVTBlob(IVTString);
var data = File.ReadAllBytes(filename);
try {
using (var peImage = new PEImage(data, filename, ImageLayout.File, verify: true)) {
using (var md = MetadataFactory.CreateMetadata(peImage, verify: true)) {
var result = new IVTPatcher(data, md, ivtBlob).Patch();
if (result != IVTPatcherResult.OK) {
string errMsg;
switch (result) {
case IVTPatcherResult.NoCustomAttributes:
errMsg = $"Assembly '{asmSimpleName}' has no custom attributes";
break;
case IVTPatcherResult.NoIVTs:
errMsg = $"Assembly '{asmSimpleName}' has no InternalsVisibleToAttributes";
break;
case IVTPatcherResult.IVTBlobTooSmall:
errMsg = $"Assembly '{asmSimpleName}' has no InternalsVisibleToAttribute blob that is big enough to store '{IVTString}'. Use a shorter assembly name and/or a shorter public key, or skip PublicKey=xxxx... altogether (if it's a C# assembly)";
break;
default:
Debug.Fail($"Unknown error result: {result}");
errMsg = "Unknown error";
break;
}
Log.LogMessageFromText(errMsg, MessageImportance.High);
return false;
}
try {
File.WriteAllBytes(patchedFilename, data);
}
catch {
try { File.Delete(patchedFilename); } catch { }
throw;
}
}
}
}
catch (Exception ex) when (ex is IOException || ex is BadImageFormatException) {
Log.LogMessageFromText($"File '{filename}' is not a .NET file", MessageImportance.High);
return false;
}
var xmlDocFile = Path.ChangeExtension(filename, "xml");
if (File.Exists(xmlDocFile)) {
var newXmlDocFile = Path.ChangeExtension(patchedFilename, "xml");
if (File.Exists(newXmlDocFile))
File.Delete(newXmlDocFile);
File.Copy(xmlDocFile, newXmlDocFile);
}
}
OutputReferencePath[i] = new TaskItem(patchedFilename);
}
return true;
}
static byte[] CreateIVTBlob(string newIVTString) {
var caStream = new MemoryStream();
var caWriter = new BinaryWriter(caStream);
caWriter.Write((ushort)1);
WriteString(caWriter, newIVTString);
caWriter.Write((ushort)0);
var newIVTBlob = caStream.ToArray();
var compressedSize = GetCompressedUInt32Bytes((uint)newIVTBlob.Length);
var blob = new byte[compressedSize + newIVTBlob.Length];
var blobStream = new MemoryStream(blob);
var blobWriter = new BinaryWriter(blobStream);
WriteCompressedUInt32(blobWriter, (uint)newIVTBlob.Length);
blobWriter.Write(newIVTBlob);
if (blobWriter.BaseStream.Position != blob.Length)
throw new InvalidOperationException();
return blob;
}
static void WriteString(BinaryWriter writer, string s) {
var bytes = Encoding.UTF8.GetBytes(s);
WriteCompressedUInt32(writer, (uint)bytes.Length);
writer.Write(bytes);
}
static void WriteCompressedUInt32(BinaryWriter writer, uint value) {
if (value <= 0x7F)
writer.Write((byte)value);
else if (value <= 0x3FFF) {
writer.Write((byte)((value >> 8) | 0x80));
writer.Write((byte)value);
}
else if (value <= 0x1FFFFFFF) {
writer.Write((byte)((value >> 24) | 0xC0));
writer.Write((byte)(value >> 16));
writer.Write((byte)(value >> 8));
writer.Write((byte)value);
}
else
throw new ArgumentOutOfRangeException("UInt32 value can't be compressed");
}
static uint GetCompressedUInt32Bytes(uint value) {
if (value <= 0x7F)
return 1;
if (value <= 0x3FFF)
return 2;
else if (value <= 0x1FFFFFFF)
return 4;
throw new ArgumentOutOfRangeException("UInt32 value can't be compressed");
}
}
}

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\DnSpyCommon.props" />
<PropertyGroup>
<!-- It should only use netstandard. netxxx/netcorappx.x are added here so dotnet build
with a '-f netxxx/netcorappx.x' arg can be used without failing the build -->
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>
<Copyright>$(DnSpyAssemblyCopyright)</Copyright>
<Version>$(DnSpyAssemblyVersion)</Version>
<InformationalVersion>$(DnSpyAssemblyInformationalVersion)</InformationalVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\dnSpy.snk</AssemblyOriginatorKeyFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="dnlib" Version="$(DnlibVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MSBuildNuGetVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MSBuildNuGetVersion)" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,22 @@
<Project>
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\compiled\MakeEverythingPublic.dll" TaskName="MakeEverythingPublic.MakeEverythingPublic" />
<Target Name="MakeEverythingPublic" AfterTargets="ResolveAssemblyReferences">
<MakeEverythingPublic AssembliesToMakePublic="$(MakeEverythingPublicAssemblies)" ReferencePath="@(ReferencePath)" DestinationDirectory="$(IntermediateOutputPath)MakeEverythingPublic" IVTString="$(MakeEverythingPublicIVTString)">
<Output ItemName="_MakeEverythingPublic_OutputReferencePath" TaskParameter="OutputReferencePath" />
</MakeEverythingPublic>
<ItemGroup>
<ReferencePath Remove="@(ReferencePath)" />
<ReferencePath Include="@(_MakeEverythingPublic_OutputReferencePath)" />
</ItemGroup>
</Target>
<!-- https://github.com/dotnet/project-system/blob/master/docs/design-time-builds.md#targets-that-run-during-design-time-builds -->
<Target Name="MakeEverythingPublicDesignTime" AfterTargets="ResolveAssemblyReferencesDesignTime">
<MakeEverythingPublic AssembliesToMakePublic="$(MakeEverythingPublicAssemblies)" ReferencePath="@(ReferencePath)" DestinationDirectory="$(IntermediateOutputPath)MakeEverythingPublic" IVTString="$(MakeEverythingPublicIVTString)">
<Output ItemName="_MakeEverythingPublic_OutputReferencePathDesignTime" TaskParameter="OutputReferencePath" />
</MakeEverythingPublic>
<ItemGroup>
<ReferencePath Remove="@(ReferencePath)" />
<ReferencePath Include="@(_MakeEverythingPublic_OutputReferencePathDesignTime)" />
</ItemGroup>
</Target>
</Project>

Binary file not shown.

Binary file not shown.

BIN
Build/compiled/dnlib.dll Normal file

Binary file not shown.

2
Directory.Build.props Normal file
View File

@ -0,0 +1,2 @@
<Project>
</Project>

43
Directory.Build.targets Normal file
View File

@ -0,0 +1,43 @@
<Project>
<ItemGroup>
<!-- Remove unwanted files, eg. resources of unused files, unused native files -->
<GarbageFile Include="cs\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="de\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="es\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="fr\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="it\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="ja\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="ko\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="pl\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="pt-BR\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="ru\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="tr\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="zh-Hans\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="zh-Hant\Microsoft.CodeAnalysis.Workspaces.Desktop.resources.dll" />
<GarbageFile Include="Microsoft.CodeAnalysis.Workspaces.Desktop.dll" />
<GarbageFile Include="Microsoft.CodeAnalysis.Workspaces.Desktop.pdb" />
<GarbageFile Include="SQLitePCLRaw.batteries_green.dll" />
<GarbageFile Include="SQLitePCLRaw.batteries_v2.dll" />
<GarbageFile Include="SQLitePCLRaw.core.dll" />
<GarbageFile Include="SQLitePCLRaw.provider.e_sqlite3.dll" />
<GarbageFile Include="e_sqlite3.dll" />
<GarbageFile Include="x64\e_sqlite3.dll" />
<GarbageFile Include="x86\e_sqlite3.dll" />
<GarbageDir Include="x86" />
<GarbageDir Include="x64" />
<GarbageDir Include="ja" />
<GarbageDir Include="ko" />
<GarbageDir Include="pl" />
<GarbageDir Include="zh-Hans" />
<GarbageDir Include="zh-Hant" />
<GarbageDir Include="runtimes" Condition=" '$(IsDotNetFramework)' == 'true' " />
</ItemGroup>
<Target Name="MyRemoveGarbageFiles_AfterBuild" AfterTargets="AfterBuild">
<Delete Files="$(OutputPath)%(GarbageFile.Identity)" ContinueOnError="WarnAndContinue" />
<RemoveDir Directories="$(OutputPath)%(GarbageDir.Identity)" ContinueOnError="WarnAndContinue" />
</Target>
<Target Name="MyRemoveGarbageFiles_Publish" AfterTargets="Publish">
<Delete Files="$(PublishDir)%(GarbageFile.Identity)" ContinueOnError="WarnAndContinue" />
<RemoveDir Directories="$(PublishDir)%(GarbageDir.Identity)" ContinueOnError="WarnAndContinue" />
</Target>
</Project>

60
DnSpyCommon.props Normal file
View File

@ -0,0 +1,60 @@
<Project>
<PropertyGroup>
<!--
- build.ps1
- .github/workflows/build.yml
NOTE: Update the ABOVE files when TargetFrameworks is updated -->
<TargetFrameworks>net48;net5.0-windows</TargetFrameworks>
<IsDotNetFramework>false</IsDotNetFramework>
<IsDotNet>false</IsDotNet>
<IsSelfContainedDotNet>false</IsSelfContainedDotNet>
<IsDotNetFramework Condition=" $(TargetFramework.StartsWith(net4)) ">true</IsDotNetFramework>
<IsDotNet Condition=" !$(TargetFramework.StartsWith(net4)) ">false</IsDotNet>
<IsSelfContainedDotNet Condition=" '$(IsDotNet)' == 'true' ">true</IsSelfContainedDotNet>
<Features>strict;nullablePublicOnly</Features>
<LangVersion>latest</LangVersion>
<LangVersion Condition=" $(MSBuildProjectFile.EndsWith('.vbproj')) " >latest</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<AppDesignerFolderContentsVisibleOnlyInShowAllFiles>false</AppDesignerFolderContentsVisibleOnlyInShowAllFiles>
<!-- Make sure we don't have to publish each extension to get all their refs -->
<CopyLocalLockFileAssemblies Condition=" '$(IsDotNet)' == 'true' ">true</CopyLocalLockFileAssemblies>
<!-- If this gets updated, also update .github/workflows/build.yml and build.ps1 -->
<DnSpyRuntimeIdentifiers>win-x86;win-x64</DnSpyRuntimeIdentifiers>
<SatelliteResourceLanguages>cs;de;es;es-ES;fa;fr;hu;it;pt-BR;pt-PT;ru;tr;uk;zh-CN</SatelliteResourceLanguages>
<!-- Update app.config whenever this value changes -->
<DnSpyAssemblyVersion>6.1.8.0</DnSpyAssemblyVersion>
<!-- This is shown in the title bar -->
<DnSpyAssemblyInformationalVersion>v6.1.8</DnSpyAssemblyInformationalVersion>
<DnSpyAssemblyCopyright>Copyright (C) 2014-2020 de4dot@gmail.com</DnSpyAssemblyCopyright>
<!-- AD0001: buggy Roslyn analyzer(s) crash, disable that warning -->
<NoWarn>NU1701;AD0001</NoWarn>
<NoWarn Condition=" '$(IsDotNetFramework)' == 'true' ">$(NoWarn);CS8767</NoWarn>
<!-- Update app.config whenever some of these versions change (eg. dnlib version) -->
<DiaSymReaderVersion>1.7.0</DiaSymReaderVersion>
<DnlibVersion>3.3.2</DnlibVersion>
<IcedVersion>1.9.0</IcedVersion>
<MSBuildNuGetVersion>16.7.0</MSBuildNuGetVersion>
<MSDiagRuntimeVersion>1.1.142101</MSDiagRuntimeVersion>
<MSVSCompositionVersion>16.4.11</MSVSCompositionVersion>
<MSVSIntellisenseVersion>15.5.27130</MSVSIntellisenseVersion>
<MSVSTextVersion>15.5.27130</MSVSTextVersion>
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
<OokiiDialogsWpfVersion>3.0.1</OokiiDialogsWpfVersion>
<RoslynVersion>2.10.0</RoslynVersion>
<SCCompositionVersion>4.6.0</SCCompositionVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)Build\ConvertToNetstandardReferences\ConvertToNetstandardReferences.tasks" Condition=" '$(IsDotNet)' == 'true' " />
<!-- .NET 5.0 SDK doesn't currently support COMReference: https://github.com/dnSpy/dnSpy/issues/1053 -->
<PropertyGroup>
<HasCOMReference>false</HasCOMReference>
<HasCOMReference Condition=" '$(MSBuildRuntimeType)' != 'Core' ">true</HasCOMReference>
<DefineConstants Condition=" '$(HasCOMReference)' == 'true' ">$(DefineConstants);HAS_COMREFERENCE</DefineConstants>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,155 @@
using System;
using System.ComponentModel.Composition;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Input;
using dnlib.DotNet;
using dnSpy.Contracts.Controls;
using dnSpy.Contracts.Documents.Tabs.DocViewer;
using dnSpy.Contracts.Extension;
using dnSpy.Contracts.Menus;
using Microsoft.VisualStudio.Text;
// Adds menu items to the text editor context menu
// If you have many similar commands, it's better to create a base class and derive from
// MenuItemBase<TContext> instead of MenuItemBase, see TreeViewCtxMenus.cs for an example.
namespace Example1.Extension {
static class Constants {
//TODO: Use your own guids
// The first number is the order of the group, and the guid is the guid of the group,
// see eg. dnSpy.Contracts.Menus.MenuConstants.GROUP_CTX_CODE_HEX etc
public const string GROUP_TEXTEDITOR = "20000,3567EC95-E68E-44CE-932C-98A686FDCACF";
public const string GROUP_TREEVIEW = "20000,77ACC18E-D8EB-483B-8D93-3581574B8891";
}
// This gets loaded by dnSpy and is used to add the Ctrl+Alt+Q command
[ExportAutoLoaded]
sealed class CommandLoader : IAutoLoaded {
static readonly RoutedCommand Option1Command = new RoutedCommand("Option1Command", typeof(CommandLoader));
[ImportingConstructor]
CommandLoader(IWpfCommandService wpfCommandService, MySettings mySettings) {
var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT);
// This command will be added to all text editors
cmds.Add(Option1Command,
(s, e) => mySettings.BoolOption1 = !mySettings.BoolOption1,
(s, e) => e.CanExecute = true,
ModifierKeys.Control | ModifierKeys.Alt, Key.Q);
}
}
[ExportMenuItem(Header = "Option 1", InputGestureText = "Ctrl+Alt+Q", Group = Constants.GROUP_TEXTEDITOR, Order = 0)]
sealed class TextEditorCommand1 : MenuItemBase {
readonly MySettings mySettings;
[ImportingConstructor]
TextEditorCommand1(MySettings mySettings) => this.mySettings = mySettings;
public override bool IsChecked(IMenuItemContext context) => mySettings.BoolOption1;
public override void Execute(IMenuItemContext context) => mySettings.BoolOption1 = !mySettings.BoolOption1;
// Only show this in the document viewer
public override bool IsVisible(IMenuItemContext context) => context.CreatorObject.Guid == new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID);
}
[ExportMenuItem(Header = "Option 2", Group = Constants.GROUP_TEXTEDITOR, Order = 10)]
sealed class TextEditorCommand2 : MenuItemBase {
readonly MySettings mySettings;
[ImportingConstructor]
TextEditorCommand2(MySettings mySettings) => this.mySettings = mySettings;
public override bool IsChecked(IMenuItemContext context) => mySettings.BoolOption2;
public override void Execute(IMenuItemContext context) => mySettings.BoolOption2 = !mySettings.BoolOption2;
// Only show this in the document viewer
public override bool IsVisible(IMenuItemContext context) => context.CreatorObject.Guid == new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID);
}
[ExportMenuItem(Group = Constants.GROUP_TEXTEDITOR, Order = 20)]
sealed class TextEditorCommand3 : MenuItemBase {
public override void Execute(IMenuItemContext context) {
var md = GetTokenObj(context);
if (md is not null) {
try {
Clipboard.SetText($"{md.MDToken.Raw:X8}");
}
catch (ExternalException) { }
}
}
public override string? GetHeader(IMenuItemContext context) {
var md = GetTokenObj(context);
if (md is null)
return "Copy token";
return $"Copy token {md.MDToken.Raw:X8}";
}
IMDTokenProvider? GetTokenObj(IMenuItemContext context) {
// Only show this in the document viewer
if (context.CreatorObject.Guid != new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID))
return null;
// All references in the text editor are stored in TextReferences
var textRef = context.Find<TextReference>();
if (textRef is null)
return null;
return textRef.Reference as IMDTokenProvider;
}
// Only show this in the document viewer
public override bool IsVisible(IMenuItemContext context) => context.CreatorObject.Guid == new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID);
public override bool IsEnabled(IMenuItemContext context) => GetTokenObj(context) is not null;
}
[ExportMenuItem(Group = Constants.GROUP_TEXTEDITOR, Order = 30)]
sealed class TextEditorCommand4 : MenuItemBase {
public override void Execute(IMenuItemContext context) {
var documentViewer = GetDocumentViewer(context);
if (documentViewer is not null) {
try {
var lineColumn = GetLineColumn(documentViewer.Caret.Position.VirtualBufferPosition);
Clipboard.SetText($"Line,col: {lineColumn.Line + 1},{lineColumn.Column + 1}");
}
catch (ExternalException) { }
}
}
public override string? GetHeader(IMenuItemContext context) {
var documentViewer = GetDocumentViewer(context);
if (documentViewer is null)
return "Copy line and column";
var lineColumn = GetLineColumn(documentViewer.Caret.Position.VirtualBufferPosition);
return $"Copy line,col {lineColumn.Line + 1},{lineColumn.Column + 1}";
}
LineColumn GetLineColumn(VirtualSnapshotPoint point) {
var line = point.Position.GetContainingLine();
int column = point.Position - line.Start + point.VirtualSpaces;
return new LineColumn(line.LineNumber, column);
}
struct LineColumn {
public int Line { get; }
public int Column { get; }
public LineColumn(int line, int column) {
Line = line;
Column = column;
}
}
IDocumentViewer? GetDocumentViewer(IMenuItemContext context) {
// Only show this in the document viewer
if (context.CreatorObject.Guid != new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID))
return null;
return context.Find<IDocumentViewer>();
}
// Only show this in the document viewer
public override bool IsVisible(IMenuItemContext context) => context.CreatorObject.Guid == new Guid(MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID);
public override bool IsEnabled(IMenuItemContext context) => GetDocumentViewer(context) is not null;
}
}

View File

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="..\..\..\DnSpyCommon.props" />
<PropertyGroup>
<AssemblyName>Example1.Extension.x</AssemblyName>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Contracts.DnSpy\dnSpy.Contracts.DnSpy.csproj" />
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Contracts.Logic\dnSpy.Contracts.Logic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MSVSTextVersion)" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,49 @@
using dnSpy.Contracts.App;
using dnSpy.Contracts.Menus;
// Adds a new "_Extension" menu and several commands.
// Adds a command to the View menu
namespace Example1.Extension {
static class MainMenuConstants {
//TODO: Use your own guids
public const string APP_MENU_EXTENSION = "4E6829A6-AEA0-4803-9344-D19BF0A74DA1";
public const string GROUP_EXTENSION_MENU1 = "0,73BEBC37-387A-4004-8076-A1A90A17611B";
public const string GROUP_EXTENSION_MENU2 = "10,C21B8B99-A2E4-474F-B4BC-4CF348ECBD0A";
}
// Create the Extension menu and place it right after the Debug menu
[ExportMenu(OwnerGuid = MenuConstants.APP_MENU_GUID, Guid = MainMenuConstants.APP_MENU_EXTENSION, Order = MenuConstants.ORDER_APP_MENU_DEBUG + 0.1, Header = "_Extension")]
sealed class DebugMenu : IMenu {
}
[ExportMenuItem(OwnerGuid = MainMenuConstants.APP_MENU_EXTENSION, Header = "Command #1", Group = MainMenuConstants.GROUP_EXTENSION_MENU1, Order = 0)]
sealed class ExtensionCommand1 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("Command #1");
}
[ExportMenuItem(OwnerGuid = MainMenuConstants.APP_MENU_EXTENSION, Header = "Command #2", Group = MainMenuConstants.GROUP_EXTENSION_MENU1, Order = 10)]
sealed class ExtensionCommand2 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("Command #2");
}
[ExportMenuItem(OwnerGuid = MainMenuConstants.APP_MENU_EXTENSION, Header = "Command #3", Group = MainMenuConstants.GROUP_EXTENSION_MENU2, Order = 0)]
sealed class ExtensionCommand3 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("Command #3");
}
[ExportMenuItem(OwnerGuid = MainMenuConstants.APP_MENU_EXTENSION, Header = "Command #4", Group = MainMenuConstants.GROUP_EXTENSION_MENU2, Order = 10)]
sealed class ExtensionCommand4 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("Command #4");
}
[ExportMenuItem(OwnerGuid = MainMenuConstants.APP_MENU_EXTENSION, Header = "Command #5", Group = MainMenuConstants.GROUP_EXTENSION_MENU2, Order = 20)]
sealed class ExtensionCommand5 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("Command #5");
}
[ExportMenuItem(OwnerGuid = MenuConstants.APP_MENU_VIEW_GUID, Header = "Command #1", Group = MenuConstants.GROUP_APP_MENU_VIEW_WINDOWS, Order = 1000)]
sealed class ViewCommand1 : MenuItemBase {
public override void Execute(IMenuItemContext context) => MsgBox.Instance.Show("View Command #1");
}
}

View File

@ -0,0 +1,85 @@
using System;
using System.ComponentModel;
using System.ComponentModel.Composition;
using dnSpy.Contracts.MVVM;
using dnSpy.Contracts.Settings;
// Reads and writes the extension settings
namespace Example1.Extension {
class MySettings : ViewModelBase {
public bool BoolOption1 {
get => boolOption1;
set {
if (boolOption1 != value) {
boolOption1 = value;
OnPropertyChanged(nameof(BoolOption1));
}
}
}
bool boolOption1 = true;
public bool BoolOption2 {
get => boolOption2;
set {
if (boolOption2 != value) {
boolOption2 = value;
OnPropertyChanged(nameof(BoolOption2));
}
}
}
bool boolOption2 = false;
public string StringOption3 {
get => stringOption3;
set {
if (stringOption3 != value) {
stringOption3 = value;
OnPropertyChanged(nameof(StringOption3));
}
}
}
string stringOption3 = string.Empty;
public MySettings Clone() => CopyTo(new MySettings());
public MySettings CopyTo(MySettings other) {
other.BoolOption1 = BoolOption1;
other.BoolOption2 = BoolOption2;
other.StringOption3 = StringOption3;
return other;
}
}
// Export this class so it can be imported by other classes in this extension
[Export(typeof(MySettings))]
sealed class MySettingsImpl : MySettings {
//TODO: Use your own guid
static readonly Guid SETTINGS_GUID = new Guid("A308405D-0DF5-4C56-8B1E-8CE7BA6365E1");
readonly ISettingsService settingsService;
// Tell MEF to pass in the required ISettingsService instance exported by dnSpy
[ImportingConstructor]
MySettingsImpl(ISettingsService settingsService) {
this.settingsService = settingsService;
// Read the settings from the file or use the default values if our settings haven't
// been saved to it yet.
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
BoolOption1 = sect.Attribute<bool?>(nameof(BoolOption1)) ?? BoolOption1;
BoolOption2 = sect.Attribute<bool?>(nameof(BoolOption2)) ?? BoolOption2;
StringOption3 = sect.Attribute<string>(nameof(StringOption3)) ?? StringOption3;
PropertyChanged += MySettingsImpl_PropertyChanged;
}
void MySettingsImpl_PropertyChanged(object? sender, PropertyChangedEventArgs e) {
// Save the settings
var sect = settingsService.RecreateSection(SETTINGS_GUID);
sect.Attribute(nameof(BoolOption1), BoolOption1);
sect.Attribute(nameof(BoolOption2), BoolOption2);
sect.Attribute(nameof(StringOption3), StringOption3);
}
}
}

View File

@ -0,0 +1,8 @@
<UserControl x:Class="Example1.Extension.MySettingsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<CheckBox Content="Option #1" IsChecked="{Binding BoolOption1}" />
<CheckBox Content="Option #2" IsChecked="{Binding BoolOption2}" />
</StackPanel>
</UserControl>

View File

@ -0,0 +1,7 @@
using System.Windows.Controls;
namespace Example1.Extension {
public partial class MySettingsControl : UserControl {
public MySettingsControl() => InitializeComponent();
}
}

View File

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.Settings.Dialog;
// Adds an options dialog box page showing settings saved in MySettings
namespace Example1.Extension {
// This instance gets called by dnSpy to create the page each time the user opens the options dialog
[Export(typeof(IAppSettingsPageProvider))] // Tell MEF we're exporting this instance
sealed class MyAppSettingsPageProvider : IAppSettingsPageProvider {
readonly MySettings mySettings;
// This constructor gets the single MySettingsImpl instance exported by MySettingsImpl in MySettings.cs
[ImportingConstructor]
MyAppSettingsPageProvider(MySettings mySettings) => this.mySettings = mySettings;
public IEnumerable<AppSettingsPage> Create() {
// We only create one page
yield return new MyAppSettingsPage(mySettings);
}
}
sealed class MyAppSettingsPage : AppSettingsPage {
//TODO: Use your own GUID
static readonly Guid THE_GUID = new Guid("AE905210-A789-4AE2-B83B-537515D9F435");
// Guid of parent page or Guid.Empty if it has none
public override Guid ParentGuid => Guid.Empty;
// Unique guid of this settings page
public override Guid Guid => THE_GUID;
// The order of the page, let's place it after the debugger page
public override double Order => AppSettingsConstants.ORDER_DEBUGGER + 0.1;
public override string Title => "MySettings";
// An image that can be shown. You can return ImageReference.None if you don't want an image.
// Let's return an image since no other settings page is currently using images.
public override ImageReference Icon => DsImages.Assembly;
// This is the content shown in the page. It should be a WPF object (eg. a UserControl) or a
// ViewModel with a DataTemplate defined in a resource dictionary.
public override object? UIObject {
get {
if (uiObject is null) {
uiObject = new MySettingsControl();
uiObject.DataContext = newSettings;
}
return uiObject;
}
}
MySettingsControl? uiObject;
readonly MySettings globalSettings;
readonly MySettings newSettings;
public MyAppSettingsPage(MySettings mySettings) {
globalSettings = mySettings;
newSettings = mySettings.Clone();
}
public override void OnApply() =>
// OK/Apply was pressed, save the settings
newSettings.CopyTo(globalSettings);
public override void OnClosed() {
// The dialog box was closed
}
}
}

View File

@ -0,0 +1,9 @@
This extension shows how to do the basic things. It:
- Reads and writes settings (MySettings.cs)
- Adds a page to the options dialog box showing some of the options (MySettingsPage.cs)
- Adds options to the text editor's context menu and a Ctrl+Alt+Q keyboard shortcut (CodeCtxMenus.cs)
- Adds treeview context menus (TreeViewCtxMenus.cs)
- Adds a "_Extension" menu and menu items and a View menu command (MainMenuCommands.cs)
- Adds a button and a combobox to the toolbar (ToolBarCommands.cs)

View File

@ -0,0 +1,24 @@
using System.Collections.Generic;
using dnSpy.Contracts.Extension;
// Each extension should export one class implementing IExtension
namespace Example1.Extension {
[ExportExtension]
sealed class TheExtension : IExtension {
public IEnumerable<string> MergedResourceDictionaries {
get {
// We don't have any extra resource dictionaries
yield break;
}
}
public ExtensionInfo ExtensionInfo => new ExtensionInfo {
ShortDescription = "Example1 extension",
};
public void OnEvent(ExtensionEvent @event, object? obj) {
// We don't care about any events
}
}
}

View File

@ -0,0 +1,39 @@
using System.Windows;
using System.Windows.Controls;
using dnSpy.Contracts.App;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.ToolBars;
// Adds a toolbar button and combobox between the asm editor and debugger toolbar items
namespace Example1.Extension {
static class TBConstants {
//TODO: Use your own guid
// Place it between the asm editor and debugger, see dnSpy.Contracts.ToolBars.ToolBarConstants:
// GROUP_APP_TB_MAIN_ASMED_UNDO = "4000,6351DBFC-6D8D-4847-B3F2-BC376912B9C2"
// GROUP_APP_TB_MAIN_DEBUG = "5000,A0AFBC69-B6D1-46FE-96C8-EC380DEBE9AA"
public const string GROUP_APP_TB_EXTENSION = "4500,AF461C50-6E91-41B8-9771-0BAE9B77BC69";
}
[ExportToolBarButton(Icon = DsImagesAttribute.Assembly, ToolTip = "Click Me", Group = TBConstants.GROUP_APP_TB_EXTENSION, Order = 0)]
sealed class TBCommand1 : ToolBarButtonBase {
public override void Execute(IToolBarItemContext context) => MsgBox.Instance.Show("Command #1");
}
[ExportToolBarObject(Group = TBConstants.GROUP_APP_TB_EXTENSION, Order = 10)]
sealed class TBCommand2 : ToolBarObjectBase {
readonly ComboBox comboBox;
TBCommand2() {
comboBox = new ComboBox();
comboBox.Width = 100;
comboBox.Items.Add("Item #1");
comboBox.Items.Add("Item #2");
comboBox.Items.Add("Item #3");
comboBox.Items.Add("Item #4");
comboBox.SelectedIndex = 1;
}
public override object GetUIObject(IToolBarItemContext context, IInputElement? commandTarget) => comboBox;
}
}

View File

@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows;
using dnlib.DotNet.Emit;
using dnSpy.Contracts.App;
using dnSpy.Contracts.Documents.TreeView;
using dnSpy.Contracts.Menus;
using dnSpy.Contracts.TreeView;
// Adds a couple of commands to the file treeview context menu.
// Since there are several commands using the same state, MenuItemBase<TContext> is used
// as the base class so the context is created once and shared by all commands.
namespace Example1.Extension {
sealed class TVContext {
public bool SomeValue { get; }
public DocumentTreeNodeData[] Nodes { get; }
public TVContext(bool someValue, IEnumerable<DocumentTreeNodeData> nodes) {
SomeValue = someValue;
Nodes = nodes.ToArray();
}
}
abstract class TVCtxMenuCommand : MenuItemBase<TVContext> {
protected sealed override object CachedContextKey => ContextKey;
static readonly object ContextKey = new object();
protected sealed override TVContext? CreateContext(IMenuItemContext context) {
// Make sure it's the file treeview
if (context.CreatorObject.Guid != new Guid(MenuConstants.GUIDOBJ_DOCUMENTS_TREEVIEW_GUID))
return null;
// Extract the data needed by the context
var nodes = context.Find<TreeNodeData[]>();
if (nodes is null)
return null;
var newNodes = nodes.OfType<DocumentTreeNodeData>();
bool someValue = true;
return new TVContext(someValue, newNodes);
}
}
[ExportMenuItem(Header = "Command #1", Group = Constants.GROUP_TREEVIEW, Order = 0)]
sealed class TVCommand1 : TVCtxMenuCommand {
public override void Execute(TVContext context) => MsgBox.Instance.Show("Command #1");
public override bool IsEnabled(TVContext context) => context.Nodes.Length > 1;
}
[ExportMenuItem(Header = "Command #2", Group = Constants.GROUP_TREEVIEW, Order = 10)]
sealed class TVCommand2 : TVCtxMenuCommand {
public override void Execute(TVContext context) => MsgBox.Instance.Show("Command #2");
public override bool IsVisible(TVContext context) => context.Nodes.Length > 0;
}
[ExportMenuItem(Header = "Command #3", Group = Constants.GROUP_TREEVIEW, Order = 20)]
sealed class TVCommand3 : TVCtxMenuCommand {
public override void Execute(TVContext context) {
int secretNum = new Random().Next() % 10;
MsgBox.Instance.Ask<int?>("Number", null, "Guess a number", null, s => {
if (string.IsNullOrWhiteSpace(s))
return "Enter a number";
if (!int.TryParse(s, out int num))
return "Not an integer";
if (num == 42)
return "Nope!";
if (num != secretNum)
return "WRONG!!!";
return string.Empty;
});
}
}
[ExportMenuItem(Header = "Command #4", Group = Constants.GROUP_TREEVIEW, Order = 30)]
sealed class TVCommand4 : TVCtxMenuCommand {
public override void Execute(TVContext context) => MsgBox.Instance.Show("Command #4");
public override bool IsEnabled(TVContext context) => context.Nodes.Length == 1 && context.Nodes[0] is ModuleDocumentNode;
}
[ExportMenuItem(Group = Constants.GROUP_TREEVIEW, Order = 40)]
sealed class TVCommand5 : TVCtxMenuCommand {
public override void Execute(TVContext context) {
var node = GetTokenNode(context);
if (node is not null) {
try {
Clipboard.SetText($"{node.Reference!.MDToken.Raw:X8}");
}
catch (ExternalException) { }
}
}
IMDTokenNode? GetTokenNode(TVContext context) {
if (context.Nodes.Length == 0)
return null;
return context.Nodes[0] as IMDTokenNode;
}
public override string? GetHeader(TVContext context) {
var node = GetTokenNode(context);
if (node is null)
return string.Empty;
return $"Copy token {node.Reference!.MDToken.Raw:X8}";
}
public override bool IsVisible(TVContext context) => GetTokenNode(context) is not null;
}
[ExportMenuItem(Header = "Copy Second Instruction", Group = Constants.GROUP_TREEVIEW, Order = 50)]
sealed class TVCommand6 : TVCtxMenuCommand {
public override void Execute(TVContext context) {
var instr = GetSecondInstruction(context);
if (instr is not null) {
try {
Clipboard.SetText($"Second instruction: {instr}");
}
catch (ExternalException) { }
}
}
Instruction? GetSecondInstruction(TVContext context) {
if (context.Nodes.Length == 0)
return null;
var methNode = context.Nodes[0] as MethodNode;
if (methNode is null)
return null;
var body = methNode.MethodDef.Body;
if (body is null || body.Instructions.Count < 2)
return null;
return body.Instructions[1];
}
public override bool IsEnabled(TVContext context) => GetSecondInstruction(context) is not null;
}
}

View File

@ -0,0 +1,177 @@
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using dnSpy.Contracts.Documents.Tabs;
using dnSpy.Contracts.Documents.TreeView;
using dnSpy.Contracts.MVVM;
using dnSpy.Contracts.Settings;
// This file adds custom document tab content when the user clicks on our new AssemblyChildNode tree node.
// This node is created by TreeNodeDataProvider.cs.
namespace Example2.Extension {
[ExportDocumentTabContentFactory]
sealed class AssemblyChildNodeTabContentFactory : IDocumentTabContentFactory {
// Called to create a new IFileTabContent. If it's our new tree node, create a new IFileTabContent for it
public DocumentTabContent? Create(IDocumentTabContentFactoryContext context) {
if (context.Nodes.Length == 1 && context.Nodes[0] is AssemblyChildNode)
return new AssemblyChildNodeTabContent((AssemblyChildNode)context.Nodes[0]);
return null;
}
//TODO: Use your own guid
static readonly Guid GUID_SerializedContent = new Guid("FC6D2EC8-6FF8-4071-928E-EB07735A6402");
public DocumentTabContent? Deserialize(Guid guid, ISettingsSection section, IDocumentTabContentFactoryContext context) {
if (guid == GUID_SerializedContent) {
// Serialize() doesn't add anything extra to 'section', but if it did, you'd have to
// get that info here and return null if the serialized data wasn't found.
var node = context.Nodes.Length == 1 ? context.Nodes[0] as AssemblyChildNode : null;
if (node is not null)
return new AssemblyChildNodeTabContent(node);
}
return null;
}
public Guid? Serialize(DocumentTabContent content, ISettingsSection section) {
if (content is AssemblyChildNodeTabContent) {
// There's nothing else we need to serialize it, but if there were, use 'section'
// to write the info needed by Deserialize() above.
return GUID_SerializedContent;
}
return null;
}
}
sealed class AssemblyChildNodeTabContent : DocumentTabContent {
// Returns all nodes used to generate the content
public override IEnumerable<DocumentTreeNodeData> Nodes {
get { yield return node; }
}
public override string Title => node.ToString(DocumentNodeWriteOptions.Title);
public override object? ToolTip => node.ToString(DocumentNodeWriteOptions.Title | DocumentNodeWriteOptions.ToolTip);
readonly AssemblyChildNode node;
public AssemblyChildNodeTabContent(AssemblyChildNode node) => this.node = node;
// Called when the user opens a new tab. Override CanClone and return false if
// Clone() isn't supported
public override DocumentTabContent Clone() => new AssemblyChildNodeTabContent(node);
// Gets called to create the UI context. It can be shared by any IFileTabContent in this tab.
// Eg. there's only one text editor per tab, shared by all IFileTabContents that need a text
// editor.
public override DocumentTabUIContext CreateUIContext(IDocumentTabUIContextLocator locator) {
// This custom view object is shared by all nodes of the same type. If we didn't want it
// to be shared, we could use 'node' or 'this' as the key.
var key = node.GetType();
// var key = node; // uncomment to not share it
// If the UI object has already been created, use it, else create it. The object is
// stored in a weak reference unless you use the other method override.
return locator.Get(key, () => new AssemblyChildNodeUIContext());
}
public override void OnShow(IShowContext ctx) {
// Get the real type, created by CreateUIContext() above.
var uiCtx = (AssemblyChildNodeUIContext)ctx.UIContext;
// You could initialize some stuff, eg. update its DataContext or whatever
uiCtx.Initialize("some input"); // pretend we need to initialize something
}
}
sealed class AssemblyChildNodeUIContext : DocumentTabUIContext {
// The element inside UIObject that gets the focus when the tool window should be focused.
// If it's not as easy as calling FocusedElement.Focus() to focus it, you must implement
// dnSpy.Contracts.Controls.IFocusable.
public override IInputElement? FocusedElement => content;
// The element in UIObject that gets the scale transform. null can be returned to disable scaling.
public override FrameworkElement? ZoomElement => content;
// The UI object shown in the tab. Should be a WPF control (eg. UserControl) or a .NET object
// with a DataTemplate.
public override object? UIObject => content;
readonly ContentPresenter content;
readonly AssemblyChildNodeVM vm;
public AssemblyChildNodeUIContext() {
vm = new AssemblyChildNodeVM();
// A ContentPresenter + DataTemplate is used to show the VM, but you could of course use
// a UserControl.
content = new ContentPresenter {
Focusable = true,
Content = vm,
};
}
sealed class MyUIState {
public string Value1;
public bool Value2;
public MyUIState(string value1, bool value2) {
Value1 = value1;
Value2 = value2;
}
}
// Optional:
// Called to create an object that can be passed to RestoreUIState()
public override object? DeserializeUIState(ISettingsSection section) {
var value1 = section.Attribute<string>(nameof(MyUIState.Value1));
var value2 = section.Attribute<bool?>(nameof(MyUIState.Value2));
if (value1 is null || value2 is null)
return null;
return new MyUIState(value1, value2.Value);
}
// Optional:
// Saves the object returned by CreateUIState()
public override void SerializeUIState(ISettingsSection section, object? obj) {
var d = obj as MyUIState;
if (d is null)
return;
section.Attribute(nameof(d.Value1), d.Value1);
section.Attribute(nameof(d.Value2), d.Value2);
}
// Optional:
// Creates the UI state or returns null. This is an example, so return some random data
public override object? CreateUIState() => new MyUIState("Some string", true);
// Optional:
// Restores the UI state
public override void RestoreUIState(object? obj) {
var d = obj as MyUIState;
if (d is null)
return;
// Here's where you'd restore the UI state, eg position etc.
}
// Called by AssemblyChildNodeTabContent above to initialize it before it's shown again
public void Initialize(string s) {
// here we could initialize something before it's shown again, eg. initialize the DataContext
}
}
sealed class AssemblyChildNodeVM : ViewModelBase {
public string SomeMessage {
get => someMessage;
set {
if (someMessage != value) {
someMessage = value;
OnPropertyChanged(nameof(SomeMessage));
}
}
}
string someMessage = "Hello World";
}
}

View File

@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows.Media;
using dnSpy.Contracts.Text;
using dnSpy.Contracts.Text.Classification;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
// Colorizes all text files.
// All "if" words use the Yellow color (default: no background, yellow foreground color)
// All 2 letter words use green background (foreground not changed)
// All 3 letter words use a white foreground and a red background
// All 4 letter words use the Error color (default: no background, red foreground color)
namespace Example2.Extension {
// Define our classification types. A classification type is converted to a color
static class Constants {
// Use unique names
public const string Color1_ClassificationTypeName = "Example2.Extension.Color1";
public const string Color2_ClassificationTypeName = "Example2.Extension.Color2";
// Disable compiler warnings. The fields aren't referenced, just exported so
// the metadata can be added to some table. The fields will always be null.
#pragma warning disable CS0169
// Export the classes that define the name, and base types
[Export(typeof(ClassificationTypeDefinition))]
[Name(Color1_ClassificationTypeName)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? Color1ClassificationTypeDefinition;
[Export(typeof(ClassificationTypeDefinition))]
[Name(Color2_ClassificationTypeName)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? Color2ClassificationTypeDefinition;
#pragma warning restore CS0169
// Export the classes that define the colors and order
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = Color1_ClassificationTypeName)]
[Name("My Color #1")]
[UserVisible(true)]
[Order(After = Priority.High)]
sealed class Color1ClassificationFormatDefinition : ClassificationFormatDefinition {
Color1ClassificationFormatDefinition() => BackgroundBrush = Brushes.Green;
}
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = Color2_ClassificationTypeName)]
[Name("My Color #2")]
[UserVisible(true)]
[Order(After = Priority.High)]
sealed class Color2ClassificationFormatDefinition : ClassificationFormatDefinition {
Color2ClassificationFormatDefinition() {
ForegroundBrush = Brushes.White;
BackgroundBrush = Brushes.Red;
}
}
}
// Export our tagger provider. Each time a new text editor is created with our supported
// content type (TEXT), this class gets called to create the tagger.
[Export(typeof(ITaggerProvider))]
[TagType(typeof(IClassificationTag))]
[ContentType(ContentTypes.Text)]
sealed class TextTaggerProvider : ITaggerProvider {
readonly IClassificationTypeRegistryService classificationTypeRegistryService;
[ImportingConstructor]
TextTaggerProvider(IClassificationTypeRegistryService classificationTypeRegistryService) => this.classificationTypeRegistryService = classificationTypeRegistryService;
public ITagger<T>? CreateTagger<T>(ITextBuffer buffer) where T : ITag =>
// All text content types (including C#/VB code) derive from the TEXT content
// type, so our tagger will get called to colorize every text file that's shown
// in a text editor.
new TextTagger(classificationTypeRegistryService) as ITagger<T>;
}
// This class gets called to colorize supported files
sealed class TextTagger : ITagger<IClassificationTag> {
// We don't raise it, so add empty add/remove methods to prevent compiler warnings.
// This event must be raised when you detect changes to spans in the document. If
// your GetTags() method does async work, you should raise it when the async work
// is completed.
public event EventHandler<SnapshotSpanEventArgs>? TagsChanged {
add { }
remove { }
}
readonly IClassificationType color1;
readonly IClassificationType color2;
readonly IClassificationType color3;
readonly IClassificationType color4;
public TextTagger(IClassificationTypeRegistryService classificationTypeRegistryService) {
// Get the classification types we need
color1 = classificationTypeRegistryService.GetClassificationType(Constants.Color1_ClassificationTypeName);
color2 = classificationTypeRegistryService.GetClassificationType(Constants.Color2_ClassificationTypeName);
// Get some classification types created by some other code
color3 = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.Yellow);
color4 = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.Error);
}
// Gets called to colorize a range of the file. It's typically called once per visible line
public IEnumerable<ITagSpan<IClassificationTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
if (spans.Count == 0)
yield break;
// All spans have the same snapshot since it's a normalized collection (sorted, and no span intersects any other span)
var snapshot = spans[0].Snapshot;
foreach (var span in spans) {
foreach (var word in GetWords(span.GetText())) {
// Create a new span. word.Item2 is the offset within the string, so add span.Start to
// get the offset in the snapshot.
var wordSpan = new SnapshotSpan(snapshot, new Span(span.Span.Start + word.offset, word.word.Length));
if (word.word == "if")
yield return new TagSpan<IClassificationTag>(wordSpan, new ClassificationTag(color3));
else if (word.word.Length == 2)
yield return new TagSpan<IClassificationTag>(wordSpan, new ClassificationTag(color1));
else if (word.word.Length == 3)
yield return new TagSpan<IClassificationTag>(wordSpan, new ClassificationTag(color2));
else if (word.word.Length == 4)
yield return new TagSpan<IClassificationTag>(wordSpan, new ClassificationTag(color4));
else {
// Ignore the rest
}
}
}
}
IEnumerable<(string word, int offset)> GetWords(string s) {
int offset = 0;
for (;;) {
while (offset < s.Length && char.IsWhiteSpace(s[offset]))
offset++;
int wordOffset = offset;
while (offset < s.Length && !char.IsWhiteSpace(s[offset]))
offset++;
if (wordOffset == offset)
break;
yield return (s.Substring(wordOffset, offset - wordOffset), wordOffset);
}
}
}
}

View File

@ -0,0 +1,26 @@
using dnSpy.Contracts.Documents.Tabs.DocViewer.ToolTips;
using dnSpy.Contracts.Text;
namespace Example2.Extension {
// This reference is added to the "decompiled" code by ModuleChildNode.Decompile()
sealed class StringInfoReference {
public string Message { get; }
public StringInfoReference(string msg) => Message = msg;
}
// Called by dnSpy to create a tooltip when hovering over a reference in the text editor
[ExportDocumentViewerToolTipProvider]
sealed class DocumentViewerToolTipProvider : IDocumentViewerToolTipProvider {
public object? Create(IDocumentViewerToolTipProviderContext context, object? @ref) {
// This reference is added to the "decompiled" code by ModuleChildNode.Decompile()
if (@ref is StringInfoReference sref) {
var provider = context.Create();
provider.Output.Write(BoxedTextColor.String, sref.Message);
return provider.Create();
}
return null;
}
}
}

View File

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="..\..\..\DnSpyCommon.props" />
<PropertyGroup>
<AssemblyName>Example2.Extension.x</AssemblyName>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Contracts.DnSpy\dnSpy.Contracts.DnSpy.csproj" />
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Contracts.Logic\dnSpy.Contracts.Logic.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Text.UI.Wpf" Version="$(MSVSTextVersion)" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows.Media;
using dnSpy.Contracts.Hex;
using dnSpy.Contracts.Hex.Tagging;
using dnSpy.Contracts.Text.Classification;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
namespace Example2.Extension {
// Define our classification types. A classification type is converted to a color
static class HexConstants {
// Use unique names
public const string HexColor1_ClassificationTypeName = "Example2.Extension.HexColor1";
public const string HexColor2_ClassificationTypeName = "Example2.Extension.HexColor2";
// Disable compiler warnings. The fields aren't referenced, just exported so
// the metadata can be added to some table. The fields will always be null.
#pragma warning disable CS0169
// Export the classes that define the name, and base types
[Export(typeof(ClassificationTypeDefinition))]
[Name(HexColor1_ClassificationTypeName)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? HexColor1ClassificationTypeDefinition;
[Export(typeof(ClassificationTypeDefinition))]
[Name(HexColor2_ClassificationTypeName)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? HexColor2ClassificationTypeDefinition;
#pragma warning restore CS0169
// Export the classes that define the colors and order
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = HexColor1_ClassificationTypeName)]
[Name("My Hex Color #1")]
[UserVisible(true)]
[Order(After = Priority.High)]
sealed class Color1ClassificationFormatDefinition : ClassificationFormatDefinition {
Color1ClassificationFormatDefinition() => BackgroundBrush = Brushes.LightGray;
}
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = HexColor2_ClassificationTypeName)]
[Name("My Hex Color #2")]
[UserVisible(true)]
[Order(After = Priority.High)]
sealed class Color2ClassificationFormatDefinition : ClassificationFormatDefinition {
Color2ClassificationFormatDefinition() {
ForegroundBrush = Brushes.White;
BackgroundBrush = Brushes.Red;
}
}
}
// Export our tagger provider
[Export(typeof(HexTaggerProvider))]
[HexTagType(typeof(HexClassificationTag))]
sealed class HexTaggerProviderImpl : HexTaggerProvider {
readonly IClassificationTypeRegistryService classificationTypeRegistryService;
[ImportingConstructor]
HexTaggerProviderImpl(IClassificationTypeRegistryService classificationTypeRegistryService) => this.classificationTypeRegistryService = classificationTypeRegistryService;
public override IHexTagger<T>? CreateTagger<T>(HexBuffer buffer) =>
new HexTaggerImpl(classificationTypeRegistryService) as IHexTagger<T>;
}
// This class gets called to colorize supported files
sealed class HexTaggerImpl : HexTagger<HexClassificationTag> {
// We don't raise it, so add empty add/remove methods to prevent compiler warnings.
// This event must be raised when you detect changes to spans in the document. If
// your GetTags() method does async work, you should raise it when the async work
// is completed.
public override event EventHandler<HexBufferSpanEventArgs>? TagsChanged {
add { }
remove { }
}
readonly IClassificationType color1;
readonly IClassificationType color2;
readonly IClassificationType color3;
readonly IClassificationType color4;
public HexTaggerImpl(IClassificationTypeRegistryService classificationTypeRegistryService) {
// Get the classification types we need
color1 = classificationTypeRegistryService.GetClassificationType(HexConstants.HexColor1_ClassificationTypeName);
color2 = classificationTypeRegistryService.GetClassificationType(HexConstants.HexColor2_ClassificationTypeName);
// Get some classification types created by some other code
color3 = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.Yellow);
color4 = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.Error);
}
// Called to classify a span of data, it can only classify bytes, not characters on a line
public override IEnumerable<IHexTagSpan<HexClassificationTag>> GetTags(NormalizedHexBufferSpanCollection spans) {
if (spans.Count == 0)
yield break;
var ourSpan = new HexBufferSpan(spans[0].Buffer, 10, 128);
foreach (var span in spans) {
if (!span.IntersectsWith(ourSpan))
continue;
// Classify both columns (values and ASCII)
yield return new HexTagSpan<HexClassificationTag>(ourSpan, HexSpanSelectionFlags.Selection, new HexClassificationTag(color2));
}
}
// Called to classify a view line, any character on the line can be classified
public override IEnumerable<IHexTextTagSpan<HexClassificationTag>> GetTags(HexTaggerContext context) {
// Highlight every 16th line
if (context.Line.LineNumber.ToUInt64() % 16 == 0)
yield return new HexTextTagSpan<HexClassificationTag>(context.LineSpan, new HexClassificationTag(color1));
// If there are too many zeroes, change the color of the line
int zeroes = 0;
for (int i = 0; i < context.Line.HexBytes.Length; i++) {
if (context.Line.HexBytes.TryReadByte(i) == 0)
zeroes++;
}
if (zeroes >= context.Line.HexBytes.Length / 3)
yield return new HexTextTagSpan<HexClassificationTag>(context.LineSpan, new HexClassificationTag(color4));
}
}
}

View File

@ -0,0 +1,122 @@
using System;
using System.ComponentModel.Composition;
using System.IO;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Documents;
using dnSpy.Contracts.Documents.Tabs.DocViewer;
using dnSpy.Contracts.Documents.TreeView;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.Text;
// Adds a new IDsDocument that can be loaded into the document treeview. It gets its own DsDocumentNode.
// Open a .txt/.xml/.cs/.vb (see supportedExtensions) file to trigger this code.
namespace Example2.Extension {
// All root nodes in the document treeview contain a IDsDocument instance. They don't need to be
// .NET files or even PE files, they can be any file or even non-file (eg. in-memory data).
sealed class MyDsDocument : DsDocument {
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("9058B02C-1FE0-4EC4-93D3-A378D4B6FCE1");
// We support serialization, so return a non-null value
public override DsDocumentInfo? SerializedDocument => new DsDocumentInfo(Filename, THE_GUID);
// Since we open files from disk, we return a FilenameKey.
// If this gets changed, also update MyDsDocumentProvider.CreateKey()
public override IDsDocumentNameKey Key => new FilenameKey(Filename);
// Used by MyDsDocumentNode.Decompile() to show the file in the text editor
public string Text {
get {
if (text is not null)
return text;
try {
return text = File.ReadAllText(Filename);
}
catch {
return text = $"Couldn't read the file: {Filename}";
}
}
}
string? text;
public static MyDsDocument? TryCreate(string filename) {
if (!File.Exists(filename))
return null;
return new MyDsDocument(filename);
}
MyDsDocument(string filename) => Filename = filename;
}
// Gets called by the IDsDocumentService instance to create IDsDocument instances. If it's a .txt file
// or our MyDsDocument.THE_GUID, then create a MyDsDocument instance.
[Export(typeof(IDsDocumentProvider))]
sealed class MyDsDocumentProvider : IDsDocumentProvider {
public double Order => 0;
public IDsDocument? Create(IDsDocumentService documentService, DsDocumentInfo documentInfo) {
if (documentInfo.Type == MyDsDocument.THE_GUID)
return MyDsDocument.TryCreate(documentInfo.Name);
// Also check for normal files
if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_FILE && IsSupportedFile(documentInfo.Name))
return MyDsDocument.TryCreate(documentInfo.Name);
return null;
}
public IDsDocumentNameKey? CreateKey(IDsDocumentService documentService, DsDocumentInfo documentInfo) {
if (documentInfo.Type == MyDsDocument.THE_GUID)
return new FilenameKey(documentInfo.Name); // Must match the key in MyDsDocument.Key
// Also check for normal files
if (documentInfo.Type == DocumentConstants.DOCUMENTTYPE_FILE && IsSupportedFile(documentInfo.Name))
return new FilenameKey(documentInfo.Name); // Must match the key in MyDsDocument.Key
return null;
}
static bool IsSupportedFile(string filename) {
foreach (var ext in supportedExtensions) {
if (filename.EndsWith(ext, StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
static readonly string[] supportedExtensions = new string[] {
".txt", ".xml", ".cs", ".vb",
};
}
// Gets called by dnSpy to create a DsDocumentNode
[ExportDsDocumentNodeProvider]
sealed class MyDsDocumentNodeProvider : IDsDocumentNodeProvider {
public DsDocumentNode? Create(IDocumentTreeView documentTreeView, DsDocumentNode? owner, IDsDocument document) {
if (document is MyDsDocument myDocument)
return new MyDsDocumentNode(myDocument);
return null;
}
}
// Our MyDsDocument tree node class. It implements IDecompileSelf to "decompile" itself. You could
// also export a IDecompileNode instance to do it, see TreeNodeDataProvider.cs for an example.
// Or you could create a completely new DocumentTabContent for these nodes, see AssemblyChildNodeTabContent.cs
sealed class MyDsDocumentNode : DsDocumentNode, IDecompileSelf {
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("4174A21D-D746-4658-9A44-DB8235EE5186");
readonly MyDsDocument document;
public override Guid Guid => THE_GUID;
public MyDsDocumentNode(MyDsDocument document)
: base(document) => this.document = document;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.TextFile;
protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) =>
output.WriteFilename(Path.GetFileName(document.Filename));
public bool Decompile(IDecompileNodeContext context) {
context.ContentTypeString = ContentTypes.PlainText;
context.Output.Write(document.Text, BoxedTextColor.Text);
return true;
}
}
}

View File

@ -0,0 +1,92 @@
using System;
using System.ComponentModel.Composition;
using System.Diagnostics;
using dnSpy.Contracts.Extension;
using dnSpy.Contracts.Menus;
using dnSpy.Contracts.Output;
using dnSpy.Contracts.Text;
// Creates an Output window text pane where our log messages will go.
// Adds context menu commands.
namespace Example2.Extension {
// Holds an instance of our logger text pane
static class MyLogger {
//TODO: Use your own GUID
public static readonly Guid THE_GUID = new Guid("26F2F5B2-9C5A-4F99-A026-4946A068500F");
public static IOutputTextPane Instance {
get {
if (_instance is null)
throw new InvalidOperationException("Logger hasn't been initialized yet");
return _instance;
}
set {
if (_instance is not null)
throw new InvalidOperationException("Can't initialize the logger twice");
_instance = value ?? throw new ArgumentNullException(nameof(value));
}
}
static IOutputTextPane? _instance;
// This class initializes the Logger property. It gets auto loaded by dnSpy
[ExportAutoLoaded(Order = double.MinValue)]
sealed class InitializeLogger : IAutoLoaded {
[ImportingConstructor]
InitializeLogger(IOutputService outputService) {
Instance = outputService.Create(THE_GUID, "My Logger");
Instance.WriteLine("Logger initialized!");
}
}
}
sealed class LogEditorCtxMenuContext {
public readonly IOutputTextPane TextPane;
public LogEditorCtxMenuContext(IOutputTextPane pane) => TextPane = pane;
}
abstract class LogEditorCtxMenuCommand : MenuItemBase<LogEditorCtxMenuContext> {
protected sealed override object CachedContextKey => ContextKey;
static readonly object ContextKey = new object();
protected sealed override LogEditorCtxMenuContext? CreateContext(IMenuItemContext context) {
// Check if it's the Output window
if (context.CreatorObject.Guid != new Guid(MenuConstants.GUIDOBJ_LOG_TEXTEDITORCONTROL_GUID))
return null;
// Get the text pane if any
var textPane = context.Find<IOutputTextPane>();
if (textPane is null)
return null;
// Check if it's our logger text pane
if (textPane.Guid != MyLogger.THE_GUID)
return null;
Debug.Assert(textPane == MyLogger.Instance);
return new LogEditorCtxMenuContext(textPane);
}
}
// GROUP_CTX_OUTPUT_USER_COMMANDS can be used for user commands, like our commands below:
[ExportMenuItem(Header = "Write Hello to the Log", Group = MenuConstants.GROUP_CTX_OUTPUT_USER_COMMANDS, Order = 0)]
sealed class WriteHelloCtxMenuCommand : LogEditorCtxMenuCommand {
public override void Execute(LogEditorCtxMenuContext context) {
context.TextPane.Write(TextColor.Blue, "H");
context.TextPane.Write(TextColor.Red, "E");
context.TextPane.Write(TextColor.Green, "L");
context.TextPane.Write(TextColor.Yellow, "L");
context.TextPane.Write(TextColor.Cyan, "O");
context.TextPane.Write(TextColor.Gray, "!");
context.TextPane.WriteLine();
}
}
[ExportMenuItem(Header = "Open the Pod Bay Doors", Group = MenuConstants.GROUP_CTX_OUTPUT_USER_COMMANDS, Order = 10)]
sealed class ShowExceptionMessagesCtxMenuCommand : LogEditorCtxMenuCommand {
public override void Execute(LogEditorCtxMenuContext context) =>
context.TextPane.WriteLine(TextColor.Error, "I'm afraid I can't do that.");
}
}

View File

@ -0,0 +1,12 @@
This extension shows how to do more advanced stuff. It:
- Adds a tool window (ToolWindowContent.cs)
- Adds new tree nodes (TreeNodeDataProvider.cs)
- Adds custom tab content for the new AssemblyChildNode tree node (AssemblyChildNodeTabContent.cs). ModuleChildNode implements IDecompileSelf to decompile itself.
- Shows tooltips when hovering over custom references added to the text editor (DocumentViewerToolTipProvider.cs)
- Adds a new IDsDocument instance and DsDocumentNode node (NewDsDocument.cs). It opens .txt files and shows the output in the text editor.
- Colorizes text in text editors (Colorizer.cs)
- Colorizes text in hex editors (HexColorizer.cs)
- Colorizes Assembly Explorer treeview nodes (TreeViewNodeColorizer.cs)
- Adds a new Output window text pane (OutputTextPane.cs)

View File

@ -0,0 +1,23 @@
using System.Collections.Generic;
using dnSpy.Contracts.Extension;
// Each extension should export one class implementing IExtension
namespace Example2.Extension {
[ExportExtension]
sealed class TheExtension : IExtension {
public IEnumerable<string> MergedResourceDictionaries {
get {
yield return "Themes/resourcedict.xaml";
}
}
public ExtensionInfo ExtensionInfo => new ExtensionInfo {
ShortDescription = "Example2 extension",
};
public void OnEvent(ExtensionEvent @event, object? obj) {
// We don't care about any events
}
}
}

View File

@ -0,0 +1,24 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:Example2.Extension"
xmlns:mvvm="clr-namespace:dnSpy.Contracts.MVVM;assembly=dnSpy.Contracts.DnSpy"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataTemplate DataType="{x:Type local:AssemblyChildNodeVM}">
<!-- InitDataTemplateAP.Initialize will initialize the context menu to prevent the default
tool window context menu from showing. -->
<Border Background="{DynamicResource EnvironmentBackground}" TextBlock.Foreground="{DynamicResource EnvironmentForeground}"
BorderThickness="1" BorderBrush="Red"
mvvm:InitDataTemplateAP.Initialize="True"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding SomeMessage}" />
<TextBlock Grid.Row="1" Text="That's it, there's nothing more to see here" />
</Grid>
</Border>
</DataTemplate>
</ResourceDictionary>

View File

@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows;
using System.Windows.Input;
using dnSpy.Contracts.Controls;
using dnSpy.Contracts.Extension;
using dnSpy.Contracts.Menus;
using dnSpy.Contracts.MVVM;
using dnSpy.Contracts.ToolWindows;
using dnSpy.Contracts.ToolWindows.App;
// Adds a tool window and a command that will show it. The command is added to the View menu and a
// keyboard shortcut is added to the main window. Keyboard shortcut Ctrl+Alt+Z shows the tool window.
namespace Example2.Extension {
// Adds the 'OpenToolWindow' command to the main window and sets keyboard shortcut to Ctrl+Alt+Z
[ExportAutoLoaded]
sealed class ToolWindowLoader : IAutoLoaded {
public static readonly RoutedCommand OpenToolWindow = new RoutedCommand("OpenToolWindow", typeof(ToolWindowLoader));
[ImportingConstructor]
ToolWindowLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) {
var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW);
cmds.Add(OpenToolWindow, new RelayCommand(a => toolWindowService.Show(ToolWindowContentImpl.THE_GUID)));
cmds.Add(OpenToolWindow, ModifierKeys.Control | ModifierKeys.Alt, Key.Z);
}
}
// Adds a menu item to the View menu to show the tool window
[ExportMenuItem(OwnerGuid = MenuConstants.APP_MENU_VIEW_GUID, Header = "Extension Tool Window", InputGestureText = "Ctrl+Alt+Z", Group = MenuConstants.GROUP_APP_MENU_VIEW_WINDOWS, Order = 2000)]
sealed class ViewCommand1 : MenuItemCommand {
ViewCommand1()
: base(ToolWindowLoader.OpenToolWindow) {
}
}
// Dummy dependency "needed" by MainToolWindowContentProvider
[Export]
sealed class DeppDep {
public void Hello() {
}
}
// Called by dnSpy to create the tool window
[Export(typeof(IToolWindowContentProvider))]
sealed class MainToolWindowContentProvider : IToolWindowContentProvider {
// Caches the created tool window
ToolWindowContentImpl ToolWindowContent => myToolWindowContent ??= new ToolWindowContentImpl();
ToolWindowContentImpl? myToolWindowContent;
// Add any deps to the constructor if needed, else remove the constructor
[ImportingConstructor]
MainToolWindowContentProvider(DeppDep deppDep) => deppDep.Hello();
// Lets dnSpy know which tool windows it can create and their default locations
public IEnumerable<ToolWindowContentInfo> ContentInfos {
get { yield return new ToolWindowContentInfo(ToolWindowContentImpl.THE_GUID, ToolWindowContentImpl.DEFAULT_LOCATION, 0, false); }
}
// Called by dnSpy. If it's your tool window guid, return the instance. Make sure it's
// cached since it can be called multiple times.
public ToolWindowContent? GetOrCreate(Guid guid) {
if (guid == ToolWindowContentImpl.THE_GUID)
return ToolWindowContent;
return null;
}
}
sealed class ToolWindowContentImpl : ToolWindowContent {
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("18785447-21A8-41DB-B8AD-0F166AEC0D08");
public const AppToolWindowLocation DEFAULT_LOCATION = AppToolWindowLocation.DefaultHorizontal;
public override Guid Guid => THE_GUID;
public override string Title => "Extension Example";
// This is the object shown in the UI. Return a WPF object or a .NET object with a DataTemplate
public override object? UIObject => toolWindowControl;
// The element inside UIObject that gets the focus when the tool window should be focused.
// If it's not as easy as calling FocusedElement.Focus() to focus it, you must implement
// dnSpy.Contracts.Controls.IFocusable.
public override IInputElement? FocusedElement => toolWindowControl.option1TextBox;
// The element that gets scaled when the user zooms in or out. Return null if zooming isn't
// possible
public override FrameworkElement? ZoomElement => toolWindowControl;
readonly ToolWindowControl toolWindowControl;
readonly ToolWindowVM toolWindowVM;
public ToolWindowContentImpl() {
toolWindowControl = new ToolWindowControl();
toolWindowVM = new ToolWindowVM();
toolWindowControl.DataContext = toolWindowVM;
}
// Gets notified when the content gets hidden, visible, etc. Can be used to tell the view
// model to stop doing stuff when it gets hidden in case it does a lot of work.
public override void OnVisibilityChanged(ToolWindowContentVisibilityEvent visEvent) {
switch (visEvent) {
case ToolWindowContentVisibilityEvent.Added:
toolWindowVM.IsEnabled = true;
break;
case ToolWindowContentVisibilityEvent.Removed:
toolWindowVM.IsEnabled = false;
break;
case ToolWindowContentVisibilityEvent.Visible:
toolWindowVM.IsVisible = true;
break;
case ToolWindowContentVisibilityEvent.Hidden:
toolWindowVM.IsVisible = false;
break;
}
}
}
sealed class ToolWindowVM : ViewModelBase {
public string StringOption1 {
get => stringOption1;
set {
if (stringOption1 != value) {
stringOption1 = value;
OnPropertyChanged(nameof(StringOption1));
}
}
}
string stringOption1 = string.Empty;
public string StringOption2 {
get => stringOption2;
set {
if (stringOption2 != value) {
stringOption2 = value;
OnPropertyChanged(nameof(StringOption2));
}
}
}
string stringOption2 = string.Empty;
public string StringOption3 {
get => stringOption3;
set {
if (stringOption3 != value) {
stringOption3 = value;
OnPropertyChanged(nameof(StringOption3));
}
}
}
string stringOption3 = string.Empty;
public string StringOption4 {
get => stringOption4;
set {
if (stringOption4 != value) {
stringOption4 = value;
OnPropertyChanged(nameof(StringOption4));
}
}
}
string stringOption4 = string.Empty;
public bool IsEnabled { get; set; }
public bool IsVisible { get; set; }
}
}

View File

@ -0,0 +1,30 @@
<UserControl x:Class="Example2.Extension.ToolWindowControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mvvm="clr-namespace:dnSpy.Contracts.MVVM;assembly=dnSpy.Contracts.DnSpy">
<!-- InitDataTemplateAP.Initialize will initialize the context menu to prevent the default
tool window context menu from showing. -->
<Grid
mvvm:InitDataTemplateAP.Initialize="True"
Background="Transparent"
>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Option #1" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding StringOption1}" Name="option1TextBox" />
<Label Grid.Row="1" Grid.Column="0" Content="Option #2" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StringOption2}" />
<Label Grid.Row="2" Grid.Column="0" Content="Option #3" />
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding StringOption3}" />
<Label Grid.Row="3" Grid.Column="0" Content="Option #4" />
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding StringOption4}" />
</Grid>
</UserControl>

View File

@ -0,0 +1,7 @@
using System.Windows.Controls;
namespace Example2.Extension {
public partial class ToolWindowControl : UserControl {
public ToolWindowControl() => InitializeComponent();
}
}

View File

@ -0,0 +1,200 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Documents.Tabs.DocViewer;
using dnSpy.Contracts.Documents.TreeView;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.Text;
using dnSpy.Contracts.TreeView;
// This file contains classes that create new child nodes of IAssemblyFileNode and IModuleFileNode
namespace Example2.Extension {
// This class adds a new child node to all assembly nodes
[ExportTreeNodeDataProvider(Guid = DocumentTreeViewConstants.ASSEMBLY_NODE_GUID)]
sealed class AssemblyTreeNodeDataProvider : ITreeNodeDataProvider {
public IEnumerable<TreeNodeData> Create(TreeNodeDataProviderContext context) {
yield return new AssemblyChildNode();
}
}
// This class adds a new child node to all module nodes
[ExportTreeNodeDataProvider(Guid = DocumentTreeViewConstants.MODULE_NODE_GUID)]
sealed class ModuleTreeNodeDataProvider : ITreeNodeDataProvider {
public IEnumerable<TreeNodeData> Create(TreeNodeDataProviderContext context) {
yield return new ModuleChildNode();
}
}
sealed class AssemblyChildNode : DocumentTreeNodeData { // All file tree nodes should implement DocumentTreeNodeData or derive from DocumentTreeNodeData
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("6CF91674-16CE-44EA-B9E8-80B68C327D30");
public override Guid Guid => THE_GUID;
public override NodePathName NodePathName => new NodePathName(Guid);
// The image must be in an Images folder (in the resources) and have a .png extension
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.EntryPoint;
protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) =>
output.Write(BoxedTextColor.Text, "Assembly Child");
// If you don't want the node to be appended to the children, override this
public override ITreeNodeGroup? TreeNodeGroup => TreeNodeGroupImpl.Instance;
sealed class TreeNodeGroupImpl : ITreeNodeGroup {
public static readonly TreeNodeGroupImpl Instance = new TreeNodeGroupImpl(1);
public TreeNodeGroupImpl(double order) => Order = order;
public double Order { get; }
public int Compare([AllowNull] TreeNodeData x, [AllowNull] TreeNodeData y) {
if (x == y)
return 0;
var a = x as AssemblyChildNode;
var b = y as AssemblyChildNode;
if (a is null) return -1;
if (b is null) return 1;
// More checks can be added here...
return 0;
}
}
}
// This class can decompile its own output and implements IDecompileSelf
sealed class ModuleChildNode : DocumentTreeNodeData, IDecompileSelf { // All file tree nodes should implement DocumentTreeNodeData or derive from DocumentTreeNodeData
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("C8892F6C-6A49-4537-AAA0-D0DEF1E87277");
public override Guid Guid => THE_GUID;
public override NodePathName NodePathName => new NodePathName(Guid);
// Initialize() is called after the constructor has been called, and after the TreeNode prop
// has been initialized
public override void Initialize() =>
// Set LazyLoading if creating the children could take a while
TreeNode.LazyLoading = true;
// If TreeNode.LazyLoading is false, CreateChildren() is called after Initialize(), else it's
// called when this node gets expanded.
public override IEnumerable<TreeNodeData> CreateChildren() {
// Add some children in random order. They will be sorted because SomeMessageNode
// overrides the TreeNodeGroup prop.
yield return new SomeMessageNode("ZZZZZZZZZZZZZ");
yield return new SomeMessageNode("AAAAaaaaaAAAAAAA");
yield return new SomeMessageNode("SAY");
}
// The image must be in an Images folder (in the resources) and have a .png extension
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.String;
protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) => output.Write(BoxedTextColor.Text, "Module Child");
// Gets called by dnSpy if there's only one node to decompile. This method gets called in a
// worker thread. The output is also cached unless you call IDocumentViewerOutput.DisableCaching().
public bool Decompile(IDecompileNodeContext context) {
// Pretend we actually do something...
Thread.Sleep(2000);
// If you don't want the output to be cached, call DisableCaching()
bool cacheOutput = true;
if (!cacheOutput)
(context.Output as IDocumentViewerOutput)?.DisableCaching();
// Create the output and a few references that other code in this extension will use, eg.
// to show a tooltip when hovering over the reference.
context.ContentTypeString = ContentTypes.CSharp;
context.Output.WriteLine("// Initialize it to the secret key", BoxedTextColor.Comment);
context.Output.Write("int", new StringInfoReference("This is a reference added by the code"), DecompilerReferenceFlags.None, BoxedTextColor.Keyword);
context.Output.Write(" ", BoxedTextColor.Text);
context.Output.Write("secret", new StringInfoReference("The real secret is actually 42 not 1234"), DecompilerReferenceFlags.None, BoxedTextColor.Local);
context.Output.Write(" ", BoxedTextColor.Text);
context.Output.Write("=", BoxedTextColor.Operator);
context.Output.Write(" ", BoxedTextColor.Text);
context.Output.Write("1234", BoxedTextColor.Number);
context.Output.Write(";", BoxedTextColor.Punctuation);
context.Output.WriteLine();
// We decompiled ourselves so return true
return true;
}
// If you don't want the node to be appended to the children, override this
public override ITreeNodeGroup? TreeNodeGroup => TreeNodeGroupImpl.Instance;
sealed class TreeNodeGroupImpl : ITreeNodeGroup {
// Make sure the order is unique. 0 is already used by the PE node, so use 1
public static readonly TreeNodeGroupImpl Instance = new TreeNodeGroupImpl(1);
public TreeNodeGroupImpl(double order) => Order = order;
public double Order { get; }
public int Compare([AllowNull] TreeNodeData x, [AllowNull] TreeNodeData y) {
if (x == y)
return 0;
var a = x as ModuleChildNode;
var b = y as ModuleChildNode;
if (a is null) return -1;
if (b is null) return 1;
// More checks can be added here...
return 0;
}
}
}
sealed class SomeMessageNode : DocumentTreeNodeData {
//TODO: Use your own guid
public static readonly Guid THE_GUID = new Guid("1751CD40-68CE-4F8A-84AF-99371B6FD843");
public string Message { get; }
public SomeMessageNode(string msg) => Message = msg;
public override Guid Guid => THE_GUID;
public override NodePathName NodePathName => new NodePathName(THE_GUID, Message);
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.String;
protected override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) =>
output.Write(BoxedTextColor.Comment, Message);
public override ITreeNodeGroup? TreeNodeGroup => TreeNodeGroupImpl.Instance;
sealed class TreeNodeGroupImpl : ITreeNodeGroup {
public static readonly TreeNodeGroupImpl Instance = new TreeNodeGroupImpl(0);
public TreeNodeGroupImpl(double order) => Order = order;
public double Order { get; }
public int Compare([AllowNull] TreeNodeData x, [AllowNull] TreeNodeData y) {
if (x == y)
return 0;
var a = x as SomeMessageNode;
var b = y as SomeMessageNode;
if (a is null) return -1;
if (b is null) return 1;
return StringComparer.OrdinalIgnoreCase.Compare(a.Message, b.Message);
}
}
}
// SomeMessageNode doesn't implement IDecompileSelf, so we add a "decompiler" that can "decompile"
// those nodes.
[ExportDecompileNode]
sealed class SomeMessageNodeDecompiler : IDecompileNode {
public bool Decompile(IDecompileNodeContext context, DocumentTreeNodeData node) {
var msgNode = node as SomeMessageNode;
if (msgNode is null)
return false;
context.Decompiler.WriteCommentLine(context.Output, "The secret message has been decrypted.");
context.Decompiler.WriteCommentLine(context.Output, $"The message is: {msgNode.Message}");
context.ContentTypeString = ContentTypes.PlainText;
return true;
}
}
}

View File

@ -0,0 +1,91 @@
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows.Media;
using dnSpy.Contracts.Documents.TreeView;
using dnSpy.Contracts.Text.Classification;
using dnSpy.Contracts.TreeView.Text;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
// Adds an underline to Assembly Explorer nodes: Assembly / Method
// Adds light green background in the middle of all text
namespace Example2.Extension {
static class TreeViewNodeColorizerClassifications {
public const string UnderlineClassificationType = "Example2.Extension.UnderlineClassificationType";
public const string LightgreenBackgroundClassificationType = "Example2.Extension.LightgreenBackgroundClassificationType";
// Disable compiler warnings. The fields aren't referenced, just exported so
// the metadata can be added to some table. The fields will always be null.
#pragma warning disable CS0169
// Export the classes that define the name, and base types
[Export(typeof(ClassificationTypeDefinition))]
[Name(UnderlineClassificationType)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? UnderlineClassificationTypeDefinition;
[Export(typeof(ClassificationTypeDefinition))]
[Name(LightgreenBackgroundClassificationType)]
[BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)]
static ClassificationTypeDefinition? LightgreenBackgroundClassificationTypeDefinition;
#pragma warning restore CS0169
// Export the classes that define the colors and order
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = UnderlineClassificationType)]
[Name("Underline")]
[UserVisible(true)]
[Order(After = Priority.Default)]
sealed class UnderlineClassificationFormatDefinition : ClassificationFormatDefinition {
UnderlineClassificationFormatDefinition() => TextDecorations = System.Windows.TextDecorations.Underline;
}
[Export(typeof(EditorFormatDefinition))]
[ClassificationType(ClassificationTypeNames = LightgreenBackgroundClassificationType)]
[Name("Lightgreen Background")]
[UserVisible(true)]
[Order(After = Priority.Default)]
sealed class LightGreenBackgroundClassificationFormatDefinition : ClassificationFormatDefinition {
LightGreenBackgroundClassificationFormatDefinition() => BackgroundBrush = Brushes.LightGreen;
}
}
[Export(typeof(ITextClassifierProvider))]
// You can also add more content types or use the base content type TreeViewContentTypes.TreeViewNode
[ContentType(TreeViewContentTypes.TreeViewNodeAssemblyExplorer)]
sealed class TreeViewNodeColorizerProvider : ITextClassifierProvider {
readonly IClassificationTypeRegistryService classificationTypeRegistryService;
[ImportingConstructor]
TreeViewNodeColorizerProvider(IClassificationTypeRegistryService classificationTypeRegistryService) => this.classificationTypeRegistryService = classificationTypeRegistryService;
public ITextClassifier? Create(IContentType contentType) => new TreeViewNodeColorizer(classificationTypeRegistryService);
}
sealed class TreeViewNodeColorizer : ITextClassifier {
readonly IClassificationTypeRegistryService classificationTypeRegistryService;
public TreeViewNodeColorizer(IClassificationTypeRegistryService classificationTypeRegistryService) => this.classificationTypeRegistryService = classificationTypeRegistryService;
public IEnumerable<TextClassificationTag> GetTags(TextClassifierContext context) {
var tvContext = context as TreeViewNodeClassifierContext;
if (tvContext is null)
yield break;
// Don't do a thing if it's a tooltip
if (tvContext.IsToolTip)
yield break;
// Add the underline
if (tvContext.Node is AssemblyDocumentNode || tvContext.Node is MethodNode) {
yield return new TextClassificationTag(new Span(0, context.Text.Length),
classificationTypeRegistryService.GetClassificationType(TreeViewNodeColorizerClassifications.UnderlineClassificationType));
}
// Add light green background in the middle of the text
yield return new TextClassificationTag(new Span(context.Text.Length / 4, context.Text.Length / 2),
classificationTypeRegistryService.GetClassificationType(TreeViewNodeColorizerClassifications.LightgreenBackgroundClassificationType));
}
}
}

View File

@ -0,0 +1,71 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Diagnostics;
using System.Linq;
using dnlib.DotNet;
using ICSharpCode.Decompiler.Ast.Transforms;
using ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
sealed class AssemblyInfoTransform : IAstTransform {
public void Run(AstNode compilationUnit) {
foreach (var attrSect in compilationUnit.Descendants.OfType<AttributeSection>()) {
var attr = attrSect.Descendants.OfType<Attribute>().FirstOrDefault();
Debug2.Assert(attr is not null);
if (attr is null)
continue;
bool remove = false;
if (!remove && attr.Annotation<CustomAttribute>() is CustomAttribute ca) {
remove =
Compare(ca.AttributeType, systemRuntimeVersioningString, targetFrameworkAttributeString) ||
Compare(ca.AttributeType, systemSecurityString, unverifiableCodeAttributeString) ||
Compare(ca.AttributeType, systemRuntimeCompilerServicesyString, compilationRelaxationsAttributeString) ||
Compare(ca.AttributeType, systemRuntimeCompilerServicesyString, runtimeCompatibilityAttributeString) ||
Compare(ca.AttributeType, systemDiagnosticsString, debuggableAttributeString);
}
if (!remove && attr.Annotation<SecurityAttribute>() is SecurityAttribute)
remove = true;
if (remove)
attrSect.Remove();
}
}
static readonly UTF8String systemRuntimeVersioningString = new UTF8String("System.Runtime.Versioning");
static readonly UTF8String targetFrameworkAttributeString = new UTF8String("TargetFrameworkAttribute");
static readonly UTF8String systemSecurityString = new UTF8String("System.Security");
static readonly UTF8String unverifiableCodeAttributeString = new UTF8String("UnverifiableCodeAttribute");
static readonly UTF8String systemRuntimeCompilerServicesyString = new UTF8String("System.Runtime.CompilerServices");
static readonly UTF8String compilationRelaxationsAttributeString = new UTF8String("CompilationRelaxationsAttribute");
static readonly UTF8String runtimeCompatibilityAttributeString = new UTF8String("RuntimeCompatibilityAttribute");
static readonly UTF8String systemDiagnosticsString = new UTF8String("System.Diagnostics");
static readonly UTF8String debuggableAttributeString = new UTF8String("DebuggableAttribute");
static bool Compare(ITypeDefOrRef type, UTF8String expNs, UTF8String expName) {
if (type is null)
return false;
if (type is TypeRef tr)
return tr.Namespace == expNs && tr.Name == expName;
if (type is TypeDef td)
return td.Namespace == expNs && td.Name == expName;
return false;
}
}
}

View File

@ -0,0 +1,90 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Ast;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
/// <summary>
/// State for one decompiler thread. There should be at most one of these per CPU. This class
/// is not thread safe and must only be accessed by the owner thread.
/// </summary>
sealed class AstBuilderState {
public readonly AstBuilder AstBuilder;
/// <summary>
/// <see cref="StringBuilder"/> instance used by XML doc code. This is always in a random
/// state (random text) and caller must Clear() it before use.
/// </summary>
public readonly StringBuilder XmlDoc_StringBuilder;
readonly Dictionary<ModuleDef, bool> hasXmlDocFile;
ModuleDef? lastModule;
bool lastModuleResult;
public AstBuilderState(int settingsVersion) {
AstBuilder = new AstBuilder(new DecompilerContext(settingsVersion, null, null, true));
XmlDoc_StringBuilder = new StringBuilder();
hasXmlDocFile = new Dictionary<ModuleDef, bool>();
}
public bool? HasXmlDocFile(ModuleDef module) {
if (lastModule == module)
return lastModuleResult;
if (hasXmlDocFile.TryGetValue(module, out var res)) {
lastModule = module;
lastModuleResult = res;
return res;
}
return null;
}
public void SetHasXmlDocFile(ModuleDef module, bool value) {
lastModule = module;
lastModuleResult = value;
hasXmlDocFile.Add(module, value);
}
/// <summary>
/// Called to re-use this instance for another decompilation. Only the fields that need
/// resetting will be reset.
/// </summary>
public void Reset() => AstBuilder.Reset();
}
/// <summary>
/// One instance is created and stored in <see cref="DecompilationContext"/>. It's used by the
/// decompiler threads to get an <see cref="AstBuilderState"/> instance.
/// </summary>
sealed class BuilderCache {
readonly ThreadSafeObjectPool<AstBuilderState> astBuilderStatePool;
public BuilderCache(int settingsVersion) => astBuilderStatePool = new ThreadSafeObjectPool<AstBuilderState>(Environment.ProcessorCount, () => new AstBuilderState(settingsVersion), resetAstBuilderState);
static readonly Action<AstBuilderState> resetAstBuilderState = abs => abs.Reset();
public AstBuilderState AllocateAstBuilderState() => astBuilderStatePool.Allocate();
public void Free(AstBuilderState state) => astBuilderStatePool.Free(state);
}
}

View File

@ -0,0 +1,45 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using dnSpy.Contracts.Decompiler;
using ICSharpCode.Decompiler.Ast;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
/// <summary>
/// Gets the <see cref="AstBuilderState"/> from the pool and returns it when <see cref="Dispose"/>
/// gets called.
/// </summary>
struct BuilderState : IDisposable {
public AstBuilder AstBuilder => State.AstBuilder;
public readonly AstBuilderState State;
readonly BuilderCache cache;
public BuilderState(DecompilationContext ctx, BuilderCache cache, MetadataTextColorProvider metadataTextColorProvider) {
this.cache = cache;
State = cache.AllocateAstBuilderState();
State.AstBuilder.Context.CalculateILSpans = ctx.CalculateILSpans;
State.AstBuilder.Context.MetadataTextColorProvider = metadataTextColorProvider;
State.AstBuilder.Context.AsyncMethodBodyDecompilation = ctx.AsyncMethodBodyDecompilation;
}
public void Dispose() => cache.Free(State);
}
}

View File

@ -0,0 +1,525 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Xml;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Decompiler.XmlDoc;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.ILSpy.Core.Settings;
using dnSpy.Decompiler.ILSpy.Core.Text;
using dnSpy.Decompiler.ILSpy.Core.XmlDoc;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler.Ast.Transforms;
using ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
sealed class DecompilerProvider : IDecompilerProvider {
readonly DecompilerSettingsService decompilerSettingsService;
// Keep the default ctor. It's used by dnSpy.Console.exe
public DecompilerProvider()
: this(DecompilerSettingsService.__Instance_DONT_USE) {
}
public DecompilerProvider(DecompilerSettingsService decompilerSettingsService) {
Debug2.Assert(decompilerSettingsService is not null);
this.decompilerSettingsService = decompilerSettingsService ?? throw new ArgumentNullException(nameof(decompilerSettingsService));
}
public IEnumerable<IDecompiler> Create() {
yield return new CSharpDecompiler(decompilerSettingsService.CSharpVBDecompilerSettings, DecompilerConstants.CSHARP_ILSPY_ORDERUI);
#if DEBUG
foreach (var l in CSharpDecompiler.GetDebugDecompilers(decompilerSettingsService.CSharpVBDecompilerSettings))
yield return l;
#endif
}
}
/// <summary>
/// Decompiler logic for C#.
/// </summary>
sealed class CSharpDecompiler : DecompilerBase {
string uniqueNameUI = "C#";
Guid uniqueGuid = DecompilerConstants.LANGUAGE_CSHARP_ILSPY;
bool showAllMembers = false;
readonly Func<BuilderCache> createBuilderCache;
Predicate<IAstTransform>? transformAbortCondition = null;
public override DecompilerSettingsBase Settings => langSettings;
readonly CSharpVBDecompilerSettings langSettings;
public CSharpDecompiler(CSharpVBDecompilerSettings langSettings, double orderUI) {
this.langSettings = langSettings;
createBuilderCache = () => new BuilderCache(this.langSettings.Settings.SettingsVersion);
OrderUI = orderUI;
}
#if DEBUG
internal static IEnumerable<CSharpDecompiler> GetDebugDecompilers(CSharpVBDecompilerSettings langSettings) {
DecompilerContext context = new DecompilerContext(0, new ModuleDefUser("dummy"), CSharpMetadataTextColorProvider.Instance);
string lastTransformName = "no transforms";
double orderUI = DecompilerConstants.CSHARP_ILSPY_DEBUG_ORDERUI;
uint id = 0xBF67AF3F;
foreach (Type _transformType in TransformationPipeline.CreatePipeline(context).Select(v => v.GetType()).Distinct()) {
Type transformType = _transformType; // copy for lambda
yield return new CSharpDecompiler(langSettings, orderUI++) {
transformAbortCondition = v => transformType.IsInstanceOfType(v),
uniqueNameUI = "C# - " + lastTransformName,
uniqueGuid = new Guid($"203F702E-7E87-4F01-84CD-B0E8{id++:X8}"),
showAllMembers = true
};
lastTransformName = "after " + transformType.Name;
}
yield return new CSharpDecompiler(langSettings, orderUI++) {
uniqueNameUI = "C# - " + lastTransformName,
uniqueGuid = new Guid($"203F702E-7E87-4F01-84CD-B0E8{id++:X8}"),
showAllMembers = true
};
}
#endif
public override string ContentTypeString => ContentTypesInternal.CSharpILSpy;
public override string GenericNameUI => DecompilerConstants.GENERIC_NAMEUI_CSHARP;
public override string UniqueNameUI => uniqueNameUI;
public override double OrderUI { get; }
public override Guid GenericGuid => DecompilerConstants.LANGUAGE_CSHARP;
public override Guid UniqueGuid => uniqueGuid;
public override string FileExtension => ".cs";
public override string? ProjectFileExtension => ".csproj";
public override void Decompile(MethodDef method, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, method);
var state = CreateAstBuilder(ctx, langSettings.Settings, currentType: method.DeclaringType, isSingleMember: true);
try {
if (method.IsConstructor && !method.IsStatic && !method.DeclaringType.IsValueType) {
// also fields and other ctors so that the field initializers can be shown as such
AddFieldsAndCtors(state.AstBuilder, method.DeclaringType, method.IsStatic);
RunTransformsAndGenerateCode(ref state, output, ctx, new SelectCtorTransform(method));
}
else {
state.AstBuilder.AddMethod(method);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
}
finally {
state.Dispose();
}
}
class SelectCtorTransform : IAstTransform {
readonly MethodDef ctorDef;
public SelectCtorTransform(MethodDef ctorDef) => this.ctorDef = ctorDef;
public void Run(AstNode compilationUnit) {
ConstructorDeclaration? ctorDecl = null;
foreach (var node in compilationUnit.Children) {
if (node is ConstructorDeclaration ctor) {
if (ctor.Annotation<MethodDef>() == ctorDef) {
ctorDecl = ctor;
}
else {
// remove other ctors
ctor.Remove();
}
}
// Remove any fields without initializers
if (node is FieldDeclaration fd && fd.Variables.All(v => v.Initializer.IsNull))
fd.Remove();
}
if (ctorDecl?.Initializer.ConstructorInitializerType == ConstructorInitializerType.This) {
// remove all fields
foreach (var node in compilationUnit.Children)
if (node is FieldDeclaration)
node.Remove();
}
}
}
public override void Decompile(PropertyDef property, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, property);
var state = CreateAstBuilder(ctx, langSettings.Settings, currentType: property.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddProperty(property);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(FieldDef field, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, field);
var state = CreateAstBuilder(ctx, langSettings.Settings, currentType: field.DeclaringType, isSingleMember: true);
try {
if (field.IsLiteral) {
state.AstBuilder.AddField(field);
}
else {
// also decompile ctors so that the field initializer can be shown
AddFieldsAndCtors(state.AstBuilder, field.DeclaringType, field.IsStatic);
}
RunTransformsAndGenerateCode(ref state, output, ctx, new SelectFieldTransform(field));
}
finally {
state.Dispose();
}
}
/// <summary>
/// Removes all top-level members except for the specified fields.
/// </summary>
sealed class SelectFieldTransform : IAstTransform {
readonly FieldDef field;
public SelectFieldTransform(FieldDef field) => this.field = field;
public void Run(AstNode compilationUnit) {
foreach (var child in compilationUnit.Children) {
if (child is EntityDeclaration) {
if (child.Annotation<FieldDef>() != field)
child.Remove();
}
}
}
}
void AddFieldsAndCtors(AstBuilder codeDomBuilder, TypeDef declaringType, bool isStatic) {
foreach (var field in declaringType.Fields) {
if (field.IsStatic == isStatic)
codeDomBuilder.AddField(field);
}
foreach (var ctor in declaringType.Methods) {
if (ctor.IsConstructor && ctor.IsStatic == isStatic)
codeDomBuilder.AddMethod(ctor);
}
}
public override void Decompile(EventDef ev, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, ev);
var state = CreateAstBuilder(ctx, langSettings.Settings, currentType: ev.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddEvent(ev);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(TypeDef type, IDecompilerOutput output, DecompilationContext ctx) {
var state = CreateAstBuilder(ctx, langSettings.Settings, currentType: type);
try {
state.AstBuilder.AddType(type);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
void RunTransformsAndGenerateCode(ref BuilderState state, IDecompilerOutput output, DecompilationContext ctx, IAstTransform? additionalTransform = null) {
var astBuilder = state.AstBuilder;
astBuilder.RunTransformations(transformAbortCondition);
if (additionalTransform is not null) {
additionalTransform.Run(astBuilder.SyntaxTree);
}
AddXmlDocumentation(ref state, langSettings.Settings, astBuilder);
astBuilder.GenerateCode(output);
}
internal static void AddXmlDocumentation(ref BuilderState state, DecompilerSettings settings, AstBuilder astBuilder) {
if (settings.ShowXmlDocumentation) {
var module = state.AstBuilder.Context.CurrentModule;
var hasXmlDocFileTmp = state.State.HasXmlDocFile(module);
bool hasXmlDocFile;
if (hasXmlDocFileTmp is null) {
hasXmlDocFile = XmlDocLoader.LoadDocumentation(module) is not null;
state.State.SetHasXmlDocFile(module, hasXmlDocFile);
}
else
hasXmlDocFile = hasXmlDocFileTmp.Value;
if (!hasXmlDocFile)
return;
try {
new AddXmlDocTransform(state.State.XmlDoc_StringBuilder).Run(astBuilder.SyntaxTree);
}
catch (XmlException ex) {
string[] msg = (" Exception while reading XmlDoc: " + ex.ToString()).Split(newLineChars, StringSplitOptions.RemoveEmptyEntries);
var insertionPoint = astBuilder.SyntaxTree.FirstChild;
for (int i = 0; i < msg.Length; i++)
astBuilder.SyntaxTree.InsertChildBefore(insertionPoint, new Comment(msg[i], CommentType.Documentation), Roles.Comment);
}
}
}
static readonly char[] newLineChars = new char[] { '\r', '\n', '\u0085', '\u2028', '\u2029' };
public override void Decompile(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) {
WriteAssembly(asm, output, ctx);
using (ctx.DisableAssemblyLoad()) {
var state = CreateAstBuilder(ctx, langSettings.Settings, currentModule: asm.ManifestModule);
try {
state.AstBuilder.AddAssembly(asm.ManifestModule, true, true, false);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
}
public override void Decompile(ModuleDef mod, IDecompilerOutput output, DecompilationContext ctx) {
WriteModule(mod, output, ctx);
using (ctx.DisableAssemblyLoad()) {
var state = CreateAstBuilder(ctx, langSettings.Settings, currentModule: mod);
try {
state.AstBuilder.AddAssembly(mod, true, false, true);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
}
BuilderState CreateAstBuilder(DecompilationContext ctx, DecompilerSettings settings, ModuleDef? currentModule = null, TypeDef? currentType = null, bool isSingleMember = false) {
if (currentModule is null)
currentModule = currentType?.Module;
if (isSingleMember) {
settings = settings.Clone();
settings.UsingDeclarations = false;
}
var cache = ctx.GetOrCreate(createBuilderCache);
var state = new BuilderState(ctx, cache, MetadataTextColorProvider);
state.AstBuilder.Context.CurrentModule = currentModule;
state.AstBuilder.Context.CancellationToken = ctx.CancellationToken;
state.AstBuilder.Context.CurrentType = currentType;
state.AstBuilder.Context.Settings = settings;
return state;
}
protected override void TypeToString(IDecompilerOutput output, ITypeDefOrRef? type, bool includeNamespace, IHasCustomAttribute? typeAttributes = null) {
ConvertTypeOptions options = ConvertTypeOptions.IncludeTypeParameterDefinitions;
if (includeNamespace)
options |= ConvertTypeOptions.IncludeNamespace;
TypeToString(output, options, type, typeAttributes);
}
static readonly UTF8String systemRuntimeCompilerServicesString = new UTF8String("System.Runtime.CompilerServices");
static readonly UTF8String isReadOnlyAttributeString = new UTF8String("IsReadOnlyAttribute");
bool WriteRefIfByRef(IDecompilerOutput output, TypeSig typeSig, ParamDef? pd) {
if (typeSig.RemovePinnedAndModifiers() is ByRefSig) {
if (pd is not null && (!pd.IsIn && pd.IsOut)) {
output.Write("out", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
}
else if (pd is not null && pd.IsDefined(systemRuntimeCompilerServicesString, isReadOnlyAttributeString)) {
output.Write("in", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
}
else {
output.Write("ref", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
}
return true;
}
return false;
}
void TypeToString(IDecompilerOutput output, ConvertTypeOptions options, ITypeDefOrRef? type, IHasCustomAttribute? typeAttributes = null) {
if (type is null)
return;
AstType astType = AstBuilder.ConvertType(type, new StringBuilder(), typeAttributes, options);
if (WriteRefIfByRef(output, type.TryGetByRefSig(), typeAttributes as ParamDef)) {
if (astType is ComposedType && ((ComposedType)astType).PointerRank > 0)
((ComposedType)astType).PointerRank--;
}
var ctx = new DecompilerContext(langSettings.Settings.SettingsVersion, type.Module, MetadataTextColorProvider);
astType.AcceptVisitor(new CSharpOutputVisitor(new TextTokenWriter(output, ctx), FormattingOptionsFactory.CreateAllman()));
}
protected override void FormatPropertyName(IDecompilerOutput output, PropertyDef property, bool? isIndexer) {
if (property is null)
throw new ArgumentNullException(nameof(property));
if (!isIndexer.HasValue) {
isIndexer = property.IsIndexer();
}
if (isIndexer.Value) {
var accessor = property.GetMethod ?? property.SetMethod;
if (accessor is not null && accessor.HasOverrides) {
var methDecl = accessor.Overrides.First().MethodDeclaration;
var declaringType = methDecl is null ? null : methDecl.DeclaringType;
TypeToString(output, declaringType, includeNamespace: true);
output.Write(".", BoxedTextColor.Operator);
}
output.Write("this", BoxedTextColor.Keyword);
output.Write("[", BoxedTextColor.Punctuation);
bool addSeparator = false;
foreach (var p in property.PropertySig.GetParams()) {
if (addSeparator) {
output.Write(",", BoxedTextColor.Punctuation);
output.Write(" ", BoxedTextColor.Text);
}
else
addSeparator = true;
TypeToString(output, p.ToTypeDefOrRef(), includeNamespace: true);
}
output.Write("]", BoxedTextColor.Punctuation);
}
else
WriteIdentifier(output, property.Name, MetadataTextColorProvider.GetColor(property));
}
static readonly HashSet<string> isKeyword = new HashSet<string>(StringComparer.Ordinal) {
"abstract", "as", "base", "bool", "break", "byte", "case", "catch",
"char", "checked", "class", "const", "continue", "decimal", "default", "delegate",
"do", "double", "else", "enum", "event", "explicit", "extern", "false",
"finally", "fixed", "float", "for", "foreach", "goto", "if", "implicit",
"in", "int", "interface", "internal", "is", "lock", "long", "namespace",
"new", "null", "object", "operator", "out", "override", "params", "private",
"protected", "public", "readonly", "ref", "return", "sbyte", "sealed", "short",
"sizeof", "stackalloc", "static", "string", "struct", "switch", "this", "throw",
"true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort",
"using", "virtual", "void", "volatile", "while",
};
static void WriteIdentifier(IDecompilerOutput output, string id, object tokenKind) {
if (isKeyword.Contains(id))
output.Write("@", tokenKind);
output.Write(IdentifierEscaper.Escape(id), tokenKind);
}
protected override void FormatTypeName(IDecompilerOutput output, TypeDef type) {
if (type is null)
throw new ArgumentNullException(nameof(type));
TypeToString(output, ConvertTypeOptions.DoNotUsePrimitiveTypeNames | ConvertTypeOptions.IncludeTypeParameterDefinitions | ConvertTypeOptions.DoNotIncludeEnclosingType, type);
}
internal static bool ShowMember(IMemberRef member, bool showAllMembers, DecompilerSettings settings) {
if (showAllMembers)
return true;
if (member is MethodDef md && (md.IsGetter || md.IsSetter || md.IsAddOn || md.IsRemoveOn))
return true;
return !AstBuilder.MemberIsHidden(member, settings);
}
public override bool ShowMember(IMemberRef member) => ShowMember(member, showAllMembers, langSettings.Settings);
public override bool CanDecompile(DecompilationType decompilationType) {
switch (decompilationType) {
case DecompilationType.PartialType:
case DecompilationType.AssemblyInfo:
case DecompilationType.TypeMethods:
return true;
}
return base.CanDecompile(decompilationType);
}
public override void Decompile(DecompilationType decompilationType, object data) {
switch (decompilationType) {
case DecompilationType.PartialType:
DecompilePartial((DecompilePartialType)data);
return;
case DecompilationType.AssemblyInfo:
DecompileAssemblyInfo((DecompileAssemblyInfo)data);
return;
case DecompilationType.TypeMethods:
DecompileTypeMethods((DecompileTypeMethods)data);
return;
}
base.Decompile(decompilationType, data);
}
void DecompilePartial(DecompilePartialType info) {
var state = CreateAstBuilder(info.Context, CreateDecompilerSettings(langSettings.Settings, info.UseUsingDeclarations), currentType: info.Type);
try {
state.AstBuilder.AddType(info.Type);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompilePartialTransform(info.Type, info.Definitions, info.ShowDefinitions, info.AddPartialKeyword, info.InterfacesToRemove));
}
finally {
state.Dispose();
}
}
void DecompileAssemblyInfo(DecompileAssemblyInfo info) {
var state = CreateAstBuilder(info.Context, langSettings.Settings, currentModule: info.Module);
try {
state.AstBuilder.AddAssembly(info.Module, true, info.Module.IsManifestModule, true);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, info.KeepAllAttributes ? null : new AssemblyInfoTransform());
}
finally {
state.Dispose();
}
}
void DecompileTypeMethods(DecompileTypeMethods info) {
var state = CreateAstBuilder(info.Context, CreateDecompilerSettings_DecompileTypeMethods(langSettings.Settings, !info.DecompileHidden, info.ShowAll), currentType: info.Type);
try {
state.AstBuilder.GetDecompiledBodyKind = (builder, method) => GetDecompiledBodyKind(info, builder, method);
state.AstBuilder.AddType(info.Type);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompileTypeMethodsTransform(info.Types, info.Methods, !info.DecompileHidden, info.ShowAll));
}
finally {
state.Dispose();
}
}
internal static DecompilerSettings CreateDecompilerSettings_DecompileTypeMethods(DecompilerSettings settings, bool useUsingDeclarations, bool showAll) {
var s = CreateDecompilerSettings(settings, useUsingDeclarations);
// Make sure the ctor is shown if the user tries to edit an empty ctor/cctor
s.RemoveEmptyDefaultConstructors = false;
if (!showAll) {
// Inline all field initialization code
s.AllowFieldInitializers = false;
}
return s;
}
internal static DecompilerSettings CreateDecompilerSettings(DecompilerSettings settings, bool useUsingDeclarations) {
var newOne = settings.Clone();
newOne.UsingDeclarations = useUsingDeclarations;
newOne.FullyQualifyAllTypes = !useUsingDeclarations;
newOne.RemoveNewDelegateClass = useUsingDeclarations;
newOne.ForceShowAllMembers = false;
return newOne;
}
internal static DecompiledBodyKind GetDecompiledBodyKind(DecompileTypeMethods info, AstBuilder builder, MethodDef method) {
if (info.DecompileHidden)
return DecompiledBodyKind.Empty;
if (info.ShowAll || info.Methods.Contains(method))
return DecompiledBodyKind.Full;
return DecompiledBodyKind.Empty;
}
}
}

View File

@ -0,0 +1,84 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using dnlib.DotNet;
using ICSharpCode.Decompiler.Ast.Transforms;
using ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
sealed class DecompilePartialTransform : IAstTransform {
readonly TypeDef type;
readonly HashSet<IMemberDef> definitions;
readonly bool showDefinitions;
readonly bool addPartialKeyword;
readonly HashSet<ITypeDefOrRef> ifacesToRemove;
public DecompilePartialTransform(TypeDef type, HashSet<IMemberDef> definitions, bool showDefinitions, bool addPartialKeyword, IEnumerable<ITypeDefOrRef> ifacesToRemove) {
this.type = type;
this.definitions = definitions;
this.showDefinitions = showDefinitions;
this.addPartialKeyword = addPartialKeyword;
this.ifacesToRemove = new HashSet<ITypeDefOrRef>(ifacesToRemove, TypeEqualityComparer.Instance);
}
public void Run(AstNode compilationUnit) {
foreach (var en in compilationUnit.Descendants.OfType<EntityDeclaration>()) {
var def = en.Annotation<IMemberDef>();
Debug2.Assert(def is not null);
if (def is null)
continue;
if (def == type) {
var tdecl = en as TypeDeclaration;
Debug2.Assert(tdecl is not null);
if (tdecl is not null) {
if (addPartialKeyword) {
if (tdecl.ClassType != ClassType.Enum)
tdecl.Modifiers |= Modifiers.Partial;
// Make sure the comments are still shown before the method and its modifiers
var comments = en.GetChildrenByRole(Roles.Comment).Reverse().ToArray();
foreach (var c in comments) {
c.Remove();
en.InsertChildAfter(null, c, Roles.Comment);
}
}
foreach (var iface in tdecl.BaseTypes) {
var tdr = iface.Annotation<ITypeDefOrRef>();
if (tdr is not null && ifacesToRemove.Contains(tdr))
iface.Remove();
}
}
}
else {
if (showDefinitions) {
if (!definitions.Contains(def))
en.Remove();
}
else {
if (definitions.Contains(def))
en.Remove();
}
}
}
}
}
}

View File

@ -0,0 +1,137 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using dnlib.DotNet;
using ICSharpCode.Decompiler.Ast.Transforms;
using ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
sealed class DecompileTypeMethodsTransform : IAstTransform {
readonly HashSet<IMemberDef> defsToShow;
readonly HashSet<TypeDef> partialTypes;
readonly bool showDefinitions;
readonly bool showAll;
public DecompileTypeMethodsTransform(HashSet<TypeDef> types, HashSet<MethodDef> methods, bool showDefinitions, bool showAll) {
defsToShow = new HashSet<IMemberDef>();
partialTypes = new HashSet<TypeDef>();
this.showDefinitions = showDefinitions;
this.showAll = showAll;
foreach (var method in methods) {
// If it's part of a property or event, include the property or event since there are no partial props/events
var prop = method.DeclaringType.Properties.FirstOrDefault(a => a.GetMethods.Contains(method) || a.SetMethods.Contains(method));
if (prop is not null) {
defsToShow.Add(prop);
foreach (var m in prop.GetMethods)
defsToShow.Add(m);
foreach (var m in prop.SetMethods)
defsToShow.Add(m);
foreach (var m in prop.OtherMethods)
defsToShow.Add(m);
}
else {
var evt = method.DeclaringType.Events.FirstOrDefault(a => a.AddMethod == method || a.RemoveMethod == method);
if (evt is not null) {
defsToShow.Add(evt);
if (evt.AddMethod is not null)
defsToShow.Add(evt.AddMethod);
if (evt.RemoveMethod is not null)
defsToShow.Add(evt.RemoveMethod);
if (evt.InvokeMethod is not null)
defsToShow.Add(evt.InvokeMethod);
foreach (var m in evt.OtherMethods)
defsToShow.Add(m);
}
else
defsToShow.Add(method);
}
}
foreach (var type in types) {
if (!type.IsEnum) {
defsToShow.Add(type);
partialTypes.Add(type);
}
}
foreach (var def in defsToShow) {
for (var declType = def.DeclaringType; declType is not null; declType = declType.DeclaringType)
partialTypes.Add(declType);
}
foreach (var type in types) {
if (type.IsEnum) {
defsToShow.Add(type);
foreach (var f in type.Fields)
defsToShow.Add(f);
}
}
}
public void Run(AstNode compilationUnit) {
foreach (var en in compilationUnit.Descendants.OfType<EntityDeclaration>()) {
var def = en.Annotation<IMemberDef>();
Debug2.Assert(def is not null);
if (def is null)
continue;
if (partialTypes.Contains(def)) {
var tdecl = en as TypeDeclaration;
Debug2.Assert(tdecl is not null);
if (tdecl is not null) {
if (tdecl.ClassType != ClassType.Enum)
tdecl.Modifiers |= Modifiers.Partial;
if (!showDefinitions) {
tdecl.BaseTypes.Clear();
tdecl.Attributes.Clear();
}
// Make sure the comments are still shown before the method and its modifiers
var comments = en.GetChildrenByRole(Roles.Comment).Reverse().ToArray();
foreach (var c in comments) {
c.Remove();
en.InsertChildAfter(null, c, Roles.Comment);
}
}
}
else {
if (showDefinitions) {
if (!showAll && !defsToShow.Contains(def))
en.Remove();
}
else {
if (showAll || defsToShow.Contains(def))
en.Remove();
else if (en is CustomEventDeclaration ced) {
// Convert this hidden event to an event without accessor bodies.
// AstBuilder doesn't write empty bodies to it if it's a hidden event because
// then it can't be optimized to an auto event. We want real auto events to
// become auto events and custom events to stay custom, but without bodies.
if (!ced.AddAccessor.IsNull)
ced.AddAccessor.Body = new BlockStatement();
if (!ced.RemoveAccessor.IsNull)
ced.RemoveAccessor.Body = new BlockStatement();
}
}
}
}
}
}
}

View File

@ -0,0 +1,57 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
namespace dnSpy.Decompiler.ILSpy.Core.CSharp {
sealed class ThreadSafeObjectPool<T> where T : class {
readonly List<T> freeObjs;
readonly Func<T> createObject;
readonly Action<T> resetObject;
readonly object lockObj = new object();
public ThreadSafeObjectPool(int size, Func<T> createObject, Action<T> resetObject) {
if (size <= 0)
throw new ArgumentException();
freeObjs = new List<T>(size);
this.createObject = createObject;
this.resetObject = resetObject;
}
public T Allocate() {
lock (lockObj) {
if (freeObjs.Count > 0) {
int i = freeObjs.Count - 1;
var o = freeObjs[i];
freeObjs.RemoveAt(i);
return o;
}
return createObject();
}
}
public void Free(T obj) {
resetObject(obj);
lock (lockObj)
freeObjs.Add(obj);
}
}
}

View File

@ -0,0 +1,200 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Decompiler.XmlDoc;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.IL;
using dnSpy.Decompiler.ILSpy.Core.Settings;
using dnSpy.Decompiler.ILSpy.Core.Text;
using dnSpy.Decompiler.ILSpy.Core.XmlDoc;
using ICSharpCode.Decompiler.Disassembler;
namespace dnSpy.Decompiler.ILSpy.Core.IL {
sealed class DecompilerProvider : IDecompilerProvider {
readonly DecompilerSettingsService decompilerSettingsService;
// Keep the default ctor. It's used by dnSpy.Console.exe
public DecompilerProvider()
: this(DecompilerSettingsService.__Instance_DONT_USE) {
}
public DecompilerProvider(DecompilerSettingsService decompilerSettingsService) {
Debug2.Assert(decompilerSettingsService is not null);
this.decompilerSettingsService = decompilerSettingsService ?? throw new ArgumentNullException(nameof(decompilerSettingsService));
}
public IEnumerable<IDecompiler> Create() {
yield return new ILDecompiler(decompilerSettingsService.ILDecompilerSettings);
}
}
/// <summary>
/// IL language support.
/// </summary>
/// <remarks>
/// Currently comes in two versions:
/// flat IL (detectControlStructure=false) and structured IL (detectControlStructure=true).
/// </remarks>
sealed class ILDecompiler : DecompilerBase {
readonly bool detectControlStructure;
public override DecompilerSettingsBase Settings => langSettings;
readonly ILDecompilerSettings langSettings;
public ILDecompiler(ILDecompilerSettings langSettings)
: this(langSettings, true) {
}
public ILDecompiler(ILDecompilerSettings langSettings, bool detectControlStructure) {
this.langSettings = langSettings;
this.detectControlStructure = detectControlStructure;
}
public override double OrderUI => DecompilerConstants.IL_ILSPY_ORDERUI;
public override string ContentTypeString => ContentTypesInternal.ILILSpy;
public override string GenericNameUI => DecompilerConstants.GENERIC_NAMEUI_IL;
public override string UniqueNameUI => "IL";
public override Guid GenericGuid => DecompilerConstants.LANGUAGE_IL;
public override Guid UniqueGuid => DecompilerConstants.LANGUAGE_IL_ILSPY;
public override string FileExtension => ".il";
ReflectionDisassembler CreateReflectionDisassembler(IDecompilerOutput output, DecompilationContext ctx, IMemberDef member) =>
CreateReflectionDisassembler(output, ctx, member.Module);
ReflectionDisassembler CreateReflectionDisassembler(IDecompilerOutput output, DecompilationContext ctx, ModuleDef ownerModule) {
var disOpts = new DisassemblerOptions(langSettings.Settings.SettingsVersion, ctx.CancellationToken, ownerModule);
if (langSettings.Settings.ShowILComments)
disOpts.GetOpCodeDocumentation = ILLanguageHelper.GetOpCodeDocumentation;
var sb = new StringBuilder();
if (langSettings.Settings.ShowXmlDocumentation)
disOpts.GetXmlDocComments = a => GetXmlDocComments(a, sb);
disOpts.CreateInstructionBytesReader = m => InstructionBytesReader.Create(m, ctx.IsBodyModified is not null && ctx.IsBodyModified(m));
disOpts.ShowTokenAndRvaComments = langSettings.Settings.ShowTokenAndRvaComments;
disOpts.ShowILBytes = langSettings.Settings.ShowILBytes;
disOpts.SortMembers = langSettings.Settings.SortMembers;
disOpts.ShowPdbInfo = langSettings.Settings.ShowPdbInfo;
disOpts.MaxStringLength = langSettings.Settings.MaxStringLength;
disOpts.HexadecimalNumbers = langSettings.Settings.HexadecimalNumbers;
return new ReflectionDisassembler(output, detectControlStructure, disOpts);
}
static IEnumerable<string> GetXmlDocComments(IMemberRef mr, StringBuilder sb) {
if (mr is null || mr.Module is null)
yield break;
var xmldoc = XmlDocLoader.LoadDocumentation(mr.Module);
if (xmldoc is null)
yield break;
var doc = xmldoc.GetDocumentation(XmlDocKeyProvider.GetKey(mr, sb));
if (string2.IsNullOrEmpty(doc))
yield break;
foreach (var info in new XmlDocLine(doc)) {
sb.Clear();
if (info is not null) {
sb.Append(' ');
info.Value.WriteTo(sb);
}
yield return sb.ToString();
}
}
public override void Decompile(MethodDef method, IDecompilerOutput output, DecompilationContext ctx) {
var dis = CreateReflectionDisassembler(output, ctx, method);
dis.DisassembleMethod(method, true);
}
public override void Decompile(FieldDef field, IDecompilerOutput output, DecompilationContext ctx) {
var dis = CreateReflectionDisassembler(output, ctx, field);
dis.DisassembleField(field, false);
}
public override void Decompile(PropertyDef property, IDecompilerOutput output, DecompilationContext ctx) {
ReflectionDisassembler rd = CreateReflectionDisassembler(output, ctx, property);
rd.DisassembleProperty(property, addLineSep: true);
if (property.GetMethod is not null) {
output.WriteLine();
rd.DisassembleMethod(property.GetMethod, true);
}
if (property.SetMethod is not null) {
output.WriteLine();
rd.DisassembleMethod(property.SetMethod, true);
}
foreach (var m in property.OtherMethods) {
output.WriteLine();
rd.DisassembleMethod(m, true);
}
}
public override void Decompile(EventDef ev, IDecompilerOutput output, DecompilationContext ctx) {
ReflectionDisassembler rd = CreateReflectionDisassembler(output, ctx, ev);
rd.DisassembleEvent(ev, addLineSep: true);
if (ev.AddMethod is not null) {
output.WriteLine();
rd.DisassembleMethod(ev.AddMethod, true);
}
if (ev.RemoveMethod is not null) {
output.WriteLine();
rd.DisassembleMethod(ev.RemoveMethod, true);
}
foreach (var m in ev.OtherMethods) {
output.WriteLine();
rd.DisassembleMethod(m, true);
}
}
public override void Decompile(TypeDef type, IDecompilerOutput output, DecompilationContext ctx) {
var dis = CreateReflectionDisassembler(output, ctx, type);
dis.DisassembleType(type, true);
}
public override void Decompile(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) {
output.WriteLine("// " + asm.ManifestModule.Location, BoxedTextColor.Comment);
PrintEntryPoint(asm.ManifestModule, output);
output.WriteLine();
ReflectionDisassembler rd = CreateReflectionDisassembler(output, ctx, asm.ManifestModule);
rd.WriteAssemblyHeader(asm);
}
public override void Decompile(ModuleDef mod, IDecompilerOutput output, DecompilationContext ctx) {
output.WriteLine("// " + mod.Location, BoxedTextColor.Comment);
PrintEntryPoint(mod, output);
output.WriteLine();
ReflectionDisassembler rd = CreateReflectionDisassembler(output, ctx, mod);
output.WriteLine();
rd.WriteModuleHeader(mod);
}
protected override void TypeToString(IDecompilerOutput output, ITypeDefOrRef? t, bool includeNamespace, IHasCustomAttribute? attributeProvider = null) =>
t.WriteTo(output, includeNamespace ? ILNameSyntax.TypeName : ILNameSyntax.ShortTypeName);
public override void WriteToolTip(ITextColorWriter output, IMemberRef member, IHasCustomAttribute? typeAttributes) {
if (!(member is ITypeDefOrRef) && ILDecompilerUtils.Write(TextColorWriterToDecompilerOutput.Create(output), member))
return;
base.WriteToolTip(output, member, typeAttributes);
}
}
}

View File

@ -0,0 +1,57 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using ICSharpCode.Decompiler.Disassembler;
namespace dnSpy.Decompiler.ILSpy.Core.IL {
static class ILDecompilerUtils {
public static bool Write(IDecompilerOutput output, IMemberRef? member) {
if (member is IMethod method && method.IsMethod) {
method.WriteMethodTo(output);
return true;
}
if (member is IField field && field.IsField) {
field.WriteFieldTo(output);
return true;
}
if (member is PropertyDef prop) {
var dis = new ReflectionDisassembler(output, false, new DisassemblerOptions(0, new System.Threading.CancellationToken(), null));
dis.DisassembleProperty(prop, false);
return true;
}
if (member is EventDef evt) {
var dis = new ReflectionDisassembler(output, false, new DisassemblerOptions(0, new System.Threading.CancellationToken(), null));
dis.DisassembleEvent(evt, false);
return true;
}
if (member is ITypeDefOrRef type) {
type.WriteTo(output, ILNameSyntax.TypeName);
return true;
}
return false;
}
}
}

View File

@ -0,0 +1,386 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.ILSpy.Core.Settings;
using dnSpy.Decompiler.ILSpy.Core.Text;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Disassembler;
using ICSharpCode.Decompiler.ILAst;
namespace dnSpy.Decompiler.ILSpy.Core.ILAst {
sealed class DecompilerProvider : IDecompilerProvider {
readonly DecompilerSettingsService decompilerSettingsService;
// Keep the default ctor. It's used by dnSpy.Console.exe
public DecompilerProvider()
: this(DecompilerSettingsService.__Instance_DONT_USE) {
}
public DecompilerProvider(DecompilerSettingsService decompilerSettingsService) {
Debug2.Assert(decompilerSettingsService is not null);
this.decompilerSettingsService = decompilerSettingsService ?? throw new ArgumentNullException(nameof(decompilerSettingsService));
}
public IEnumerable<IDecompiler> Create() {
#if DEBUG
foreach (var l in ILAstDecompiler.GetDebugDecompilers(decompilerSettingsService))
yield return l;
#endif
yield break;
}
}
#if DEBUG
/// <summary>
/// Represents the ILAst "language" used for debugging purposes.
/// </summary>
sealed class ILAstDecompiler : DecompilerBase {
readonly string uniqueNameUI;
Guid uniqueGuid;
bool inlineVariables = true;
ILAstOptimizationStep? abortBeforeStep;
public override DecompilerSettingsBase Settings { get; }
const int settingsVersion = 1;
ILAstDecompiler(ILAstDecompilerSettings langSettings, double orderUI, string uniqueNameUI) {
Settings = langSettings;
OrderUI = orderUI;
this.uniqueNameUI = uniqueNameUI;
}
public override double OrderUI { get; }
public override string ContentTypeString => ContentTypesInternal.ILAstILSpy;
public override string GenericNameUI => "ILAst";
public override string UniqueNameUI => uniqueNameUI;
public override Guid GenericGuid => DecompilerConstants.LANGUAGE_ILAST_ILSPY;
public override Guid UniqueGuid => uniqueGuid;
public override void Decompile(MethodDef method, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentBegin(output, true);
output.Write("Method: ", BoxedTextColor.Comment);
output.Write(IdentifierEscaper.Escape(method.FullName), method, DecompilerReferenceFlags.Definition, BoxedTextColor.Comment);
WriteCommentEnd(output, true);
output.WriteLine();
if (!method.HasBody) {
return;
}
var bodyInfo = StartKeywordBlock(output, ".body", method);
ILAstBuilder astBuilder = new ILAstBuilder();
ILBlock ilMethod = new ILBlock(CodeBracesRangeFlags.MethodBraces);
DecompilerContext context = new DecompilerContext(settingsVersion, method.Module, MetadataTextColorProvider) {
CurrentType = method.DeclaringType,
CurrentMethod = method,
CalculateILSpans = ctx.CalculateILSpans,
};
ilMethod.Body = astBuilder.Build(method, inlineVariables, context);
var stateMachineKind = StateMachineKind.None;
MethodDef? inlinedMethod = null;
AsyncMethodDebugInfo? asyncInfo = null;
string? compilerName = null;
if (abortBeforeStep is not null) {
var optimizer = new ILAstOptimizer();
optimizer.Optimize(context, ilMethod, out stateMachineKind, out inlinedMethod, out asyncInfo, abortBeforeStep.Value);
compilerName = optimizer.CompilerName;
}
if (context.CurrentMethodIsYieldReturn) {
output.Write("yield", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
output.WriteLine("return", BoxedTextColor.Keyword);
}
if (context.CurrentMethodIsAsync) {
output.Write("async", BoxedTextColor.Keyword);
output.Write("/", BoxedTextColor.Punctuation);
output.WriteLine("await", BoxedTextColor.Keyword);
}
var allVariables = ilMethod.GetSelfAndChildrenRecursive<ILExpression>().Select(e => e.Operand as ILVariable)
.Where(v => v is not null && !v.IsParameter).Distinct();
foreach (var v in allVariables) {
Debug2.Assert(v is not null);
output.Write(IdentifierEscaper.Escape(v.Name), v.GetTextReferenceObject(), DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, v.IsParameter ? BoxedTextColor.Parameter : BoxedTextColor.Local);
if (v.Type is not null) {
output.Write(" ", BoxedTextColor.Text);
output.Write(":", BoxedTextColor.Punctuation);
output.Write(" ", BoxedTextColor.Text);
if (v.IsPinned) {
output.Write("pinned", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
}
v.Type.WriteTo(output, ILNameSyntax.ShortTypeName);
}
if (v.GeneratedByDecompiler) {
output.Write(" ", BoxedTextColor.Text);
var start = output.NextPosition;
output.Write("[", BoxedTextColor.Punctuation);
output.Write("generated", BoxedTextColor.Keyword);
var end = output.NextPosition;
output.Write("]", BoxedTextColor.Punctuation);
output.AddBracePair(new TextSpan(start, 1), new TextSpan(end, 1), CodeBracesRangeFlags.SquareBrackets);
}
output.WriteLine();
}
var localVariables = new HashSet<ILVariable>(GetVariables(ilMethod));
var builder = new MethodDebugInfoBuilder(settingsVersion, stateMachineKind, inlinedMethod ?? method, inlinedMethod is not null ? method : null, CreateSourceLocals(localVariables), CreateSourceParameters(localVariables), asyncInfo);
builder.CompilerName = compilerName;
foreach (ILNode node in ilMethod.Body) {
node.WriteTo(output, builder);
if (!node.WritesNewLine)
output.WriteLine();
}
output.AddDebugInfo(builder.Create());
EndKeywordBlock(output, bodyInfo, CodeBracesRangeFlags.MethodBraces, addLineSeparator: true);
}
IEnumerable<ILVariable> GetVariables(ILBlock ilMethod) {
foreach (var n in ilMethod.GetSelfAndChildrenRecursive(new List<ILNode>())) {
var expr = n as ILExpression;
if (expr is not null) {
var v = expr.Operand as ILVariable;
if (v is not null)
yield return v;
continue;
}
var cb = n as ILTryCatchBlock.CatchBlockBase;
if (cb is not null && cb.ExceptionVariable is not null)
yield return cb.ExceptionVariable;
}
}
readonly List<SourceLocal> sourceLocalsList = new List<SourceLocal>();
SourceLocal[] CreateSourceLocals(HashSet<ILVariable> variables) {
foreach (var v in variables) {
if (v.IsParameter)
continue;
sourceLocalsList.Add(v.GetSourceLocal());
}
var array = sourceLocalsList.ToArray();
sourceLocalsList.Clear();
return array;
}
readonly List<SourceParameter> sourceParametersList = new List<SourceParameter>();
SourceParameter[] CreateSourceParameters(HashSet<ILVariable> variables) {
foreach (var v in variables) {
if (!v.IsParameter)
continue;
sourceParametersList.Add(v.GetSourceParameter());
}
var array = sourceParametersList.ToArray();
sourceParametersList.Clear();
return array;
}
struct BraceInfo {
public int Start { get; }
public BraceInfo(int start) => Start = start;
}
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);
}
void EndKeywordBlock(IDecompilerOutput output, BraceInfo info, CodeBracesRangeFlags flags, bool addLineSeparator = false) {
output.DecreaseIndent();
var end = output.NextPosition;
output.Write("}", BoxedTextColor.Punctuation);
output.AddBracePair(new TextSpan(info.Start, 1), new TextSpan(end, 1), flags);
if (addLineSeparator)
output.AddLineSeparator(end);
output.WriteLine();
}
public override void Decompile(EventDef ev, IDecompilerOutput output, DecompilationContext ctx) {
var eventInfo = StartKeywordBlock(output, ".event", ev);
if (ev.AddMethod is not null) {
var info = StartKeywordBlock(output, ".add", ev.AddMethod);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
if (ev.InvokeMethod is not null) {
var info = StartKeywordBlock(output, ".invoke", ev.InvokeMethod);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
if (ev.RemoveMethod is not null) {
var info = StartKeywordBlock(output, ".remove", ev.RemoveMethod);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
EndKeywordBlock(output, eventInfo, CodeBracesRangeFlags.EventBraces, addLineSeparator: true);
}
public override void Decompile(FieldDef field, IDecompilerOutput output, DecompilationContext ctx) {
output.Write(IdentifierEscaper.Escape(field.FieldType.GetFullName()), field.FieldType.ToTypeDefOrRef(), DecompilerReferenceFlags.None, MetadataTextColorProvider.GetColor(field.FieldType));
output.Write(" ", BoxedTextColor.Text);
output.Write(IdentifierEscaper.Escape(field.Name), field, DecompilerReferenceFlags.Definition, MetadataTextColorProvider.GetColor(field));
var c = field.Constant;
if (c is not null) {
output.Write(" ", BoxedTextColor.Text);
output.Write("=", BoxedTextColor.Operator);
output.Write(" ", BoxedTextColor.Text);
if (c.Value is null)
output.Write("null", BoxedTextColor.Keyword);
else {
switch (c.Type) {
case ElementType.Boolean:
if (c.Value is bool)
output.Write((bool)c.Value ? "true" : "false", BoxedTextColor.Keyword);
else
goto default;
break;
case ElementType.Char:
output.Write($"'{c.Value}'", BoxedTextColor.Char);
break;
case ElementType.I1:
case ElementType.U1:
case ElementType.I2:
case ElementType.U2:
case ElementType.I4:
case ElementType.U4:
case ElementType.I8:
case ElementType.U8:
case ElementType.R4:
case ElementType.R8:
case ElementType.I:
case ElementType.U:
output.Write($"{c.Value}", BoxedTextColor.Number);
break;
case ElementType.String:
output.Write($"{c.Value}", BoxedTextColor.String);
break;
default:
output.Write($"{c.Value}", BoxedTextColor.Text);
break;
}
}
}
}
public override void Decompile(PropertyDef property, IDecompilerOutput output, DecompilationContext ctx) {
var propInfo = StartKeywordBlock(output, ".property", property);
foreach (var getter in property.GetMethods) {
var info = StartKeywordBlock(output, ".get", getter);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
foreach (var setter in property.SetMethods) {
var info = StartKeywordBlock(output, ".set", setter);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
foreach (var other in property.OtherMethods) {
var info = StartKeywordBlock(output, ".other", other);
EndKeywordBlock(output, info, CodeBracesRangeFlags.AccessorBraces);
}
EndKeywordBlock(output, propInfo, CodeBracesRangeFlags.PropertyBraces, addLineSeparator: true);
}
public override void Decompile(TypeDef type, IDecompilerOutput output, DecompilationContext ctx) {
this.WriteCommentLine(output, $"Type: {type.FullName}");
if (type.BaseType is not null) {
WriteCommentBegin(output, true);
output.Write("Base type: ", BoxedTextColor.Comment);
output.Write(IdentifierEscaper.Escape(type.BaseType.FullName), type.BaseType, DecompilerReferenceFlags.None, BoxedTextColor.Comment);
WriteCommentEnd(output, true);
output.WriteLine();
}
foreach (var nested in type.NestedTypes) {
Decompile(nested, output, ctx);
output.WriteLine();
}
int lastFieldPos = -1;
foreach (var field in type.Fields) {
Decompile(field, output, ctx);
lastFieldPos = output.NextPosition;
output.WriteLine();
}
if (lastFieldPos >= 0) {
output.AddLineSeparator(lastFieldPos);
output.WriteLine();
}
foreach (var property in type.Properties) {
Decompile(property, output, ctx);
output.WriteLine();
}
foreach (var @event in type.Events) {
Decompile(@event, output, ctx);
output.WriteLine();
}
foreach (var method in type.Methods) {
Decompile(method, output, ctx);
output.WriteLine();
}
}
internal static IEnumerable<ILAstDecompiler> GetDebugDecompilers(DecompilerSettingsService decompilerSettingsService) {
double orderUI = DecompilerConstants.ILAST_ILSPY_DEBUG_ORDERUI;
uint id = 0x64A926A5;
yield return new ILAstDecompiler(decompilerSettingsService.ILAstDecompilerSettings, orderUI++, "ILAst (unoptimized)") {
uniqueGuid = new Guid($"CB470049-6AFB-4BDB-93DC-1BB9{id++:X8}"),
inlineVariables = false
};
string nextName = "ILAst (variable splitting)";
foreach (ILAstOptimizationStep step in (ILAstOptimizationStep[])Enum.GetValues(typeof(ILAstOptimizationStep))) {
yield return new ILAstDecompiler(decompilerSettingsService.ILAstDecompilerSettings, orderUI++, nextName) {
uniqueGuid = new Guid($"CB470049-6AFB-4BDB-93DC-1BB9{id++:X8}"),
abortBeforeStep = step
};
nextName = "ILAst (after " + step + ")";
}
}
public override string FileExtension => ".il";
protected override void TypeToString(IDecompilerOutput output, ITypeDefOrRef? t, bool includeNamespace, IHasCustomAttribute? attributeProvider = null) =>
t.WriteTo(output, includeNamespace ? ILNameSyntax.TypeName : ILNameSyntax.ShortTypeName);
}
#endif
}

View File

@ -0,0 +1,3 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("dnSpy.Decompiler.ILSpy.x, PublicKey=0024000004800000940000000602000000240000525341310004000001000100858d4f2519af95faeca8d359daa2078b20826765450f330daff3c5ec378adf9eb8e168eff8069ba51e15c1992d0d72b73129ed7a014f62863fa80a80dd9b010b8211c4d4c70ed26b9b65370007b0341685c98cc4cd2d16814d9581db82b382fb8ee838e1b8a2bd1c759e43ddda209e35cde530a7ba6a517787c04a3f283ea1b5")]

View File

@ -0,0 +1,415 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace dnSpy.Decompiler.ILSpy.Core.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class dnSpy_Decompiler_ILSpy_Core_Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal dnSpy_Decompiler_ILSpy_Core_Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("dnSpy.Decompiler.ILSpy.Core.Properties.dnSpy.Decompiler.ILSpy.Core.Resources", typeof(dnSpy_Decompiler_ILSpy_Core_Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Add using declarations.
/// </summary>
public static string DecompilerSettings_AddUsingDeclarations {
get {
return ResourceManager.GetString("DecompilerSettings_AddUsingDeclarations", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Allow field initializers.
/// </summary>
public static string DecompilerSettings_AllowFieldInitializers {
get {
return ResourceManager.GetString("DecompilerSettings_AllowFieldInitializers", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always generate exception variables in catch blocks unless type is Object.
/// </summary>
public static string DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject {
get {
return ResourceManager.GetString("DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObjec" +
"t", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompilation order.
/// </summary>
public static string DecompilerSettings_DecompilationOrder {
get {
return ResourceManager.GetString("DecompilerSettings_DecompilationOrder", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile anonymous methods/lambdas.
/// </summary>
public static string DecompilerSettings_DecompileAnonMethods {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileAnonMethods", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile async methods (async/await).
/// </summary>
public static string DecompilerSettings_DecompileAsyncMethods {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileAsyncMethods", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile automatic events.
/// </summary>
public static string DecompilerSettings_DecompileAutoEvents {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileAutoEvents", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile automatic properties.
/// </summary>
public static string DecompilerSettings_DecompileAutoProps {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileAutoProps", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile enumerators (yield return).
/// </summary>
public static string DecompilerSettings_DecompileEnumerators {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileEnumerators", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile expression trees.
/// </summary>
public static string DecompilerSettings_DecompileExprTrees {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileExprTrees", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile foreach statements.
/// </summary>
public static string DecompilerSettings_DecompileForeachStatements {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileForeachStatements", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile lock statements.
/// </summary>
public static string DecompilerSettings_DecompileLockStatements {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileLockStatements", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile query expressions.
/// </summary>
public static string DecompilerSettings_DecompileQueryExpr {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileQueryExpr", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile switch on string.
/// </summary>
public static string DecompilerSettings_DecompileSwitchOnString {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileSwitchOnString", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile using statements.
/// </summary>
public static string DecompilerSettings_DecompileUsingStatements {
get {
return ResourceManager.GetString("DecompilerSettings_DecompileUsingStatements", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add namespaces to all types.
/// </summary>
public static string DecompilerSettings_FullyQualifyAllTypes {
get {
return ResourceManager.GetString("DecompilerSettings_FullyQualifyAllTypes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add a namespace to types with the same name.
/// </summary>
public static string DecompilerSettings_FullyQualifyAmbiguousTypeNames {
get {
return ResourceManager.GetString("DecompilerSettings_FullyQualifyAmbiguousTypeNames", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hexadecimal numbers.
/// </summary>
public static string DecompilerSettings_HexadecimalNumbers {
get {
return ResourceManager.GetString("DecompilerSettings_HexadecimalNumbers", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use increment and decrement operators.
/// </summary>
public static string DecompilerSettings_IntroduceIncrementAndDecrement {
get {
return ResourceManager.GetString("DecompilerSettings_IntroduceIncrementAndDecrement", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use assignment expressions such as in while ((count = Do()) != 0) ;.
/// </summary>
public static string DecompilerSettings_MakeAssignmentExpressions {
get {
return ResourceManager.GetString("DecompilerSettings_MakeAssignmentExpressions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Max number of array elements to show.
/// </summary>
public static string DecompilerSettings_MaxArrayElements {
get {
return ResourceManager.GetString("DecompilerSettings_MaxArrayElements", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Max string length.
/// </summary>
public static string DecompilerSettings_MaxStringLength {
get {
return ResourceManager.GetString("DecompilerSettings_MaxStringLength", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add &apos;private&apos; modifier to type members.
/// </summary>
public static string DecompilerSettings_MemberAddPrivateModifier {
get {
return ResourceManager.GetString("DecompilerSettings_MemberAddPrivateModifier", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile object or collection initializers.
/// </summary>
public static string DecompilerSettings_ObjectOrCollectionInitializers {
get {
return ResourceManager.GetString("DecompilerSettings_ObjectOrCollectionInitializers", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show one custom attribute per line.
/// </summary>
public static string DecompilerSettings_OneCustomAttributePerLine {
get {
return ResourceManager.GetString("DecompilerSettings_OneCustomAttributePerLine", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove empty default constructors.
/// </summary>
public static string DecompilerSettings_RemoveEmptyDefaultCtors {
get {
return ResourceManager.GetString("DecompilerSettings_RemoveEmptyDefaultCtors", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Replace &apos;new delegate-class(xxx)&apos; with &apos;xxx&apos;.
/// </summary>
public static string DecompilerSettings_RemoveNewDelegateClass {
get {
return ResourceManager.GetString("DecompilerSettings_RemoveNewDelegateClass", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show hidden compiler generated types and methods.
/// </summary>
public static string DecompilerSettings_ShowCompilerGeneratedTypes {
get {
return ResourceManager.GetString("DecompilerSettings_ShowCompilerGeneratedTypes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show IL opcode comments.
/// </summary>
public static string DecompilerSettings_ShowILComments {
get {
return ResourceManager.GetString("DecompilerSettings_ShowILComments", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show IL instruction bytes.
/// </summary>
public static string DecompilerSettings_ShowILInstrBytes {
get {
return ResourceManager.GetString("DecompilerSettings_ShowILInstrBytes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show line numbers and filenames if available.
/// </summary>
public static string DecompilerSettings_ShowPdbInfo {
get {
return ResourceManager.GetString("DecompilerSettings_ShowPdbInfo", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show tokens, RVAs and file offsets.
/// </summary>
public static string DecompilerSettings_ShowTokensRvasOffsets {
get {
return ResourceManager.GetString("DecompilerSettings_ShowTokensRvasOffsets", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Show XML documentation in decompiled code.
/// </summary>
public static string DecompilerSettings_ShowXMLDocComments {
get {
return ResourceManager.GetString("DecompilerSettings_ShowXMLDocComments", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sort custom attributes.
/// </summary>
public static string DecompilerSettings_SortCustomAttributes {
get {
return ResourceManager.GetString("DecompilerSettings_SortCustomAttributes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sort methods, fields, properties, events and types.
/// </summary>
public static string DecompilerSettings_SortMethods {
get {
return ResourceManager.GetString("DecompilerSettings_SortMethods", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Place &apos;System&apos; directives first when sorting usings.
/// </summary>
public static string DecompilerSettings_SortSystemFirst {
get {
return ResourceManager.GetString("DecompilerSettings_SortSystemFirst", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add &apos;internal&apos; modifier to types.
/// </summary>
public static string DecompilerSettings_TypeAddInternalModifier {
get {
return ResourceManager.GetString("DecompilerSettings_TypeAddInternalModifier", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use variable names from debug symbols, if available.
/// </summary>
public static string DecompilerSettings_UseLocalNameFromSyms {
get {
return ResourceManager.GetString("DecompilerSettings_UseLocalNameFromSyms", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Order members in source code order.
/// </summary>
public static string DecompilerSettings_UseSourceCodeOrder {
get {
return ResourceManager.GetString("DecompilerSettings_UseSourceCodeOrder", resourceCulture);
}
}
}
}

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Přidat deklaraci using</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Přidat inicializátory pole</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Vždy generovat proměnné výjimek v blocích catch, dokud je typ objekt</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Pořadí dekompilace</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Dekompilovat anonymní metody/lambda výrazy</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Dekompilovat asynchronní metody (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Dekompilovat automatické události</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Dekompilovat automatické vlastnosti</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Dekompilovat enumerátory (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Dekompilovat stromy výrazů</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Dekompilovat foreach konstrukce</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Dekompilovat lock deklarace</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Dekompilovat query výrazy</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Dekompilovat spínač na řetězec</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Dekompilovat prohlášení using</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Přidat jmenné prostory pro všechny typy</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Přidat jmenné prostory pro typy se stejným názvem</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Hexadecimal numbers</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Použít operátory zvyšování a snižování</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Použít výrazy přiřazení jako například v: while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Maximální počet zobrazených prvků pole</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Maximální délka řetězce</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Přidat 'private' modifikátor pro členy typu</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Dekompilovat objekt nebo iniciátory kolekce</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Zobrazit jeden vlastní atribut na řádek</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Odstranit prázdné výchozí konstruktory</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Nahradit 'new delegate-class(xxx)' slovy 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Zobrazit skryté typy a metody generované kompilátorem</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Zobrazit komentáře opkódů IL</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Zobrazit bajty IL instrukce</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Zobrazit čísla řádku a jména souborů, pokud jsou k dispozici</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Zobrazit tokeny, RVA a ofsety</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Zobrazit XML dokumentaci v dekompilovaném kódu</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Seřadit vlastní atributy</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Seřadit metody, pole, vlastnosti, události a typy</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Umístit direktivy 'System' jako první při třídění</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Přidat na typy modifikátor 'internal'</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Použít názvy proměnných ze symbolů ladění, pokud jsou k dispozici</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Uspořádat členy v pořadí zdrojového kódu</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Using Deklarationen hinzufügen</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Felder initialisieren</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Immer Variable für Ausnahme im catch-Block generieren außer der Typ ist Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Dekompilierungsreihenfolge</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Anonyme Methoden/Lambda-Ausdrücke dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Async-Methoden (async/await) dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Automatisch implementierte Ereignisse dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Automatisch implementierte Eigenschaften dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Enumeratoren (yield return) dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Ausdrucksbaumstrukturen dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>foreach-Anweisungen dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>lock-Anweisungen dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Abfrageausdrücke dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Switch-Anweisungen mit Zeichenfolgen dekompilieren</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>using-Anweisungen dekompilieren</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Allen Typen einen Namespace hinzufügen</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Typen mit dem gleichen Namen einen Namespace hinzufügen</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Hexadezimale Zahlen</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Inkrement- und Dekrementoperatoren verwenden</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Verwende Zuweisungsausdrücke wie in while ((count = Do()) != 0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Maximale Anzahl an anzuzeigenden Array-Elementen</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Maximale Zeichenkettenlänge</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Modifizierer 'private' zu Typmembern hinzufügen</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Dekompiliere Objekt oder Auflistung Initialisierungen</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Ein Attribut pro Zeile anzeigen</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Leere Standardkonstruktoren entfernen</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>'new delegate-class(xxx)' durch 'xxx' ersetzen</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Versteckte Compiler generierte Typen und Methoden anzeigen</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>IL-Opcode Kommentare anzeigen</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Bytes der IL Instruktion anzeigen</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Dateinamen und Zeilennummern bei Verfügbarkeit anzeigen</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Token, RVAs und Datei-Offsets anzeigen</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>XML-Dokumentation in dekompiliertem Code anzeigen</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Benutzerdefinierte Attribute sortieren</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Methoden, Felder, Eigenschaften, Ereignisse und Typen sortieren</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>"System"-Direktiven beim Sortieren von using-Direktiven zuerst anordnen</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Modifizierer 'internal' zu Typen hinzufügen</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Variablennamen von Debugsymbolen verwenden, falls vorhanden</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Member wie im Quellcode anordnen</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Añadir declaraciones using</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Permiten a inicializadores de campo</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Genere siempre variables de excepción en bloques catch a menos que el tipo sea Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Orden de descompilación</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Descompilar métodos anónimos/lambdas</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Descompilar métodos asincrónicos (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Descompilar eventos automáticamente</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Descompilar propiedades automáticamente</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Descompilar enumeradores (retorno yield)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Descompilar árboles de expresión</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Descompilar declaraciones foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Descompilar declaraciones de bloqueo</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Descompilar expresiones de consulta</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Descompilar interruptor de cadena</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Descompilar sentencias using</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Agregar espacios de nombre a todos los tipos</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Añadir un espacio de nombre a los tipos con el mismo nombre</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Números hexadecimales</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Uso de incremento y decremento de operadores</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Asignación de expresiones tales como while ((Count = Do())! = 0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Número máximo de elementos de matriz para mostrar</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Longitud máxima de cadena</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Añadir el modificador 'private' para miembros type</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Descompilar los inicializadores de objeto o colección</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Mostrar un atributo personalizado por línea</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Quitar los constructores predeterminados de vacío</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Reemplazar 'delegate-class(xxx) nuevo' con 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Mostrar los tipos y métodos ocultos generados por el compilador</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Mostrar los comentarios de opcode IL</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Mostrar las instrucciones bytes IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mostrar números de línea y nombres de archivos si están disponibles</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Mostrar fichas, RVAs y compensaciones de archivo</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Mostrar la documentación XML en código descompilado</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Ordenar atributos personalizados</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Ordenar los métodos, campos, propiedades, eventos y tipos</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Colocar la directiva 'using System' en primer al ordenar los using´s</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Agregue el modificador 'internal' a tipos</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Utilice nombres de variables de símbolos de depuración, si está disponible</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Ordene miembros en orden de código fuente</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>اضافه کردن با استفاده از تعاریف</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>اجازه دادن به فیلد آغازگر</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>همیشه متغیرهای exception را در بلاک های catch ایجادکن مگر اینکه نوع Object باشد</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>ترتیب دیکامپایل</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>دیکامپایل method/lambda های ناشناس</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>دیکامپایل متودهای ناهمگام (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>دیکامپایل event های خودکار</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>دیکامپایل خواص خودکار</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>دیکامپایل شمارنده ها (بازگشت yield)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>دیکامپایل درخت های expression</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>دیکامپایل foreach statements</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>دیکامپایل lock statements</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>دیکامپایل query expressions</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>دیکامپایل سوئیچ در رشته</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>دیکامپایل با استفاده از statement ها</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>اضافه کردن فضاهای نام به همه تایپ ها</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>اضافه کردن فضای نام به انواع با نام مشابه</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>اعداد هگز</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>استفاده از اپراتورهای افزایشی و کاهشی</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>استفاده از انتصاب اصطلاحات مانند استفاده در while ها ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>حداکثر تعداد عناصر آرایه برای نشان دادن</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>حداکثر طول رشته</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>اضافه کردن اصلاح کننده 'خصوصی'به اعضای تایپ</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>دیکامپایل آبجکت یا مجموعه ی آغازگرها</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>نمایش یک attribute سفارشی شده در هر خط</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>حذف constructor های خالی پیشفرض</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>جایگزینی 'new delegate-class(xxx)' با 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>نمایش متودها و تایپ های مخفی تولید شده توسط دیکامپایلر</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>نمایش توضیحات IL opcode</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>نمایش بایت های دستورات IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>نمایش شماره خط و نام فایل در صورت وجود</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>نشان دادن token ها، RVA ها و آفست های فایل</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>نمایش مستندات XML در کد های دیکامپایل شده</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>مرتب کردن attribute های سفارشی</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>مرتب کردن method ها، field ها، propertie ها، event ها و type ها</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>دستورالعمل های 'System' را هنگام مرتب سازی using ها ابتدا قرار بده</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>اضافه کردن اصلاح کننده "داخلى" به تایپ ها</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>استفاده از نام متغیرها از سیمبول های دیباگ، در صورت وجود</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>منظم کردن اعضا در ترتیب سورس کد</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Ajouter les déclarations "using"</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Autoriser les "initializers" de champs</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Toujours générer des variables dexception dans les blocs "catch" sauf si le type est Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Ordre de décompilation</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Décompiler les méthodes anonymes/lambda</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Décompiler des méthodes asynchrones (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Décompiler les events automatiques</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Décompiler les propriétés automatiques</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Décompiler les énumérateurs (yield)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Décompiler les arbres d'expressions</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Décompiler les "foreach"</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Décompiler les "lock"</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Décompiler les expressions de requêtes</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Décompiler le switch sur string</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Décompiler les instructions "using"</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Ajouter des espaces de noms à tous les types</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Ajouter un espace de noms aux types portant le même nom</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Nombres hexadécimaux</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Utiliser les opérateurs incrémentaux/décrémentaux</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Utiliser des expressions dassignation comme dans while((c = Executer()) !=0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Nombre maximal déléments de tableau à afficher</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Longueur de chaîne maximale</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Ajoutez le modificateur « privé » pour les membres de type</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Décompiler les initialiseurs dobjets ou de collections</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Afficher un attribut personnalisé par ligne</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Supprimer les constructeurs par défaut vides</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Remplacer « new delegate-class(xxx) » par « xxx »</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Afficher les types et méthodes générées cachées par le compilateur</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Afficher les commentaires d'opcode IL</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Afficher les bytes des instructions de l'IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Afficher les numéros de lignes et noms de fichiers si disponibles</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Afficher les tokens, RVAs et offsets dans les fichiers</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Afficher la documentation XML dans le code décompilé</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Trier les attributs personnalisés</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Trier les méthodes, champs, propriétés, events et types</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Priorité donnée aux "system" lors du tri des "using"</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Ajoutez le modificateur « interne » aux types</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Utilisez des noms de variables de symboles de débogage, si disponible</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Membres triés selon lordre du code source</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>using deklarciók hozzáadása</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Mező inicializálók engedélyezése</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Mindig generáljon kivétel változókat az elkapó blokkban, kivéve ha a típus Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Visszafordítási sorrend</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Anoním metódusok/lambdák visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Aszinkron metódusok (async/await) visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Automatikus események visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Automatikus tulajdonságok visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Enumerátorok (yield return) visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Kifejezés fák visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>foreach utasítások visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>lock utasítások visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Lekérdező kifejezések visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Karakterláncon végzett switch visszafordítása</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Using utasítások visszafordítása</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Névtér hozzáadása minden típushoz</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Névtér hozzáadása az azonos nevű típusokhoz</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Hexadecimális számok</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Növelő és csökkentő operátorok használata</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Hozzárendelő kifejezések használata, mint pl. while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Maximum megjelenítendő tömb elemek száma</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Maximális karakterlánc hossz</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>A 'private' módosító hozzáadása a típus tagokhoz</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Objektum és gyűjtemény inicializálók visszafordítása</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Egy egyedi attribútum mutatása soronként</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Üres alapértelmezett konstrukturok eltávolítása</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>A 'new delegate-class(xxx)' kicserélése 'xxx'-re</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Mutassa a rejtett, fordító által generált típusokat és metódusokat</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>IL opcode megjegyzések mutatása</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>IL utasítás bájtok mutatása</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mutassa a sorszámokat és a fájlneveket, ha elérhetőek</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Mutassa a token-eket, RVA-kat és a fájl eltolásokat</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Mutassa az XML dokumentációt a visszafordított kódban</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Egyéni attribútumok rendezése</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Rendezze a metódusokat, mezőket, tulajdonságokat, eseményeket és típusokat</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>A 'System' direktívákat vegye előre a using-ok rendezésekor</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>'internal' módosító hozzáadása a típusokhoz</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Használja a hibakeresési szimbólumok szerinti változó neveket, ha elérhetőek</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Tagok rendezése a forráskód szerint</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Aggiungere mediante dichiarazioni</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Consentire gli inizializzatori di campo</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Generare sempre le variabili di eccezione in blocchi catch a meno che tipo non sia un oggetto</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Ordine di decompilazione</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Decompila metodi/lambda anonimi</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Decompila metodi async (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Decompila gli eventi automatici</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Decompila proprietà automatiche</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Decompila gli enumeratori (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Decompila alberi espressione</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Decompila istruzioni foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Decompila istruzioni lock</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Decompila espressioni query</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Decompila switch sulla stringa</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Decompila usando istruzioni</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Aggiungi spazi dei nomi per tutti i tipi</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Aggiungi uno spazio dei nomi per i tipi con lo stesso nome</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Numeri esadecimali</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Utilizza operatori di incremento e decremento</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Utilizza le espressioni di assegnazione così come nel while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Numero massimo di elementi della matrice da mostrare</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Lunghezza massima della stringa</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Aggiungi il modificatore 'private' ai membri di tipo</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Decompila oggetto o inizializzatori di collezione</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Mostra un attributo personalizzato per riga</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Rimuovi i costruttori predefiniti vuoti</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Sostituire 'nuova delegate-class(xxx)' con 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Visualizza i metodi e i tipi nascosti generati dal compilatore</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Visualizza il commento sul codice operativo IL</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Visualizza i byte di instruzione del codie IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mostra i numeri di linea ed i nomi dei file, se disponibili</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Visualizza token, RVA e offset del file</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Visualizza documentazione XML nel codice decompilato</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Ordina attributi personalizzati</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Ordina metodi, campi, proprietà, eventi e tipi</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Porta le direttive 'System' al primo posto quando si usa l'ordinamento</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Aggiungi il modificatore 'internal' ai tipi</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Utilizza nomi di variabili da simboli di debug, se disponibili</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Ordina i membri nell'ordine del codice sorgente</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Adicionar declarações 'using'</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Permitir inicializadores de campo</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Sempre gerar variáveis de exceção em blocos catch, a menos que o tipo seja Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Ordem de descompilação</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Descompilar métodos/lambdas anônimos</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Descompilar métodos assíncronos (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Descompilar eventos automáticos</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Descompilar propriedades automáticas</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Descompilar enumeradores (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Descompilar árvores de expressão</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Descompilar instruções foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Descompilar instruções lock</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Descompilar expressões query</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Descompilar switch on string</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Descompilar usando instruções</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Adicionar namespaces a todos os tipos</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Adicionar um namespace para tipos com o mesmo nome</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Números hexadecimais</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Usar operadores de incremento e decremento</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Utilize expressões de atribuição, como em while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Número máximo de elementos do array para mostrar</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Comprimento máximo do texto</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Adicionar modificador 'private' aos membros de tipo</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Descompilar objetos ou inicializadores de coleção</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Mostrar um atributo personalizado por linha</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Remover os construtores padrão vazio</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Substituir 'new delegate-class(xxx)' por 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Mostrar tipos e métodos escondidos gerados pelo compilador</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Mostrar comentários IL opcode</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Mostrar bytes de instruções IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mostrar números de linhas e nomes de arquivos, se disponível</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Mostrar tokens, RVAs e arquivos offsets</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Exibir a documentação XML no código descompilado</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Classificar atributos personalizados</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Classificar métodos, campos, propriedades, eventos e tipos</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Posicionar diretivas do 'Sistema' primeiro ao classificar</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Adicionar modificador 'interno' aos tipos</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Utilizar nomes de variáveis de símbolos de depuração, se disponíveis</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Classificar membros em ordem de código fonte</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Adicionar usando declarações</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Permitir inicializadores de campo</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Sempre gerar variáveis de exceção em blocos catch, a menos que o tipo seja Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Ordem de descompilação</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Descompilar métodos/lambdas anônimos</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Descompilar métodos assíncronos (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Descompilar eventos automáticos</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Descompilar propriedades automáticas</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Descompilar enumerators (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Descompilar árvores de expressão</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Descompilar declarações foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Descompilar instruções lock</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Descompilar expressões de consulta</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Descompilar switch on string</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Descompilar instruções using</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Adicionar namespaces para todos os tipos</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Adicionar um namespace para tipos com o mesmo nome</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Números hexadecimais</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Usar operadores de incremento e decremento</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Usar expressões de atribuição, tal como em while ((cont = Do())! = 0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Número máximo de elementos em array para mostrar</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Comprimento máximo do texto</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Adicionar o modificador 'private' aos membros de tipo</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Descompilar objetos ou inicializadores de coleção</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Mostrar um atributo personalizado por linha</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Remover construtores padrão vazios</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Substituir 'new delegate-class(xxx)' por 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Mostrar tipos e métodos escondidos gerados pelo compilador</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Mostrar comentários IL opcode</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Mostrar bytes de instruções IL </value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mostrar números de linha e nomes de ficheiro se disponíveis</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Mostrar tokens, RVAs e offsets de ficheiros</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Mostrar a documentação XML no código descompilado</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Ordenar atributos personalizados</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Ordenar métodos, campos, propriedades, eventos e tipos</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Posicionar diretivas 'Sistema' primeiro ao ordenar usings</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Adicionar o modificador 'internal' aos tipos</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Usar nomes de variáveis de símbolos de depuração, se disponível</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Ordenar membros em ordem de código fonte</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Add using declarations</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Allow field initializers</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Always generate exception variables in catch blocks unless type is Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Decompilation order</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Decompile anonymous methods/lambdas</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Decompile async methods (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Decompile automatic events</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Decompile automatic properties</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Decompile enumerators (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Decompile expression trees</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Decompile foreach statements</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Decompile lock statements</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Decompile query expressions</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Decompile switch on string</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Decompile using statements</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Add namespaces to all types</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Add a namespace to types with the same name</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Hexadecimal numbers</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Use increment and decrement operators</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Use assignment expressions such as in while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Max number of array elements to show</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Max string length</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Add 'private' modifier to type members</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Decompile object or collection initializers</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Show one custom attribute per line</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Remove empty default constructors</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Replace 'new delegate-class(xxx)' with 'xxx'</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Show hidden compiler generated types and methods</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Show IL opcode comments</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Show IL instruction bytes</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Show line numbers and filenames if available</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Show tokens, RVAs and file offsets</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Show XML documentation in decompiled code</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Sort custom attributes</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Sort methods, fields, properties, events and types</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Place 'System' directives first when sorting usings</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Add 'internal' modifier to types</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Use variable names from debug symbols, if available</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Order members in source code order</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Добавить определения using</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Разрешить инициализаторы полей</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Всегда создавать переменные исключения в блоках catch, если тип не Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Порядок декомпиляции</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Декомпилировать анонимные методы/лямбды</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Декомпилировать асинхронные методы (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Декомпилировать автоматические события</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Декомпилировать автоматические свойства</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Декомпилировать перечислители (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Декомпилировать деревья выражений</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Декомпилировать операторы foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Декомпилировать операторы lock</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Декомпилировать выражения запросов</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Декомпилировать switch по строкам</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Декомпилировать операторы using</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Добавить пространства имен во все типы</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Добавить пространство имен в типы с таким же именем</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Шестнадцатеричные цифры</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Использовать операторы инкремента и декремента</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Использовать выражения присваивания, такие как в while ((count = Do()) != 0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Максимальное количество отображаемых элементов массива</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Максимальная длина строки</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Добавить модификатор 'private' к членам типа</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Декомпилировать инициализаторы объекта или коллекции</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Показывать по одному атрибуту на строке</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Удалить пустые конструкторы по умолчанию</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Заменить «new delegate-class(xxx)» на «xxx»</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Показывать скрытые типы и методы, созданные компилятором</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Показать комментарии к IL-инструкциям</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Показывать байты IL-инструкций</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Показать номера строк и имена файлов, если имеются</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Показывать токены, RVA и смещения в файле</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Показать документацию XML в декомпилированном коде</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Сортировать пользовательские атрибуты</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Сортировать методы, поля, свойства, события и типы</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Поместить директивы 'System' в начало при сортировке</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Добавить модификатор 'internal' к типам</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Использовать имена переменных из отладочных символов, при наличии</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Сортировать члены как в исходном коде</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Kullanılan bildirimleri ekle</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Alan başlatıcılara izin ver</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Tip Object değilken her zaman catch bloklarında her zaman isnisna değişkenler üret</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Geri derleme sırası</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Anonim method/lambda ları geri derle</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Asenkron methodları (async/await) geri derle</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Otomatik olayları geri derle</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Otomatik özellikleri geri derle</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Enumaretörleri (verim getirisi) geri derle</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>İfade ağaçlarını geri derle</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Her ifade için geri derle</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Kitli ifadeleri geri derle</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Sorgu ifadelerini geri derle</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Dizideki anahtarları geri derle</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>İfadeleri kullanarak geri derle</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Tüm tipler için isim boşlukları ekle</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Aynı isimdeki tipler için bir isim boşluğu ekle</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Onaltılık sayılar</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Artış ve azalış uygulayıcıları kullan</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>((count = Do()) != 0); gibi atanmış ifadeleri kullan</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Gösterilebilecek maksimum dizi elementi sayısı</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Maksimum metin uzunluğu</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Tip üyelerine 'gizli' değişimi ekle</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Başlatıcı derlemesini veya objeyi geri derle</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Her hat için bir nitelik göster</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Varsayılan boş kurucuları kaldır</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>'new delegate-class(xxx)' ı 'xxx' ile değiştir</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Gizli derleyici tarafından oluşturulan türleri ve yöntemleri göster</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>IL opcode yorumlarını göster</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>IL komut bitlerini göster</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Mümkünse hat numaralarını ve dosya isimlerini göster</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Belirteçleri, RVA ları ve dosya denkleştirmelerini göster</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Geri derlenmiş koddaki XML dökümanlarını göster</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Özel nitelikleri sınıflandır</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Metodları, alanları, özellikleri, olayları ve tipleri sınıflandır</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Kullanılanları sınıflandırırken 'sistem' direktiflerini ilk olarak yerleştir</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Tiplere 'iç' değiştirici ekle</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Mümkünse, hata ayıklanmış sembollerden değişken isimler kullan</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Kaynak kod sırasındaki diğer üyeler</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>Додати за допомогою декларацій</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>Дозволити ініціалізатори поля</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>Завжди генерувати exception змінні в catch-блоках, якщо ти не Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>Порядок Декомпіляції</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>Декомпілювати анонімні методи/lambdas</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>Декомпілювати async методи (async/await)</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>Декомпілювати автоматичні події</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>Декомпілювати автоматичні властивості</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>Декомпілювати перечислення (yield return)</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>Декомпілювати дерева виразів</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>Декомпілювати оператори foreach</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>Декомпілювати оператори lock</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>Декомпілювати вирази запитів</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>Декомпілювати switch по стрічках</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>Декомпілювати оператори using</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>Додати простори імен для всіх типів</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>Додати простір імен в типи с таким же ім'ям</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>Шістнадцяткові числа</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>Використати оператори інкременту та декременту</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>Використати вирази присвоєння такі, як у while ((count = Do()) != 0);</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>Показувати максимальну кількість елементів масиву</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>Максимальна довжина стрічки</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>Додати модифікатор 'private' до членів типу</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>Декомпілювати ініціалізатори об'єкта чи колекції</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>Показувати по одному атрибуту на рядку</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>Видаляти пусті конструктори по замовчуванню</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>Замінити «new delegate-class(xxx)» на «xxx»</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>Показати приховані типи і методи, створені компілятором</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>Показати коментарі до IL інструкцій</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>Показати байти інструкцій IL</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>Показати номери рядків та імена файлів</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>Показувати токени, RVA і офсети у файлі</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>Показати XML документацію в декомпільованому коді</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>Сортувати користувацькі атрибути</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>Сортувати методи, поля, властивості, події і типи</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>Помістити 'System'-ні директиви на початок при сортуванні</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>Додати модифікатор 'internal' до типів</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>Використовувати імена змінних із дебаг символів, при наявності</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>Сортувати члени як в джерельному коді</value>
</data>
</root>

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilerSettings_AddUsingDeclarations" xml:space="preserve">
<value>添加using声明</value>
</data>
<data name="DecompilerSettings_AllowFieldInitializers" xml:space="preserve">
<value>允许字段初始值设定项语法</value>
</data>
<data name="DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject" xml:space="preserve">
<value>在catch块中总是生成异常变量除非类型为Object</value>
</data>
<data name="DecompilerSettings_DecompilationOrder" xml:space="preserve">
<value>反编译顺序</value>
</data>
<data name="DecompilerSettings_DecompileAnonMethods" xml:space="preserve">
<value>反编译匿名方法/lambda方法</value>
</data>
<data name="DecompilerSettings_DecompileAsyncMethods" xml:space="preserve">
<value>反编译异步方法async/await</value>
</data>
<data name="DecompilerSettings_DecompileAutoEvents" xml:space="preserve">
<value>反编译自动生成的事件</value>
</data>
<data name="DecompilerSettings_DecompileAutoProps" xml:space="preserve">
<value>反编译自动生成的属性</value>
</data>
<data name="DecompilerSettings_DecompileEnumerators" xml:space="preserve">
<value>反编译枚举器yield return</value>
</data>
<data name="DecompilerSettings_DecompileExprTrees" xml:space="preserve">
<value>反编译表达式树Expression Trees</value>
</data>
<data name="DecompilerSettings_DecompileForeachStatements" xml:space="preserve">
<value>反编译foreach语句</value>
</data>
<data name="DecompilerSettings_DecompileLockStatements" xml:space="preserve">
<value>反编译lock语句</value>
</data>
<data name="DecompilerSettings_DecompileQueryExpr" xml:space="preserve">
<value>反编译查询表达式</value>
</data>
<data name="DecompilerSettings_DecompileSwitchOnString" xml:space="preserve">
<value>反编译string类型的switch语句</value>
</data>
<data name="DecompilerSettings_DecompileUsingStatements" xml:space="preserve">
<value>反编译using语句</value>
</data>
<data name="DecompilerSettings_FullyQualifyAllTypes" xml:space="preserve">
<value>将命名空间名添加到所有类型</value>
</data>
<data name="DecompilerSettings_FullyQualifyAmbiguousTypeNames" xml:space="preserve">
<value>将命名空间名添加到具有相同名称的类型</value>
</data>
<data name="DecompilerSettings_HexadecimalNumbers" xml:space="preserve">
<value>十六进制数</value>
</data>
<data name="DecompilerSettings_IntroduceIncrementAndDecrement" xml:space="preserve">
<value>使用增量和减量运算符</value>
</data>
<data name="DecompilerSettings_MakeAssignmentExpressions" xml:space="preserve">
<value>在流程控制语句中使用赋值表达式如while ((count = Do()) != 0) ;</value>
</data>
<data name="DecompilerSettings_MaxArrayElements" xml:space="preserve">
<value>要显示的数组元素最大数量</value>
</data>
<data name="DecompilerSettings_MaxStringLength" xml:space="preserve">
<value>最大字符串长度</value>
</data>
<data name="DecompilerSettings_MemberAddPrivateModifier" xml:space="preserve">
<value>添加private标识符到类成员</value>
</data>
<data name="DecompilerSettings_ObjectOrCollectionInitializers" xml:space="preserve">
<value>反编译对象或集合的初始值设定项</value>
</data>
<data name="DecompilerSettings_OneCustomAttributePerLine" xml:space="preserve">
<value>每行显示一个自定义特性</value>
</data>
<data name="DecompilerSettings_RemoveEmptyDefaultCtors" xml:space="preserve">
<value>移除空的默认构造函数</value>
</data>
<data name="DecompilerSettings_RemoveNewDelegateClass" xml:space="preserve">
<value>将 “new delegate-class(xxx)” 替换为 “xxx”</value>
</data>
<data name="DecompilerSettings_ShowCompilerGeneratedTypes" xml:space="preserve">
<value>显示编译器生成的隐藏类型和方法</value>
</data>
<data name="DecompilerSettings_ShowILComments" xml:space="preserve">
<value>显示IL操作码注释</value>
</data>
<data name="DecompilerSettings_ShowILInstrBytes" xml:space="preserve">
<value>显示IL指令字节</value>
</data>
<data name="DecompilerSettings_ShowPdbInfo" xml:space="preserve">
<value>显示行号和文件名(如果可用)</value>
</data>
<data name="DecompilerSettings_ShowTokensRvasOffsets" xml:space="preserve">
<value>显示标记RVA和文件偏移</value>
</data>
<data name="DecompilerSettings_ShowXMLDocComments" xml:space="preserve">
<value>在反编译的代码中显示 XML 文档</value>
</data>
<data name="DecompilerSettings_SortCustomAttributes" xml:space="preserve">
<value>排序自定义特性</value>
</data>
<data name="DecompilerSettings_SortMethods" xml:space="preserve">
<value>排序方法、 字段、 属性、 事件和类型</value>
</data>
<data name="DecompilerSettings_SortSystemFirst" xml:space="preserve">
<value>在排序using时将System系列置于首位</value>
</data>
<data name="DecompilerSettings_TypeAddInternalModifier" xml:space="preserve">
<value>添加internal标识符到类</value>
</data>
<data name="DecompilerSettings_UseLocalNameFromSyms" xml:space="preserve">
<value>如果可用使用debug symbols声明的变量名称</value>
</data>
<data name="DecompilerSettings_UseSourceCodeOrder" xml:space="preserve">
<value>按源代码顺序排序成员</value>
</data>
</root>

View File

@ -0,0 +1,281 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using dnSpy.Contracts.Decompiler;
using dnSpy.Decompiler.ILSpy.Core.Properties;
using dnSpy.Decompiler.Settings;
using ICSharpCode.Decompiler;
namespace dnSpy.Decompiler.ILSpy.Core.Settings {
sealed class CSharpVBDecompilerSettings : DecompilerSettingsBase {
public DecompilerSettings Settings => decompilerSettings;
readonly DecompilerSettings decompilerSettings;
public override int Version => decompilerSettings.SettingsVersion;
public override event EventHandler? VersionChanged;
public CSharpVBDecompilerSettings(DecompilerSettings? decompilerSettings = null) {
this.decompilerSettings = decompilerSettings ?? new DecompilerSettings();
options = CreateOptions().ToArray();
this.decompilerSettings.SettingsVersionChanged += DecompilerSettings_SettingsVersionChanged;
}
void DecompilerSettings_SettingsVersionChanged(object? sender, EventArgs e) => VersionChanged?.Invoke(this, EventArgs.Empty);
public override DecompilerSettingsBase Clone() => new CSharpVBDecompilerSettings(decompilerSettings.Clone());
public override IEnumerable<IDecompilerOption> Options => options;
readonly IDecompilerOption[] options;
IEnumerable<IDecompilerOption> CreateOptions() {
yield return new DecompilerOption<string>(DecompilerOptionConstants.MemberOrder_GUID,
() => GetMemberOrder(), a => SetMemberOrder(a)) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompilationOrder,
Name = DecompilerOptionConstants.MemberOrder_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AnonymousMethods_GUID,
() => decompilerSettings.AnonymousMethods, a => decompilerSettings.AnonymousMethods = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileAnonMethods,
Name = DecompilerOptionConstants.AnonymousMethods_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ExpressionTrees_GUID,
() => decompilerSettings.ExpressionTrees, a => decompilerSettings.ExpressionTrees = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileExprTrees,
Name = DecompilerOptionConstants.ExpressionTrees_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.YieldReturn_GUID,
() => decompilerSettings.YieldReturn, a => decompilerSettings.YieldReturn = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileEnumerators,
Name = DecompilerOptionConstants.YieldReturn_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AsyncAwait_GUID,
() => decompilerSettings.AsyncAwait, a => decompilerSettings.AsyncAwait = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileAsyncMethods,
Name = DecompilerOptionConstants.AsyncAwait_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AutomaticProperties_GUID,
() => decompilerSettings.AutomaticProperties, a => decompilerSettings.AutomaticProperties = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileAutoProps,
Name = DecompilerOptionConstants.AutomaticProperties_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AutomaticEvents_GUID,
() => decompilerSettings.AutomaticEvents, a => decompilerSettings.AutomaticEvents = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileAutoEvents,
Name = DecompilerOptionConstants.AutomaticEvents_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.UsingStatement_GUID,
() => decompilerSettings.UsingStatement, a => decompilerSettings.UsingStatement = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileUsingStatements,
Name = DecompilerOptionConstants.UsingStatement_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ForEachStatement_GUID,
() => decompilerSettings.ForEachStatement, a => decompilerSettings.ForEachStatement = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileForeachStatements,
Name = DecompilerOptionConstants.ForEachStatement_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.LockStatement_GUID,
() => decompilerSettings.LockStatement, a => decompilerSettings.LockStatement = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileLockStatements,
Name = DecompilerOptionConstants.LockStatement_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.SwitchStatementOnString_GUID,
() => decompilerSettings.SwitchStatementOnString, a => decompilerSettings.SwitchStatementOnString = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileSwitchOnString,
Name = DecompilerOptionConstants.SwitchStatementOnString_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.UsingDeclarations_GUID,
() => decompilerSettings.UsingDeclarations, a => decompilerSettings.UsingDeclarations = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_AddUsingDeclarations,
Name = DecompilerOptionConstants.UsingDeclarations_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.QueryExpressions_GUID,
() => decompilerSettings.QueryExpressions, a => decompilerSettings.QueryExpressions = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_DecompileQueryExpr,
Name = DecompilerOptionConstants.QueryExpressions_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.FullyQualifyAmbiguousTypeNames_GUID,
() => decompilerSettings.FullyQualifyAmbiguousTypeNames, a => decompilerSettings.FullyQualifyAmbiguousTypeNames = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_FullyQualifyAmbiguousTypeNames,
Name = DecompilerOptionConstants.FullyQualifyAmbiguousTypeNames_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.FullyQualifyAllTypes_GUID,
() => decompilerSettings.FullyQualifyAllTypes, a => decompilerSettings.FullyQualifyAllTypes = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_FullyQualifyAllTypes,
Name = DecompilerOptionConstants.FullyQualifyAllTypes_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.UseDebugSymbols_GUID,
() => decompilerSettings.UseDebugSymbols, a => decompilerSettings.UseDebugSymbols = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_UseLocalNameFromSyms,
Name = DecompilerOptionConstants.UseDebugSymbols_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ObjectOrCollectionInitializers_GUID,
() => decompilerSettings.ObjectOrCollectionInitializers, a => decompilerSettings.ObjectOrCollectionInitializers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ObjectOrCollectionInitializers,
Name = DecompilerOptionConstants.ObjectOrCollectionInitializers_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowXmlDocumentation_GUID,
() => decompilerSettings.ShowXmlDocumentation, a => decompilerSettings.ShowXmlDocumentation = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowXMLDocComments,
Name = DecompilerOptionConstants.ShowXmlDocumentation_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.RemoveEmptyDefaultConstructors_GUID,
() => decompilerSettings.RemoveEmptyDefaultConstructors, a => decompilerSettings.RemoveEmptyDefaultConstructors = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_RemoveEmptyDefaultCtors,
Name = DecompilerOptionConstants.RemoveEmptyDefaultConstructors_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.IntroduceIncrementAndDecrement_GUID,
() => decompilerSettings.IntroduceIncrementAndDecrement, a => decompilerSettings.IntroduceIncrementAndDecrement = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_IntroduceIncrementAndDecrement,
Name = DecompilerOptionConstants.IntroduceIncrementAndDecrement_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.MakeAssignmentExpressions_GUID,
() => decompilerSettings.MakeAssignmentExpressions, a => decompilerSettings.MakeAssignmentExpressions = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_MakeAssignmentExpressions,
Name = DecompilerOptionConstants.MakeAssignmentExpressions_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject_GUID,
() => decompilerSettings.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject, a => decompilerSettings.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject,
Name = DecompilerOptionConstants.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowTokenAndRvaComments_GUID,
() => decompilerSettings.ShowTokenAndRvaComments, a => decompilerSettings.ShowTokenAndRvaComments = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowTokensRvasOffsets,
Name = DecompilerOptionConstants.ShowTokenAndRvaComments_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.SortMembers_GUID,
() => decompilerSettings.SortMembers, a => decompilerSettings.SortMembers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_SortMethods,
Name = DecompilerOptionConstants.SortMembers_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ForceShowAllMembers_GUID,
() => decompilerSettings.ForceShowAllMembers, a => decompilerSettings.ForceShowAllMembers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowCompilerGeneratedTypes,
Name = DecompilerOptionConstants.ForceShowAllMembers_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.SortSystemUsingStatementsFirst_GUID,
() => decompilerSettings.SortSystemUsingStatementsFirst, a => decompilerSettings.SortSystemUsingStatementsFirst = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_SortSystemFirst,
Name = DecompilerOptionConstants.SortSystemUsingStatementsFirst_NAME,
};
yield return new DecompilerOption<int>(DecompilerOptionConstants.MaxArrayElements_GUID,
() => decompilerSettings.MaxArrayElements, a => decompilerSettings.MaxArrayElements = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_MaxArrayElements,
Name = DecompilerOptionConstants.MaxArrayElements_NAME,
};
yield return new DecompilerOption<int>(DecompilerOptionConstants.MaxStringLength_GUID,
() => decompilerSettings.MaxStringLength, a => decompilerSettings.MaxStringLength = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_MaxStringLength,
Name = DecompilerOptionConstants.MaxStringLength_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.SortCustomAttributes_GUID,
() => decompilerSettings.SortCustomAttributes, a => decompilerSettings.SortCustomAttributes = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_SortCustomAttributes,
Name = DecompilerOptionConstants.SortCustomAttributes_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.UseSourceCodeOrder_GUID,
() => decompilerSettings.UseSourceCodeOrder, a => decompilerSettings.UseSourceCodeOrder = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_UseSourceCodeOrder,
Name = DecompilerOptionConstants.UseSourceCodeOrder_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.AllowFieldInitializers_GUID,
() => decompilerSettings.AllowFieldInitializers, a => decompilerSettings.AllowFieldInitializers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_AllowFieldInitializers,
Name = DecompilerOptionConstants.AllowFieldInitializers_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.OneCustomAttributePerLine_GUID,
() => decompilerSettings.OneCustomAttributePerLine, a => decompilerSettings.OneCustomAttributePerLine = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_OneCustomAttributePerLine,
Name = DecompilerOptionConstants.OneCustomAttributePerLine_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.TypeAddInternalModifier_GUID,
() => decompilerSettings.TypeAddInternalModifier, a => decompilerSettings.TypeAddInternalModifier = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_TypeAddInternalModifier,
Name = DecompilerOptionConstants.TypeAddInternalModifier_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.MemberAddPrivateModifier_GUID,
() => decompilerSettings.MemberAddPrivateModifier, a => decompilerSettings.MemberAddPrivateModifier = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_MemberAddPrivateModifier,
Name = DecompilerOptionConstants.MemberAddPrivateModifier_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.RemoveNewDelegateClass_GUID,
() => decompilerSettings.RemoveNewDelegateClass, a => decompilerSettings.RemoveNewDelegateClass = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_RemoveNewDelegateClass,
Name = DecompilerOptionConstants.RemoveNewDelegateClass_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.HexadecimalNumbers_GUID,
() => decompilerSettings.HexadecimalNumbers, a => decompilerSettings.HexadecimalNumbers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_HexadecimalNumbers,
Name = DecompilerOptionConstants.HexadecimalNumbers_NAME,
};
}
string GetMemberOrder() =>
GetMemberOrderString(decompilerSettings.DecompilationObject0) +
GetMemberOrderString(decompilerSettings.DecompilationObject1) +
GetMemberOrderString(decompilerSettings.DecompilationObject2) +
GetMemberOrderString(decompilerSettings.DecompilationObject3) +
GetMemberOrderString(decompilerSettings.DecompilationObject4);
static string GetMemberOrderString(DecompilationObject d) {
switch (d) {
case DecompilationObject.NestedTypes: return "t";
case DecompilationObject.Fields: return "f";
case DecompilationObject.Events: return "e";
case DecompilationObject.Properties: return "p";
case DecompilationObject.Methods: return "m";
default:
Debug.Fail("Shouldn't be here");
return "?";
}
}
void SetMemberOrder(string s) {
if (s is null || s.Length != 5)
return;
decompilerSettings.DecompilationObject0 = GetDecompilationObject(s[0]) ?? decompilerSettings.DecompilationObject0;
decompilerSettings.DecompilationObject1 = GetDecompilationObject(s[1]) ?? decompilerSettings.DecompilationObject1;
decompilerSettings.DecompilationObject2 = GetDecompilationObject(s[2]) ?? decompilerSettings.DecompilationObject2;
decompilerSettings.DecompilationObject3 = GetDecompilationObject(s[3]) ?? decompilerSettings.DecompilationObject3;
decompilerSettings.DecompilationObject4 = GetDecompilationObject(s[4]) ?? decompilerSettings.DecompilationObject4;
}
static DecompilationObject? GetDecompilationObject(char c) {
switch (c) {
case 't': return DecompilationObject.NestedTypes;
case 'f': return DecompilationObject.Fields;
case 'e': return DecompilationObject.Events;
case 'p': return DecompilationObject.Properties;
case 'm': return DecompilationObject.Methods;
}
return null;
}
public override bool Equals(object? obj) {
var other = obj as CSharpVBDecompilerSettings;
return other is not null && decompilerSettings.Equals(other.decompilerSettings);
}
public override int GetHashCode() => decompilerSettings.GetHashCode();
}
}

View File

@ -0,0 +1,48 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Threading;
namespace dnSpy.Decompiler.ILSpy.Core.Settings {
class DecompilerSettingsService {
/// <summary>
/// Should only be used indirectly by dnSpy.Console.exe
/// </summary>
public static DecompilerSettingsService __Instance_DONT_USE {
get {
if (__instance_DONT_USE is null)
Interlocked.CompareExchange(ref __instance_DONT_USE, new DecompilerSettingsService(), null);
return __instance_DONT_USE!;
}
}
static DecompilerSettingsService? __instance_DONT_USE;
protected DecompilerSettingsService() {
CSharpVBDecompilerSettings = new CSharpVBDecompilerSettings();
ILDecompilerSettings = new ILDecompilerSettings();
}
public CSharpVBDecompilerSettings CSharpVBDecompilerSettings { get; protected set; }
public ILDecompilerSettings ILDecompilerSettings { get; protected set; }
#if DEBUG
public ILAstDecompilerSettings ILAstDecompilerSettings { get; } = new ILAstDecompilerSettings();
#endif
}
}

View File

@ -0,0 +1,46 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
#if DEBUG
using System;
using System.Collections.Generic;
using dnSpy.Contracts.Decompiler;
namespace dnSpy.Decompiler.ILSpy.Core.Settings {
sealed class ILAstDecompilerSettings : DecompilerSettingsBase {
public override int Version => 0;
public override event EventHandler? VersionChanged { add { } remove { } }
public ILAstDecompilerSettings() {
}
ILAstDecompilerSettings(ILAstDecompilerSettings other) {
}
public override DecompilerSettingsBase Clone() => new ILAstDecompilerSettings(this);
public override IEnumerable<IDecompilerOption> Options {
get { yield break; }
}
public override bool Equals(object? obj) => obj is ILAstDecompilerSettings;
public override int GetHashCode() => 0;
}
}
#endif

View File

@ -0,0 +1,95 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using dnSpy.Contracts.Decompiler;
using dnSpy.Decompiler.ILSpy.Core.Properties;
using dnSpy.Decompiler.Settings;
namespace dnSpy.Decompiler.ILSpy.Core.Settings {
sealed class ILDecompilerSettings : DecompilerSettingsBase {
public ILSettings Settings => ilSettings;
readonly ILSettings ilSettings;
public override int Version => ilSettings.SettingsVersion;
public override event EventHandler? VersionChanged;
public ILDecompilerSettings(ILSettings? ilSettings = null) {
this.ilSettings = ilSettings ?? new ILSettings();
options = CreateOptions().ToArray();
this.ilSettings.SettingsVersionChanged += ILSettings_SettingsVersionChanged;
}
void ILSettings_SettingsVersionChanged(object? sender, EventArgs e) => VersionChanged?.Invoke(this, EventArgs.Empty);
public override DecompilerSettingsBase Clone() => new ILDecompilerSettings(ilSettings.Clone());
public override IEnumerable<IDecompilerOption> Options => options;
readonly IDecompilerOption[] options;
IEnumerable<IDecompilerOption> CreateOptions() {
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowILComments_GUID,
() => ilSettings.ShowILComments, a => ilSettings.ShowILComments = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowILComments,
Name = DecompilerOptionConstants.ShowILComments_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowXmlDocumentation_GUID,
() => ilSettings.ShowXmlDocumentation, a => ilSettings.ShowXmlDocumentation = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowXMLDocComments,
Name = DecompilerOptionConstants.ShowXmlDocumentation_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowTokenAndRvaComments_GUID,
() => ilSettings.ShowTokenAndRvaComments, a => ilSettings.ShowTokenAndRvaComments = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowTokensRvasOffsets,
Name = DecompilerOptionConstants.ShowTokenAndRvaComments_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowILBytes_GUID,
() => ilSettings.ShowILBytes, a => ilSettings.ShowILBytes = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowILInstrBytes,
Name = DecompilerOptionConstants.ShowILBytes_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.SortMembers_GUID,
() => ilSettings.SortMembers, a => ilSettings.SortMembers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_SortMethods,
Name = DecompilerOptionConstants.SortMembers_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.ShowPdbInfo_GUID,
() => ilSettings.ShowPdbInfo, a => ilSettings.ShowPdbInfo = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_ShowPdbInfo,
Name = DecompilerOptionConstants.ShowPdbInfo_NAME,
};
yield return new DecompilerOption<int>(DecompilerOptionConstants.MaxStringLength_GUID,
() => ilSettings.MaxStringLength, a => ilSettings.MaxStringLength = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_MaxStringLength,
Name = DecompilerOptionConstants.MaxStringLength_NAME,
};
yield return new DecompilerOption<bool>(DecompilerOptionConstants.HexadecimalNumbers_GUID,
() => ilSettings.HexadecimalNumbers, a => ilSettings.HexadecimalNumbers = a) {
Description = dnSpy_Decompiler_ILSpy_Core_Resources.DecompilerSettings_HexadecimalNumbers,
Name = DecompilerOptionConstants.HexadecimalNumbers_NAME,
};
}
public override bool Equals(object? obj) =>
obj is ILDecompilerSettings && ilSettings.Equals(((ILDecompilerSettings)obj).ilSettings);
public override int GetHashCode() => ilSettings.GetHashCode();
}
}

View File

@ -0,0 +1,175 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Threading;
using dnSpy.Contracts.MVVM;
namespace dnSpy.Decompiler.ILSpy.Core.Settings {
class ILSettings : ViewModelBase {
protected virtual void OnModified() { }
public event EventHandler? SettingsVersionChanged;
void OptionsChanged() {
Interlocked.Increment(ref settingsVersion);
OnModified();
SettingsVersionChanged?.Invoke(this, EventArgs.Empty);
}
public int SettingsVersion => settingsVersion;
volatile int settingsVersion;
public bool ShowILComments {
get => showILComments;
set {
if (showILComments != value) {
showILComments = value;
OnPropertyChanged(nameof(ShowILComments));
OptionsChanged();
}
}
}
bool showILComments = false;
public bool ShowXmlDocumentation {
get => showXmlDocumentation;
set {
if (showXmlDocumentation != value) {
showXmlDocumentation = value;
OnPropertyChanged(nameof(ShowXmlDocumentation));
OptionsChanged();
}
}
}
bool showXmlDocumentation = true;
public bool ShowTokenAndRvaComments {
get => showTokenAndRvaComments;
set {
if (showTokenAndRvaComments != value) {
showTokenAndRvaComments = value;
OnPropertyChanged(nameof(ShowTokenAndRvaComments));
OptionsChanged();
}
}
}
bool showTokenAndRvaComments = true;
public bool ShowILBytes {
get => showILBytes;
set {
if (showILBytes != value) {
showILBytes = value;
OnPropertyChanged(nameof(ShowILBytes));
OptionsChanged();
}
}
}
bool showILBytes = true;
public bool SortMembers {
get => sortMembers;
set {
if (sortMembers != value) {
sortMembers = value;
OnPropertyChanged(nameof(SortMembers));
OptionsChanged();
}
}
}
bool sortMembers = false;
public bool ShowPdbInfo {
get => showPdbInfo;
set {
if (showPdbInfo != value) {
showPdbInfo = value;
OnPropertyChanged(nameof(ShowPdbInfo));
OptionsChanged();
}
}
}
bool showPdbInfo = true;
public int MaxStringLength {
get => maxStringLength;
set {
if (maxStringLength != value) {
maxStringLength = value;
OnPropertyChanged(nameof(MaxStringLength));
OptionsChanged();
}
}
}
int maxStringLength = ICSharpCode.Decompiler.DecompilerSettings.ConstMaxStringLength;
public bool HexadecimalNumbers {
get { return hexadecimalNumbers; }
set {
if (hexadecimalNumbers != value) {
hexadecimalNumbers = value;
OnPropertyChanged(nameof(HexadecimalNumbers));
}
}
}
bool hexadecimalNumbers = false;
public ILSettings Clone() => CopyTo(new ILSettings());
public ILSettings CopyTo(ILSettings other) {
other.ShowILComments = ShowILComments;
other.ShowXmlDocumentation = ShowXmlDocumentation;
other.ShowTokenAndRvaComments = ShowTokenAndRvaComments;
other.ShowILBytes = ShowILBytes;
other.SortMembers = SortMembers;
other.ShowPdbInfo = ShowPdbInfo;
other.MaxStringLength = MaxStringLength;
other.HexadecimalNumbers = HexadecimalNumbers;
return other;
}
public override bool Equals(object? obj) {
var other = obj as ILSettings;
return other is not null &&
ShowILComments == other.ShowILComments &&
ShowXmlDocumentation == other.ShowXmlDocumentation &&
ShowTokenAndRvaComments == other.ShowTokenAndRvaComments &&
ShowILBytes == other.ShowILBytes &&
SortMembers == other.SortMembers &&
ShowPdbInfo == other.ShowPdbInfo &&
MaxStringLength == other.MaxStringLength &&
HexadecimalNumbers == other.HexadecimalNumbers;
}
public override int GetHashCode() {
uint h = 0;
if (ShowILComments) h ^= 0x80000000;
if (ShowXmlDocumentation) h ^= 0x40000000;
if (ShowTokenAndRvaComments) h ^= 0x20000000;
if (ShowILBytes) h ^= 0x10000000;
if (SortMembers) h ^= 0x08000000;
if (ShowPdbInfo) h ^= 0x04000000;
h ^= (uint)MaxStringLength;
if (HexadecimalNumbers) h ^= 0x02000000;
return (int)h;
}
}
}

View File

@ -0,0 +1,28 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
namespace dnSpy.Decompiler.ILSpy.Core.Text {
static class ContentTypesInternal {
public const string DecompilerILSpy = "Decompiler ILSpy";
public const string CSharpILSpy = "C# ILSpy";
public const string VisualBasicILSpy = "VB ILSpy";
public const string ILILSpy = "IL ILSpy";
public const string ILAstILSpy = "ILAst ILSpy";
}
}

View File

@ -0,0 +1,172 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.VB.Visitors;
namespace dnSpy.Decompiler.ILSpy.Core.VisualBasic {
sealed class ILSpyEnvironmentProvider : IEnvironmentProvider {
public string RootNamespace => "";
readonly StringBuilder sb;
public ILSpyEnvironmentProvider(StringBuilder? sb = null) => this.sb = sb ?? new StringBuilder();
public string GetTypeNameForAttribute(ICSharpCode.NRefactory.CSharp.Attribute attribute) {
var mr = attribute.Type.Annotations
.OfType<IMemberRef>()
.FirstOrDefault();
return mr is null ? string.Empty : mr.FullName;
}
/*
var annotation = type.Annotation<TypeReference>();
if (annotation is null )
return null;
IEntity current = null;
if (entity is not null) {
var typeInfo = entity.Annotation<TypeReference>();
current = loader.ReadTypeReference(typeInfo).Resolve(context).GetDefinition();
}
return loader.ReadTypeReference(annotation, entity: current).Resolve(context);*/
public ICSharpCode.NRefactory.TypeSystem.IType ResolveType(ICSharpCode.NRefactory.VB.Ast.AstType type, ICSharpCode.NRefactory.VB.Ast.TypeDeclaration? entity = null) => SpecialType.UnknownType;
public TypeKind GetTypeKindForAstType(ICSharpCode.NRefactory.CSharp.AstType type) {
var annotation = type.Annotation<ITypeDefOrRef>();
if (annotation is null)
return TypeKind.Unknown;
var definition = annotation.ResolveTypeDef();
if (definition is null)
return TypeKind.Unknown;
if (definition.IsClass)
return TypeKind.Class;
if (definition.IsInterface)
return TypeKind.Interface;
if (definition.IsEnum)
return TypeKind.Enum;
if (definition.IsValueType)
return TypeKind.Struct;
return TypeKind.Unknown;
}
public TypeCode ResolveExpression(ICSharpCode.NRefactory.CSharp.Expression expression) {
var annotation = expression.Annotations.OfType<TypeInformation>().FirstOrDefault();
if (annotation is null || annotation.InferredType is null)
return TypeCode.Object;
var definition = annotation.InferredType.GetScopeTypeDefOrRef().ResolveTypeDef();
if (definition is null)
return TypeCode.Object;
switch (definition.FullName) {
case "System.String":
return TypeCode.String;
default:
break;
}
return TypeCode.Object;
}
public bool? IsReferenceType(ICSharpCode.NRefactory.CSharp.Expression expression) {
if (expression is ICSharpCode.NRefactory.CSharp.NullReferenceExpression)
return true;
var annotation = expression.Annotations.OfType<TypeInformation>().FirstOrDefault();
if (annotation is null || annotation.InferredType is null)
return null;
var definition = annotation.InferredType.GetScopeTypeDefOrRef().ResolveTypeDef();
if (definition is null)
return null;
return !definition.IsValueType;
}
public IEnumerable<ICSharpCode.NRefactory.VB.Ast.InterfaceMemberSpecifier> CreateMemberSpecifiersForInterfaces(IEnumerable<ICSharpCode.NRefactory.VB.Ast.AstType> interfaces) {
foreach (var type in interfaces) {
var def = type.Annotation<ITypeDefOrRef>().ResolveTypeDef();
if (def is null)
continue;
foreach (var method in def.Methods.Where(m => !m.Name.StartsWith("get_") && !m.Name.StartsWith("set_"))) {
yield return ICSharpCode.NRefactory.VB.Ast.InterfaceMemberSpecifier.CreateWithColor((ICSharpCode.NRefactory.VB.Ast.AstType)type.Clone(), method.Name, VisualBasicMetadataTextColorProvider.Instance.GetColor(method));
}
foreach (var property in def.Properties) {
yield return ICSharpCode.NRefactory.VB.Ast.InterfaceMemberSpecifier.CreateWithColor((ICSharpCode.NRefactory.VB.Ast.AstType)type.Clone(), property.Name, VisualBasicMetadataTextColorProvider.Instance.GetColor(property));
}
}
}
public bool HasEvent(ICSharpCode.NRefactory.VB.Ast.Expression expression) => expression.Annotation<EventDef>() is not null;
public bool IsMethodGroup(ICSharpCode.NRefactory.CSharp.Expression expression) {
var annotation = expression.Annotation<MethodDef>();
if (annotation is null)
return false;
return expression.Annotation<PropertyDef>() is null && expression.Annotation<EventDef>() is null;
}
public ICSharpCode.NRefactory.CSharp.ParameterDeclaration[] GetParametersForProperty(ICSharpCode.NRefactory.CSharp.PropertyDeclaration property) {
var propInfo = property.Annotation<PropertyDef>();
if (propInfo is null)
return new ICSharpCode.NRefactory.CSharp.ParameterDeclaration[0];
sb.Clear();
var getMethod = propInfo.GetMethod;
if (getMethod is not null)
return getMethod.Parameters.Where(p => p.IsNormalMethodParameter).Select(p => new ICSharpCode.NRefactory.CSharp.ParameterDeclaration(AstBuilder.ConvertType(p.Type, sb), p.Name, GetModifiers(p))).ToArray();
var setMethod = propInfo.SetMethod;
if (setMethod is not null) {
var ps = setMethod.Parameters.Where(p => p.IsNormalMethodParameter).ToArray();
if (ps.Length > 1)
return ps.Take(ps.Length - 1).Select(p => new ICSharpCode.NRefactory.CSharp.ParameterDeclaration(AstBuilder.ConvertType(p.Type, sb), p.Name, GetModifiers(p))).ToArray();
}
return new ICSharpCode.NRefactory.CSharp.ParameterDeclaration[0];
}
ICSharpCode.NRefactory.CSharp.ParameterModifier GetModifiers(Parameter p) {
var pd = p.ParamDef;
if (pd is not null) {
if (pd.IsOut && pd.IsIn)
return ICSharpCode.NRefactory.CSharp.ParameterModifier.Ref;
if (pd.IsOut)
return ICSharpCode.NRefactory.CSharp.ParameterModifier.Out;
}
return ICSharpCode.NRefactory.CSharp.ParameterModifier.None;
}
}
}

View File

@ -0,0 +1,333 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.ILSpy.Core.CSharp;
using dnSpy.Decompiler.ILSpy.Core.Settings;
using dnSpy.Decompiler.ILSpy.Core.Text;
using dnSpy.Decompiler.VisualBasic;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler.Ast.Transforms;
using ICSharpCode.NRefactory.VB;
using ICSharpCode.NRefactory.VB.Visitors;
namespace dnSpy.Decompiler.ILSpy.Core.VisualBasic {
sealed class DecompilerProvider : IDecompilerProvider {
readonly DecompilerSettingsService decompilerSettingsService;
// Keep the default ctor. It's used by dnSpy.Console.exe
public DecompilerProvider()
: this(DecompilerSettingsService.__Instance_DONT_USE) {
}
public DecompilerProvider(DecompilerSettingsService decompilerSettingsService) {
Debug2.Assert(decompilerSettingsService is not null);
this.decompilerSettingsService = decompilerSettingsService ?? throw new ArgumentNullException(nameof(decompilerSettingsService));
}
public IEnumerable<IDecompiler> Create() {
yield return new VBDecompiler(decompilerSettingsService.CSharpVBDecompilerSettings);
}
}
/// <summary>
/// Decompiler logic for VB.
/// </summary>
sealed class VBDecompiler : DecompilerBase {
readonly Predicate<IAstTransform>? transformAbortCondition = null;
readonly bool showAllMembers = false;
readonly Func<BuilderCache> createBuilderCache;
public override DecompilerSettingsBase Settings => langSettings;
readonly CSharpVBDecompilerSettings langSettings;
public override double OrderUI => DecompilerConstants.VISUALBASIC_ILSPY_ORDERUI;
public override MetadataTextColorProvider MetadataTextColorProvider => VisualBasicMetadataTextColorProvider.Instance;
public VBDecompiler(CSharpVBDecompilerSettings langSettings) {
this.langSettings = langSettings;
createBuilderCache = () => new BuilderCache(this.langSettings.Settings.SettingsVersion);
}
public override string ContentTypeString => ContentTypesInternal.VisualBasicILSpy;
public override string GenericNameUI => DecompilerConstants.GENERIC_NAMEUI_VISUALBASIC;
public override string UniqueNameUI => "Visual Basic";
public override Guid GenericGuid => DecompilerConstants.LANGUAGE_VISUALBASIC;
public override Guid UniqueGuid => DecompilerConstants.LANGUAGE_VISUALBASIC_ILSPY;
public override string FileExtension => ".vb";
public override string? ProjectFileExtension => ".vbproj";
public override void WriteCommentBegin(IDecompilerOutput output, bool addSpace) {
if (addSpace)
output.Write("' ", BoxedTextColor.Comment);
else
output.Write("'", BoxedTextColor.Comment);
}
public override void WriteCommentEnd(IDecompilerOutput output, bool addSpace) { }
DecompilerSettings GetDecompilerSettings() {
var settings = langSettings.Settings.Clone();
// Different default access modifiers between C#/VB, so for now ignore the options
settings.TypeAddInternalModifier = true;
settings.MemberAddPrivateModifier = true;
return settings;
}
public override void Decompile(AssemblyDef asm, IDecompilerOutput output, DecompilationContext ctx) {
WriteAssembly(asm, output, ctx);
using (ctx.DisableAssemblyLoad()) {
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentModule: asm.ManifestModule);
try {
state.AstBuilder.AddAssembly(asm.ManifestModule, true, true, false);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
}
public override void Decompile(ModuleDef mod, IDecompilerOutput output, DecompilationContext ctx) {
WriteModule(mod, output, ctx);
using (ctx.DisableAssemblyLoad()) {
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentModule: mod);
try {
state.AstBuilder.AddAssembly(mod, true, false, true);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
}
public override void Decompile(MethodDef method, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, method);
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentType: method.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddMethod(method);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(PropertyDef property, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, property);
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentType: property.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddProperty(property);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(FieldDef field, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, field);
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentType: field.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddField(field);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(EventDef ev, IDecompilerOutput output, DecompilationContext ctx) {
WriteCommentLineDeclaringType(output, ev);
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentType: ev.DeclaringType, isSingleMember: true);
try {
state.AstBuilder.AddEvent(ev);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override void Decompile(TypeDef type, IDecompilerOutput output, DecompilationContext ctx) {
var state = CreateAstBuilder(ctx, GetDecompilerSettings(), currentType: type);
try {
state.AstBuilder.AddType(type);
RunTransformsAndGenerateCode(ref state, output, ctx);
}
finally {
state.Dispose();
}
}
public override bool ShowMember(IMemberRef member) => CSharpDecompiler.ShowMember(member, showAllMembers, GetDecompilerSettings());
VBFormattingOptions CreateVBFormattingOptions(DecompilerSettings settings) =>
new VBFormattingOptions() {
NumberFormatter = ICSharpCode.NRefactory.NumberFormatter.GetVBInstance(hex: settings.HexadecimalNumbers, upper: true),
};
void RunTransformsAndGenerateCode(ref BuilderState state, IDecompilerOutput output, DecompilationContext ctx, IAstTransform? additionalTransform = null) {
var astBuilder = state.AstBuilder;
astBuilder.RunTransformations(transformAbortCondition);
if (additionalTransform is not null) {
additionalTransform.Run(astBuilder.SyntaxTree);
}
var settings = GetDecompilerSettings();
CSharpDecompiler.AddXmlDocumentation(ref state, settings, astBuilder);
var csharpUnit = astBuilder.SyntaxTree;
csharpUnit.AcceptVisitor(new ICSharpCode.NRefactory.CSharp.InsertParenthesesVisitor() { InsertParenthesesForReadability = true });
var unit = csharpUnit.AcceptVisitor(new CSharpToVBConverterVisitor(state.AstBuilder.Context.CurrentModule, new ILSpyEnvironmentProvider(state.State.XmlDoc_StringBuilder)), null);
var outputFormatter = new VBTextOutputFormatter(output, astBuilder.Context);
var formattingPolicy = CreateVBFormattingOptions(settings);
unit.AcceptVisitor(new OutputVisitor(outputFormatter, formattingPolicy), null);
}
BuilderState CreateAstBuilder(DecompilationContext ctx, DecompilerSettings settings, ModuleDef? currentModule = null, TypeDef? currentType = null, bool isSingleMember = false) {
if (currentModule is null)
currentModule = currentType?.Module;
settings = settings.Clone();
if (isSingleMember)
settings.UsingDeclarations = false;
settings.IntroduceIncrementAndDecrement = false;
settings.MakeAssignmentExpressions = false;
settings.QueryExpressions = false;
settings.AlwaysGenerateExceptionVariableForCatchBlocksUnlessTypeIsObject = true;
var cache = ctx.GetOrCreate(createBuilderCache);
var state = new BuilderState(ctx, cache, MetadataTextColorProvider);
state.AstBuilder.Context.CurrentModule = currentModule;
state.AstBuilder.Context.CancellationToken = ctx.CancellationToken;
state.AstBuilder.Context.CurrentType = currentType;
state.AstBuilder.Context.Settings = settings;
return state;
}
protected override void FormatTypeName(IDecompilerOutput output, TypeDef type) {
if (type is null)
throw new ArgumentNullException(nameof(type));
TypeToString(output, ConvertTypeOptions.DoNotUsePrimitiveTypeNames | ConvertTypeOptions.IncludeTypeParameterDefinitions | ConvertTypeOptions.DoNotIncludeEnclosingType, type);
}
protected override void TypeToString(IDecompilerOutput output, ITypeDefOrRef? type, bool includeNamespace, IHasCustomAttribute? typeAttributes = null) {
ConvertTypeOptions options = ConvertTypeOptions.IncludeTypeParameterDefinitions;
if (includeNamespace)
options |= ConvertTypeOptions.IncludeNamespace;
TypeToString(output, options, type, typeAttributes);
}
void TypeToString(IDecompilerOutput output, ConvertTypeOptions options, ITypeDefOrRef? type, IHasCustomAttribute? typeAttributes = null) {
if (type is null)
return;
var envProvider = new ILSpyEnvironmentProvider();
var converter = new CSharpToVBConverterVisitor(type.Module, envProvider);
var astType = AstBuilder.ConvertType(type, new StringBuilder(), typeAttributes, options);
if (type.TryGetByRefSig() is not null) {
output.Write("ByRef", BoxedTextColor.Keyword);
output.Write(" ", BoxedTextColor.Text);
if (astType is ICSharpCode.NRefactory.CSharp.ComposedType && ((ICSharpCode.NRefactory.CSharp.ComposedType)astType).PointerRank > 0)
((ICSharpCode.NRefactory.CSharp.ComposedType)astType).PointerRank--;
}
var vbAstType = astType.AcceptVisitor(converter, null);
var settings = GetDecompilerSettings();
var ctx = new DecompilerContext(settings.SettingsVersion, type.Module, MetadataTextColorProvider);
vbAstType.AcceptVisitor(new OutputVisitor(new VBTextOutputFormatter(output, ctx), CreateVBFormattingOptions(settings)), null);
}
public override bool CanDecompile(DecompilationType decompilationType) {
switch (decompilationType) {
case DecompilationType.PartialType:
case DecompilationType.AssemblyInfo:
case DecompilationType.TypeMethods:
return true;
}
return base.CanDecompile(decompilationType);
}
public override void Decompile(DecompilationType decompilationType, object data) {
switch (decompilationType) {
case DecompilationType.PartialType:
DecompilePartial((DecompilePartialType)data);
return;
case DecompilationType.AssemblyInfo:
DecompileAssemblyInfo((DecompileAssemblyInfo)data);
return;
case DecompilationType.TypeMethods:
DecompileTypeMethods((DecompileTypeMethods)data);
return;
}
base.Decompile(decompilationType, data);
}
void DecompilePartial(DecompilePartialType info) {
var state = CreateAstBuilder(info.Context, CSharpDecompiler.CreateDecompilerSettings(GetDecompilerSettings(), info.UseUsingDeclarations), currentType: info.Type);
try {
state.AstBuilder.AddType(info.Type);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompilePartialTransform(info.Type, info.Definitions, info.ShowDefinitions, info.AddPartialKeyword, info.InterfacesToRemove));
}
finally {
state.Dispose();
}
}
void DecompileAssemblyInfo(DecompileAssemblyInfo info) {
var state = CreateAstBuilder(info.Context, GetDecompilerSettings(), currentModule: info.Module);
try {
state.AstBuilder.AddAssembly(info.Module, true, info.Module.IsManifestModule, true);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, info.KeepAllAttributes ? null : new AssemblyInfoTransform());
}
finally {
state.Dispose();
}
}
void DecompileTypeMethods(DecompileTypeMethods info) {
var state = CreateAstBuilder(info.Context, CSharpDecompiler.CreateDecompilerSettings_DecompileTypeMethods(GetDecompilerSettings(), !info.DecompileHidden, info.ShowAll), currentType: info.Type);
try {
state.AstBuilder.GetDecompiledBodyKind = (builder, method) => CSharpDecompiler.GetDecompiledBodyKind(info, builder, method);
state.AstBuilder.AddType(info.Type);
RunTransformsAndGenerateCode(ref state, info.Output, info.Context, new DecompileTypeMethodsTransform(info.Types, info.Methods, !info.DecompileHidden, info.ShowAll));
}
finally {
state.Dispose();
}
}
public override void WriteToolTip(ITextColorWriter output, IMemberRef member, IHasCustomAttribute? typeAttributes) =>
new VisualBasicFormatter(output, DefaultFormatterOptions, null).WriteToolTip(member);
public override void WriteToolTip(ITextColorWriter output, ISourceVariable variable) =>
new VisualBasicFormatter(output, DefaultFormatterOptions, null).WriteToolTip(variable);
public override void WriteNamespaceToolTip(ITextColorWriter output, string? @namespace) =>
new VisualBasicFormatter(output, DefaultFormatterOptions, null).WriteNamespaceToolTip(@namespace);
public override void Write(ITextColorWriter output, IMemberRef member, FormatterOptions flags) =>
new VisualBasicFormatter(output, flags, null).Write(member);
}
}

View File

@ -0,0 +1,374 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Text;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.ILAst;
using ICSharpCode.NRefactory.VB;
using ICSharpCode.NRefactory.VB.Ast;
using CSharp2 = ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.VisualBasic {
sealed class VBTextOutputFormatter : IOutputFormatter {
readonly IDecompilerOutput output;
readonly DecompilerContext context;
readonly Stack<AstNode> nodeStack = new Stack<AstNode>();
public VBTextOutputFormatter(IDecompilerOutput output, DecompilerContext context) {
this.output = output ?? throw new ArgumentNullException(nameof(output));
this.context = context ?? throw new ArgumentNullException(nameof(context));
}
MethodDebugInfoBuilder? currentMethodDebugInfoBuilder;
Stack<MethodDebugInfoBuilder?> parentMethodDebugInfoBuilder = new Stack<MethodDebugInfoBuilder?>();
List<Tuple<MethodDebugInfoBuilder, List<ILSpan>>>? multiMappings;
public void StartNode(AstNode node) {
nodeStack.Push(node);
MethodDebugInfoBuilder mapping = node.Annotation<MethodDebugInfoBuilder>();
if (mapping is not null) {
parentMethodDebugInfoBuilder.Push(currentMethodDebugInfoBuilder);
currentMethodDebugInfoBuilder = mapping;
}
// For ctor/cctor field initializers
var mms = node.Annotation<List<Tuple<MethodDebugInfoBuilder, List<ILSpan>>>>();
if (mms is not null) {
Debug2.Assert(multiMappings is null);
multiMappings = mms;
}
}
public void EndNode(AstNode node) {
if (nodeStack.Pop() != node)
throw new InvalidOperationException();
if (node.Annotation<MethodDebugInfoBuilder>() is not null) {
Debug2.Assert(currentMethodDebugInfoBuilder is not null);
if (context.CalculateILSpans) {
foreach (var ns in context.UsingNamespaces)
currentMethodDebugInfoBuilder.Scope.Imports.Add(ImportInfo.CreateNamespace(ns));
}
output.AddDebugInfo(currentMethodDebugInfoBuilder.Create());
currentMethodDebugInfoBuilder = parentMethodDebugInfoBuilder.Pop();
}
var mms = node.Annotation<List<Tuple<MethodDebugInfoBuilder, List<ILSpan>>>>();
if (mms is not null) {
Debug.Assert(mms == multiMappings);
if (mms == multiMappings) {
foreach (var mm in mms)
output.AddDebugInfo(mm.Item1.Create());
multiMappings = null;
}
}
}
public void WriteIdentifier(string identifier, object data, object extraData) {
var definition = GetCurrentDefinition();
if (definition is not null) {
output.Write(IdentifierEscaper.Escape(identifier), definition, DecompilerReferenceFlags.Definition, data);
return;
}
var memberRef = GetCurrentMemberReference() ?? (object?)(extraData as NamespaceReference);
if (memberRef is not null) {
output.Write(IdentifierEscaper.Escape(identifier), memberRef, DecompilerReferenceFlags.None, data);
return;
}
definition = GetCurrentLocalDefinition();
if (definition is not null) {
output.Write(IdentifierEscaper.Escape(identifier), definition, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, data);
return;
}
memberRef = GetCurrentLocalReference();
if (memberRef is not null) {
output.Write(IdentifierEscaper.Escape(identifier), memberRef, DecompilerReferenceFlags.Local, data);
return;
}
output.Write(IdentifierEscaper.Escape(identifier), data);
}
IMemberRef? GetCurrentMemberReference() {
AstNode node = nodeStack.Peek();
if (node.Annotation<ILVariable>() is not null)
return null;
if (node.Role == AstNode.Roles.Type && node.Parent is ObjectCreationExpression)
node = node.Parent;
var memberRef = node.Annotation<IMemberRef>();
if (memberRef is null && node is Identifier) {
node = node.Parent ?? node;
memberRef = node.Annotation<IMemberRef>();
}
if (memberRef is null && node.Role == AstNode.Roles.TargetExpression && (node.Parent is InvocationExpression || node.Parent is ObjectCreationExpression)) {
memberRef = node.Parent.Annotation<IMemberRef>();
}
return memberRef;
}
object? GetCurrentLocalReference() {
AstNode node = nodeStack.Peek();
ILVariable variable = node.Annotation<ILVariable>();
if (variable is null && node.Parent is IdentifierExpression)
variable = node.Parent.Annotation<ILVariable>();
if (variable is not null)
return variable.GetTextReferenceObject();
var lbl = (node.Parent?.Parent as GoToStatement)?.Label ?? (node.Parent?.Parent as LabelDeclarationStatement)?.Label;
if (lbl is not null) {
var method = nodeStack.Select(nd => nd.Annotation<IMethod>()).FirstOrDefault(mr => mr is not null && mr.IsMethod);
if (method is not null)
return method.ToString() + lbl;
}
return null;
}
object? GetCurrentLocalDefinition() {
AstNode node = nodeStack.Peek();
if (node is Identifier && node.Parent is CatchBlock)
node = node.Parent;
var parameterDef = node.Annotation<Parameter>();
if (parameterDef is not null)
return parameterDef;
if (node is ParameterDeclaration) {
node = ((ParameterDeclaration)node).Name;
parameterDef = node.Annotation<Parameter>();
if (parameterDef is not null)
return parameterDef;
}
if (node is VariableIdentifier) {
var variable = ((VariableIdentifier)node).Name.Annotation<ILVariable>();
if (variable is not null)
return variable.GetTextReferenceObject();
node = node.Parent ?? node;
}
if (node is VariableDeclaratorWithTypeAndInitializer || node is VariableInitializer || node is CatchBlock || node is ForEachStatement) {
var variable = node.Annotation<ILVariable>();
if (variable is not null)
return variable.GetTextReferenceObject();
}
if (node is LabelDeclarationStatement label) {
var method = nodeStack.Select(nd => nd.Annotation<IMethod>()).FirstOrDefault(mr => mr is not null && mr.IsMethod);
if (method is not null)
return method.ToString() + label.Label;
}
return null;
}
object? GetCurrentDefinition() {
if (nodeStack is null || nodeStack.Count == 0)
return null;
var node = nodeStack.Peek();
if (node is ParameterDeclaration)
return null;
if (node is VariableIdentifier)
return ((VariableIdentifier)node).Name.Annotation<IMemberDef>();
if (IsDefinition(node))
return node.Annotation<IMemberRef>();
if (node is Identifier) {
node = node.Parent;
if (IsDefinition(node))
return node.Annotation<IMemberRef>();
}
return null;
}
public void WriteKeyword(string keyword) {
var memberRef = GetCurrentMemberReference();
var node = nodeStack.Peek();
if (memberRef is not null && (node is PrimitiveType || node is InstanceExpression))
output.Write(keyword, memberRef, DecompilerReferenceFlags.None, BoxedTextColor.Keyword);
else if (memberRef is not null && (node is ConstructorDeclaration && keyword == "New"))
output.Write(keyword, memberRef, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Keyword);
else if (memberRef is not null && (node is Accessor && (keyword == "Get" || keyword == "Set" || keyword == "AddHandler" || keyword == "RemoveHandler" || keyword == "RaiseEvent"))) {
if (canPrintAccessor)
output.Write(keyword, memberRef, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Definition, BoxedTextColor.Keyword);
else
output.Write(keyword, BoxedTextColor.Keyword);
canPrintAccessor = !canPrintAccessor;
}
else if (memberRef is not null && node is OperatorDeclaration && keyword == "Operator")
output.Write(keyword, memberRef, DecompilerReferenceFlags.Definition, BoxedTextColor.Keyword);
else
output.Write(keyword, BoxedTextColor.Keyword);
}
bool canPrintAccessor = true;
public void WriteToken(string token, object data, object? reference) {
var memberRef = GetCurrentMemberReference();
var node = nodeStack.Peek();
bool addRef = memberRef is not null &&
(node is BinaryOperatorExpression ||
node is UnaryOperatorExpression ||
node is AssignmentExpression);
// Add a ref to the method if it's a delegate call
if (!addRef && node is InvocationExpression && memberRef is IMethod) {
var md = Resolve(memberRef as IMethod);
if (md is not null && md.DeclaringType is not null && md.DeclaringType.IsDelegate)
addRef = true;
}
if (addRef)
output.Write(token, memberRef, DecompilerReferenceFlags.None, data);
else if (reference is not null)
output.Write(token, reference, DecompilerReferenceFlags.Local | DecompilerReferenceFlags.Hidden | DecompilerReferenceFlags.NoFollow, data);
else
output.Write(token, data);
}
static MethodDef? Resolve(IMethod? method) {
if (method is MethodSpec)
method = ((MethodSpec)method).Method;
if (method is MemberRef)
return ((MemberRef)method).ResolveMethod();
else
return (MethodDef?)method;
}
public void Space() => output.Write(" ", BoxedTextColor.Text);
public void Indent() => output.IncreaseIndent();
public void Unindent() => output.DecreaseIndent();
public void NewLine() => output.WriteLine();
public void WriteComment(bool isDocumentation, string content, CSharp2.CommentReference[] refs) {
if (isDocumentation) {
Debug2.Assert(refs is null);
output.Write("'''", BoxedTextColor.XmlDocCommentDelimiter);
output.WriteXmlDoc(content);
output.WriteLine();
}
else {
output.Write("'", BoxedTextColor.Comment);
Write(content, refs);
output.WriteLine();
}
}
void Write(string content, CSharp2.CommentReference[] refs)
{
if (refs is null) {
output.Write(content, BoxedTextColor.Comment);
return;
}
int offs = 0;
for (int i = 0; i < refs.Length; i++) {
var @ref = refs[i];
var s = content.Substring(offs, @ref.Length);
offs += @ref.Length;
if (@ref.Reference is null)
output.Write(s, BoxedTextColor.Comment);
else
output.Write(s, @ref.Reference, @ref.IsLocal ? DecompilerReferenceFlags.Local : DecompilerReferenceFlags.None, BoxedTextColor.Comment);
}
Debug.Assert(offs == content.Length);
}
static bool IsDefinition(AstNode node) =>
node is FieldDeclaration ||
node is ConstructorDeclaration ||
node is EventDeclaration ||
node is DelegateDeclaration ||
node is OperatorDeclaration ||
node is MemberDeclaration ||
node is TypeDeclaration ||
node is EnumDeclaration ||
node is EnumMemberDeclaration ||
node is TypeParameterDeclaration;
class DebugState {
public List<AstNode> Nodes = new List<AstNode>();
public List<ILSpan> ExtraILSpans = new List<ILSpan>();
public int StartLocation;
}
readonly Stack<DebugState> debugStack = new Stack<DebugState>();
public void DebugStart(AstNode node) => debugStack.Push(new DebugState { StartLocation = output.NextPosition });
public void DebugHidden(object hiddenILSpans) {
if (hiddenILSpans is IList<ILSpan> list) {
if (debugStack.Count > 0)
debugStack.Peek().ExtraILSpans.AddRange(list);
}
}
public void DebugExpression(AstNode node) {
if (debugStack.Count > 0)
debugStack.Peek().Nodes.Add(node);
}
public void DebugEnd(AstNode node) {
var state = debugStack.Pop();
if (currentMethodDebugInfoBuilder is not null) {
foreach (var ilSpan in ILSpan.OrderAndCompact(GetILSpans(state)))
currentMethodDebugInfoBuilder.Add(new SourceStatement(ilSpan, new TextSpan(state.StartLocation, output.NextPosition - state.StartLocation)));
}
else if (multiMappings is not null) {
foreach (var mm in multiMappings) {
foreach (var ilSpan in ILSpan.OrderAndCompact(mm.Item2))
mm.Item1.Add(new SourceStatement(ilSpan, new TextSpan(state.StartLocation, output.NextPosition - state.StartLocation)));
}
}
}
static IEnumerable<ILSpan> GetILSpans(DebugState state) {
foreach (var node in state.Nodes) {
foreach (var ann in node.Annotations) {
var list = ann as IList<ILSpan>;
if (list is null)
continue;
foreach (var ilSpan in list)
yield return ilSpan;
}
}
foreach (var ilSpan in state.ExtraILSpans)
yield return ilSpan;
}
public void AddHighlightedKeywordReference(object reference, int start, int end) {
Debug2.Assert(reference is not null);
if (reference is not null)
output.AddSpanReference(reference, start, end, PredefinedSpanReferenceIds.HighlightRelatedKeywords);
}
public int NextPosition => output.NextPosition;
public void AddBracePair(int leftStart, int leftEnd, int rightStart, int rightEnd, CodeBracesRangeFlags flags) =>
output.AddBracePair(TextSpan.FromBounds(leftStart, leftEnd), TextSpan.FromBounds(rightStart, rightEnd), flags);
public void AddBlock(int start, int end, CodeBracesRangeFlags flags) =>
output.AddBracePair(new TextSpan(start, 0), new TextSpan(end, 0), flags);
public void AddLineSeparator(int position) => output.AddLineSeparator(position);
}
}

View File

@ -0,0 +1,64 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler.XmlDoc;
using ICSharpCode.NRefactory.CSharp;
namespace dnSpy.Decompiler.ILSpy.Core.XmlDoc {
/// <summary>
/// Adds XML documentation for member definitions.
/// </summary>
struct AddXmlDocTransform {
readonly StringBuilder stringBuilder;
public AddXmlDocTransform(StringBuilder sb) => stringBuilder = sb;
public void Run(AstNode node) {
if (node is EntityDeclaration) {
IMemberRef mr = node.Annotation<IMemberRef>();
if (mr is not null && mr.Module is not null) {
var xmldoc = XmlDocLoader.LoadDocumentation(mr.Module);
if (xmldoc is not null) {
var doc = xmldoc.GetDocumentation(XmlDocKeyProvider.GetKey(mr, stringBuilder));
if (!string2.IsNullOrEmpty(doc)) {
InsertXmlDocumentation(node, doc);
}
}
}
if (!(node is TypeDeclaration))
return; // don't recurse into attributed nodes, except for type definitions
}
foreach (AstNode child in node.Children)
Run(child);
}
void InsertXmlDocumentation(AstNode node, string doc) {
foreach (var info in new XmlDocLine(doc)) {
stringBuilder.Clear();
if (info is not null) {
stringBuilder.Append(' ');
info.Value.WriteTo(stringBuilder);
}
node.Parent.InsertChildBefore(node, new Comment(stringBuilder.ToString(), CommentType.Documentation), Roles.Comment);
}
}
}
}

View File

@ -0,0 +1,91 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace dnSpy.Decompiler.ILSpy.Core.XmlDoc {
struct SubStringInfo {
public readonly int Index;
public readonly int Length;
public SubStringInfo(int index, int length) {
Index = index;
Length = length;
}
}
struct StringLineIterator : IEnumerable<SubStringInfo>, IEnumerator<SubStringInfo> {
readonly string s;
int index;
readonly int end;
SubStringInfo info;
bool finished;
public StringLineIterator(string s, int index, int length) {
this.s = s;
this.index = index;
end = index + length;
info = default;
finished = false;
}
public StringLineIterator GetEnumerator() => this;
IEnumerator<SubStringInfo> IEnumerable<SubStringInfo>.GetEnumerator() {
Debug.Fail("'this' was boxed");
return GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
Debug.Fail("'this' was boxed");
return GetEnumerator();
}
public SubStringInfo Current => info;
object IEnumerator.Current {
get { Debug.Fail("'this' was boxed"); return info; }
}
public void Dispose() { }
public bool MoveNext() {
int newLineIndex = s.IndexOfAny(newLineChars, index, end - index);
if (newLineIndex < 0) {
if (finished)
return false;
info = new SubStringInfo(index, end - index);
finished = true;
return true;
}
int len = newLineIndex - index;
info = new SubStringInfo(index, len);
if (s[newLineIndex] == '\r' && newLineIndex + 1 < s.Length && s[newLineIndex + 1] == '\n')
newLineIndex++;
index = newLineIndex + 1;
return true;
}
static readonly char[] newLineChars = new char[] { '\r', '\n', '\u0085', '\u2028', '\u2029' };
public void Reset() => throw new NotImplementedException();
}
}

View File

@ -0,0 +1,37 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Text;
namespace dnSpy.Decompiler.ILSpy.Core.XmlDoc {
struct SubString {
public readonly string String;
public readonly int Index;
public readonly int Length;
public SubString(string s, int index, int length) {
String = s;
Index = index;
Length = length;
}
public override string ToString() => String.Substring(Index, Length);
public void WriteTo(StringBuilder sb) => sb.Append(String, Index, Length);
}
}

View File

@ -0,0 +1,153 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace dnSpy.Decompiler.ILSpy.Core.XmlDoc {
struct XmlDocLine : IEnumerable<SubString?>, IEnumerator<SubString?> {
readonly string s;
readonly int end;
SubString? current;
SubStringInfo? indent;
StringLineIterator iter;
int emptyLines;
public XmlDocLine(string s)
: this(s, 0, s.Length) {
}
public XmlDocLine(string s, int start, int length) {
this.s = s;
end = start + length;
current = null;
indent = null;
iter = new StringLineIterator(s, start, end - start);
emptyLines = 0;
}
public XmlDocLine GetEnumerator() => this;
IEnumerator<SubString?> IEnumerable<SubString?>.GetEnumerator() {
Debug.Fail("'this' was boxed");
return GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
Debug.Fail("'this' was boxed");
return GetEnumerator();
}
public SubString? Current => current;
object? IEnumerator.Current {
get { Debug.Fail("'this' was boxed"); return current; }
}
public void Dispose() { }
public bool MoveNext() {
if (indent is null) {
for (;;) {
if (!iter.MoveNext())
return false;
if (!IsWhiteSpace(s, iter.Current))
break;
}
indent = GetIndentation(s, iter.Current);
goto start2;
}
if (emptyLines != 0)
goto start2;
start:
if (!iter.MoveNext())
return false;
start2:
if (IsWhiteSpace(s, iter.Current)) {
emptyLines++;
goto start;
}
if (emptyLines != 0) {
if (emptyLines != -1) {
emptyLines--;
if (emptyLines == 0)
emptyLines = -1;
current = null;
return true;
}
emptyLines = 0;
}
Trim(out int index, out int end);
current = new SubString(s, index, end - index);
return true;
}
void Trim(out int trimmedIndex, out int trimmedEnd) {
Debug2.Assert(indent is not null);
int index = iter.Current.Index;
int end = index + iter.Current.Length;
if (indent.Value.Length > iter.Current.Length) {
trimmedIndex = index;
trimmedEnd = end;
return;
}
int end2 = index + indent.Value.Length;
for (int i = index, j = indent.Value.Index; i < end2; i++, j++) {
if (s[i] != s[j]) {
trimmedIndex = index;
trimmedEnd = end;
return;
}
}
trimmedIndex = index + indent.Value.Length;
trimmedEnd = end;
Debug.Assert(trimmedIndex <= trimmedEnd);
}
SubStringInfo GetIndentation(string doc, SubStringInfo info) {
int end = info.Index + info.Length;
int i = info.Index;
for (; i < end; i++) {
if (!char.IsWhiteSpace(doc[i]))
break;
}
return new SubStringInfo(info.Index, i - info.Index);
}
bool IsWhiteSpace(string doc, SubStringInfo info) {
int end = info.Index + info.Length;
for (int i = info.Index; i < end; i++) {
if (!char.IsWhiteSpace(doc[i]))
return false;
}
return true;
}
public void Reset() => throw new NotImplementedException();
}
}

View File

@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\DnSpyCommon.props" />
<PropertyGroup>
<Copyright>Copyright 2011-2014 AlphaSierraPapa for the SharpDevelop Team</Copyright>
<Version>$(DnSpyAssemblyVersion)</Version>
<InformationalVersion>$(DnSpyAssemblyInformationalVersion)</InformationalVersion>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\..\dnSpy.snk</AssemblyOriginatorKeyFile>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\dnSpy.Decompiler.ILSpy.Core.Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>dnSpy.Decompiler.ILSpy.Core.Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\dnSpy.Decompiler.ILSpy.Core.Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>dnSpy.Decompiler.ILSpy.Core.Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Contracts.Logic\dnSpy.Contracts.Logic.csproj" />
<ProjectReference Include="..\..\..\dnSpy\dnSpy.Decompiler\dnSpy.Decompiler.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\NRefactory.VB\ICSharpCode.NRefactory.VB\ICSharpCode.NRefactory.VB.csproj" />
<ProjectReference Include="..\NRefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj" />
<ProjectReference Include="..\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,36 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.ComponentModel.Composition;
using dnSpy.Contracts.Decompiler;
using dnSpy.Decompiler.ILSpy.Core.CSharp;
using dnSpy.Decompiler.ILSpy.Core.Settings;
namespace dnSpy.Decompiler.ILSpy.CSharp {
[Export(typeof(IDecompilerCreator))]
sealed class MyDecompilerCreator : IDecompilerCreator {
readonly DecompilerSettingsService decompilerSettingsService;
[ImportingConstructor]
MyDecompilerCreator(DecompilerSettingsService decompilerSettingsService) => this.decompilerSettingsService = decompilerSettingsService;
public IEnumerable<IDecompiler> Create() => new DecompilerProvider(decompilerSettingsService).Create();
}
}

View File

@ -0,0 +1,57 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.ComponentModel.Composition;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.ILSpy.Core.Text;
using Microsoft.VisualStudio.Utilities;
namespace dnSpy.Decompiler.ILSpy {
static class ContentTypeDefinitions {
#pragma warning disable CS0169
[Export]
[Name(ContentTypesInternal.DecompilerILSpy)]
[BaseDefinition(ContentTypes.DecompiledCode)]
static readonly ContentTypeDefinition? DecompilerILSpyContentTypeDefinition;
[Export]
[Name(ContentTypesInternal.CSharpILSpy)]
[BaseDefinition(ContentTypesInternal.DecompilerILSpy)]
[BaseDefinition(ContentTypes.CSharp)]
static readonly ContentTypeDefinition? CSharpILSpyContentTypeDefinition;
[Export]
[Name(ContentTypesInternal.VisualBasicILSpy)]
[BaseDefinition(ContentTypesInternal.DecompilerILSpy)]
[BaseDefinition(ContentTypes.VisualBasic)]
static readonly ContentTypeDefinition? VisualBasicILSpyContentTypeDefinition;
[Export]
[Name(ContentTypesInternal.ILILSpy)]
[BaseDefinition(ContentTypesInternal.DecompilerILSpy)]
[BaseDefinition(ContentTypes.IL)]
static readonly ContentTypeDefinition? ILILSpyContentTypeDefinition;
[Export]
[Name(ContentTypesInternal.ILAstILSpy)]
[BaseDefinition(ContentTypesInternal.DecompilerILSpy)]
static readonly ContentTypeDefinition? ILAstILSpyContentTypeDefinition;
#pragma warning restore CS0169
}
}

View File

@ -0,0 +1,36 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.ComponentModel.Composition;
using dnSpy.Contracts.Decompiler;
using dnSpy.Decompiler.ILSpy.Core.IL;
using dnSpy.Decompiler.ILSpy.Core.Settings;
namespace dnSpy.Decompiler.ILSpy.IL {
[Export(typeof(IDecompilerCreator))]
sealed class MyDecompilerCreator : IDecompilerCreator {
readonly DecompilerSettingsService decompilerSettingsService;
[ImportingConstructor]
MyDecompilerCreator(DecompilerSettingsService decompilerSettingsService) => this.decompilerSettingsService = decompilerSettingsService;
public IEnumerable<IDecompiler> Create() => new DecompilerProvider(decompilerSettingsService).Create();
}
}

View File

@ -0,0 +1,36 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.ComponentModel.Composition;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Text;
using dnSpy.Decompiler.ILSpy.Core.IL;
using ICSharpCode.Decompiler.Disassembler;
namespace dnSpy.Decompiler.ILSpy.IL {
[Export(typeof(ISimpleILPrinter))]
sealed class SimpleILPrinter : ISimpleILPrinter {
double ISimpleILPrinter.Order => -100;
bool ISimpleILPrinter.Write(IDecompilerOutput output, IMemberRef? member) => ILDecompilerUtils.Write(output, member);
void ISimpleILPrinter.Write(IDecompilerOutput output, MethodSig? sig) => output.Write(sig);
void ISimpleILPrinter.Write(IDecompilerOutput output, TypeSig? type) => type.WriteTo(output);
}
}

View File

@ -0,0 +1,36 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.ComponentModel.Composition;
using dnSpy.Contracts.Decompiler;
using dnSpy.Decompiler.ILSpy.Core.ILAst;
using dnSpy.Decompiler.ILSpy.Core.Settings;
namespace dnSpy.Decompiler.ILSpy.ILAst {
[Export(typeof(IDecompilerCreator))]
sealed class MyDecompilerCreator : IDecompilerCreator {
readonly DecompilerSettingsService decompilerSettingsService;
[ImportingConstructor]
MyDecompilerCreator(DecompilerSettingsService decompilerSettingsService) => this.decompilerSettingsService = decompilerSettingsService;
public IEnumerable<IDecompiler> Create() => new DecompilerProvider(decompilerSettingsService).Create();
}
}

View File

@ -0,0 +1,117 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace dnSpy.Decompiler.ILSpy.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class dnSpy_Decompiler_ILSpy_Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal dnSpy_Decompiler_ILSpy_Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("dnSpy.Decompiler.ILSpy.Properties.dnSpy.Decompiler.ILSpy.Resources", typeof(dnSpy_Decompiler_ILSpy_Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Events.
/// </summary>
public static string DecompilationOrder_Events {
get {
return ResourceManager.GetString("DecompilationOrder_Events", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fields.
/// </summary>
public static string DecompilationOrder_Fields {
get {
return ResourceManager.GetString("DecompilationOrder_Fields", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Methods.
/// </summary>
public static string DecompilationOrder_Methods {
get {
return ResourceManager.GetString("DecompilationOrder_Methods", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Nested Types.
/// </summary>
public static string DecompilationOrder_NestedTypes {
get {
return ResourceManager.GetString("DecompilationOrder_NestedTypes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Properties.
/// </summary>
public static string DecompilationOrder_Properties {
get {
return ResourceManager.GetString("DecompilationOrder_Properties", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ILSpy decompiler.
/// </summary>
public static string Plugin_ShortDescription {
get {
return ResourceManager.GetString("Plugin_ShortDescription", resourceCulture);
}
}
}
}

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Události</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Pole</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Metody</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Vnořené typy</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Vlastnosti</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy dekompilátor</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Ereignisse</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Felder</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Methoden</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Geschachtelte Typen</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Eigenschaften</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy-Dekompilierer</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Eventos</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Campos</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Métodos</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Tipos Anidados</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Propiedades</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>Decompilador ILSpy</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>رویدادها</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Fieldها</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Methodها</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Nested Types</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Propertieها</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy دیکامپایلر</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Events</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Champs</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Méthodes</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Types imbriqués</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Propriétés</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>Décompilateur ILSpy</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Események</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Mezők</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Metódusok</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Beágyazott típusok</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Tulajdonságok</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy decompiler</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Eventi</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Campi</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Metodi</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Tipi nidificati</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Proprietá</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy decompilatore</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Eventos</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Campos</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Métodos</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Tipos Aninhados</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Propriedades</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>Descompilador ILSpy</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Eventos</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Campos</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Métodos</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Tipos aninhados</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Propriedades</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>Descompilador ILSpy</value>
</data>
</root>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DecompilationOrder_Events" xml:space="preserve">
<value>Events</value>
</data>
<data name="DecompilationOrder_Fields" xml:space="preserve">
<value>Fields</value>
</data>
<data name="DecompilationOrder_Methods" xml:space="preserve">
<value>Methods</value>
</data>
<data name="DecompilationOrder_NestedTypes" xml:space="preserve">
<value>Nested Types</value>
</data>
<data name="DecompilationOrder_Properties" xml:space="preserve">
<value>Properties</value>
</data>
<data name="Plugin_ShortDescription" xml:space="preserve">
<value>ILSpy decompiler</value>
</data>
</root>

Some files were not shown because too many files have changed in this diff Show More