Skip to content

Commit 63f743e

Browse files
committed
Sync with current ReClass.NET project.
1 parent d9973eb commit 63f743e

7 files changed

+34
-41
lines changed

DotNetInspectorPlugin.csproj

+10-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>TRACE;DEBUG;WIN32</DefineConstants>
21+
<DefineConstants>TRACE;DEBUG;RECLASSNET32</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -28,7 +28,7 @@
2828
<DebugType>pdbonly</DebugType>
2929
<Optimize>true</Optimize>
3030
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE;WIN32;RELEASE</DefineConstants>
31+
<DefineConstants>TRACE;RECLASSNET32;RELEASE</DefineConstants>
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
@@ -38,7 +38,7 @@
3838
<DebugType>full</DebugType>
3939
<Optimize>false</Optimize>
4040
<OutputPath>bin\Debug\x64\</OutputPath>
41-
<DefineConstants>TRACE;DEBUG;WIN64</DefineConstants>
41+
<DefineConstants>TRACE;DEBUG;RECLASSNET64</DefineConstants>
4242
<ErrorReport>prompt</ErrorReport>
4343
<WarningLevel>4</WarningLevel>
4444
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -48,7 +48,7 @@
4848
<DebugType>pdbonly</DebugType>
4949
<Optimize>true</Optimize>
5050
<OutputPath>bin\Release\x64\</OutputPath>
51-
<DefineConstants>TRACE;WIN64;RELEASE</DefineConstants>
51+
<DefineConstants>TRACE;RECLASSNET64;RELEASE</DefineConstants>
5252
<ErrorReport>prompt</ErrorReport>
5353
<WarningLevel>4</WarningLevel>
5454
</PropertyGroup>
@@ -154,12 +154,6 @@
154154
</Compile>
155155
<Compile Include="ReClassNetDataReader.cs" />
156156
</ItemGroup>
157-
<ItemGroup>
158-
<ProjectReference Include="..\ReClass.NET\ReClass.NET.csproj">
159-
<Project>{BFB8917D-E9B4-463F-A6E8-612C35728C78}</Project>
160-
<Name>ReClass.NET</Name>
161-
</ProjectReference>
162-
</ItemGroup>
163157
<ItemGroup>
164158
<EmbeddedResource Include="InspectorForm.resx">
165159
<DependentUpon>InspectorForm.cs</DependentUpon>
@@ -172,7 +166,12 @@
172166
<ItemGroup>
173167
<None Include="Resources\logo.png" />
174168
</ItemGroup>
175-
<ItemGroup />
169+
<ItemGroup>
170+
<ProjectReference Include="..\ReClass.NET\ReClass.NET\ReClass.NET.csproj">
171+
<Project>{bfb8917d-e9b4-463f-a6e8-612c35728c78}</Project>
172+
<Name>ReClass.NET</Name>
173+
</ProjectReference>
174+
</ItemGroup>
176175
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
177176
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
178177
Other similar extension points exist, see Microsoft.Common.targets.

DotNetInspectorPlugin.sln

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2002
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetInspectorPlugin", "DotNetInspectorPlugin.csproj", "{CA79BA0B-0D80-476A-B793-FC7EF6DCEAD7}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "..\ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "..\ReClass.NET\ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -41,4 +41,7 @@ Global
4141
GlobalSection(SolutionProperties) = preSolution
4242
HideSolutionNode = FALSE
4343
EndGlobalSection
44+
GlobalSection(ExtensibilityGlobals) = postSolution
45+
SolutionGuid = {780C26C0-D5C9-4EB7-BEA5-95AC51577CE0}
46+
EndGlobalSection
4447
EndGlobal

DotNetInspectorPluginExt.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ public override bool Initialize(IPluginHost pluginHost)
2323
Terminate();
2424
}
2525

26-
if (pluginHost == null)
27-
{
28-
throw new ArgumentNullException(nameof(pluginHost));
29-
}
30-
31-
host = pluginHost;
26+
host = pluginHost ?? throw new ArgumentNullException(nameof(pluginHost));
3227

3328
var menuItem = host.MainWindow.MainMenu.Items.OfType<ToolStripMenuItem>().FirstOrDefault(i => i.Text == "Process");
3429
if (menuItem != null)

DotNetObject.cs

+8-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace DotNetInspectorPlugin
99
{
1010
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
11-
class DotNetObject : IComparable<DotNetObject>
11+
internal class DotNetObject : IComparable<DotNetObject>
1212
{
1313
public string DebuggerDisplay => $"{Type.Name} {Name}";
1414

@@ -78,7 +78,7 @@ private string GetRootName()
7878
{
7979
if (Parent == null)
8080
{
81-
return Name == null ? string.Empty : Name;
81+
return Name ?? string.Empty;
8282
}
8383

8484
return Parent.GetRootName();
@@ -111,22 +111,21 @@ public string GetFormattedValue(bool hex)
111111
{
112112
return (bool)value ? bool.TrueString : bool.FalseString;
113113
}
114-
else if (Type.ElementType == ClrElementType.Char)
114+
if (Type.ElementType == ClrElementType.Char)
115115
{
116116
return $"'{value}'";
117117
}
118-
else if (Type.ElementType == ClrElementType.String)
118+
if (Type.ElementType == ClrElementType.String)
119119
{
120120
if (value == null)
121121
{
122122
return NullString;
123123
}
124124
return $"\"{value}\"";
125125
}
126-
else if (IsFloatingPointValueType || IsIntegerValueType)
126+
if (IsFloatingPointValueType || IsIntegerValueType)
127127
{
128-
var formattable = value as IFormattable;
129-
if (formattable != null)
128+
if (value is IFormattable formattable)
130129
{
131130
string format = null;
132131
if (IsIntegerValueType && hex)
@@ -137,7 +136,7 @@ public string GetFormattedValue(bool hex)
137136
}
138137
return value.ToString();
139138
}
140-
else if (Type.ElementType == ClrElementType.FunctionPointer)
139+
if (Type.ElementType == ClrElementType.FunctionPointer)
141140
{
142141
return $"0x{value:X}";
143142
}
@@ -153,7 +152,7 @@ public void SetValue(object value)
153152

154153
public int CompareTo(DotNetObject other)
155154
{
156-
return Name.CompareTo(other?.Name);
155+
return string.Compare(Name, other?.Name, StringComparison.Ordinal);
157156
}
158157
}
159158
}

DotNetObjectCollector.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
namespace DotNetInspectorPlugin
88
{
9-
class DotNetObjectCollector
9+
internal class DotNetObjectCollector
1010
{
11-
private ClrHeap heap;
11+
private readonly ClrHeap heap;
1212

1313
public DotNetObjectCollector(ClrHeap heap)
1414
{
@@ -25,7 +25,7 @@ public IEnumerable<DotNetObject> EnumerateObjects()
2525
foreach (var root in heap.EnumerateRoots())
2626
{
2727
heap.EnumerateObjectAddresses();
28-
if (root == null || root.Type == null || root.Name == null)
28+
if (root?.Type == null || root.Name == null)
2929
{
3030
continue;
3131
}
@@ -116,9 +116,9 @@ private void RecursiveEnumerateObjects(HashSet<ulong> visited, DotNetObject pare
116116
}
117117
}
118118

119-
public class ClrGlobals
119+
internal class ClrGlobals
120120
{
121-
public static readonly string[] ExcludeRootNamespaces = new string[]
121+
public static readonly string[] ExcludeRootNamespaces =
122122
{
123123
"System.",
124124
"Microsoft.",
@@ -128,7 +128,7 @@ public class ClrGlobals
128128
"Newtonsoft.",
129129
};
130130

131-
public static readonly string[] ExcludeNames = new string[]
131+
public static readonly string[] ExcludeNames =
132132
{
133133
"finalization handle",
134134
"strong handle",
@@ -137,7 +137,7 @@ public class ClrGlobals
137137
"local var"
138138
};
139139

140-
public static readonly string[] ExcludePrefix = new string[]
140+
public static readonly string[] ExcludePrefix =
141141
{
142142
"static var "
143143
};

InspectorForm.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ public InspectorForm(RemoteProcess process)
3131
e.Cancel = ((DotNetObject)e.RowObject).IsValueType == false;
3232
};
3333

34-
olvColumnValue.AspectGetter = obj =>
35-
{
36-
return ((DotNetObject)obj).GetFormattedValue(false);
37-
};
34+
olvColumnValue.AspectGetter = obj => ((DotNetObject)obj).GetFormattedValue(false);
3835

3936
olvColumnValue.AspectPutter = (obj, value) =>
4037
{

ReClassNetDataReader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace DotNetInspectorPlugin
1010
{
11-
class ReClassNetDataReader : IDataReader
11+
internal class ReClassNetDataReader : IDataReader
1212
{
1313
private readonly RemoteProcess process;
1414

0 commit comments

Comments
 (0)