GeezerVison is showing github.com — Revert efdf372 because of #100. · ReClassNET/ReClass.NET@d9675f7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: ReClass.NET/Memory/MemoryBuffer.cs +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -144,7 +144,7 @@ public void ReadBytes(int offset, byte[] buffer) |
144 | 144 | Array.Copy(data, offset, buffer, 0, buffer.Length); |
145 | 145 | } |
146 | 146 |
|
147 | | - public T ReadObject<T>(int offset) where T : unmanaged |
| 147 | + public T ReadObject<T>(int offset) where T : struct |
148 | 148 | { |
149 | 149 | Contract.Requires(offset >= 0); |
150 | 150 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: ReClass.NET/Memory/RemoteProcess.cs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -206,7 +206,7 @@ public byte[] ReadRemoteMemory(IntPtr address, int size) |
206 | 206 | /// <typeparam name="T">Type of the value to read.</typeparam> |
207 | 207 | /// <param name="address">The address to read from.</param> |
208 | 208 | /// <returns>The remote object.</returns> |
209 | | - public T ReadRemoteObject<T>(IntPtr address) where T : unmanaged |
| 209 | + public T ReadRemoteObject<T>(IntPtr address) where T : struct |
210 | 210 | { |
211 | 211 | var data = ReadRemoteMemory(address, Marshal.SizeOf<T>()); |
212 | 212 |
|
@@ -569,7 +569,7 @@ public bool WriteRemoteMemory(IntPtr address, byte[] data) |
569 | 569 | /// <param name="address">The address to write to.</param> |
570 | 570 | /// <param name="value">The value to write.</param> |
571 | 571 | /// <returns>True if it succeeds, false if it fails.</returns> |
572 | | - public bool WriteRemoteMemory<T>(IntPtr address, T value) where T : unmanaged |
| 572 | + public bool WriteRemoteMemory<T>(IntPtr address, T value) where T : struct |
573 | 573 | { |
574 | 574 | var data = new byte[Marshal.SizeOf<T>()]; |
575 | 575 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: ReClass.NET/ReClass.NET.csproj -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
70 | 70 | <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel> |
71 | 71 | <CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly> |
72 | 72 | <CodeContractsAnalysisWarningLevel>3</CodeContractsAnalysisWarningLevel> |
73 | | - <LangVersion>latest</LangVersion> |
74 | 73 | </PropertyGroup> |
75 | 74 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> |
76 | 75 | <PlatformTarget>x86</PlatformTarget> |
|
Collapse file
Copy file name to clipboardExpand all lines: ReClass.NET/UI/EnumComboBox.cs +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -using System; |
2 | | -using System.Collections.Generic; |
| 1 | +using System.Collections.Generic; |
3 | 2 | using System.ComponentModel; |
4 | 3 | using System.Diagnostics.Contracts; |
5 | 4 | using System.Linq; |
6 | 5 | using System.Windows.Forms; |
7 | 6 | using ReClassNET.Extensions; |
| 7 | +using ReClassNET.Util; |
8 | 8 |
|
9 | 9 | namespace ReClassNET.UI |
10 | 10 | { |
11 | | - public class EnumComboBox<TEnum> : ComboBox where TEnum : Enum |
| 11 | + public class EnumComboBox<TEnum> : ComboBox where TEnum : struct |
12 | 12 | { |
13 | 13 | #region Properties |
14 | 14 |
|
@@ -52,7 +52,7 @@ public class EnumComboBox<TEnum> : ComboBox where TEnum : Enum |
52 | 52 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] |
53 | 53 | public new TEnum SelectedValue |
54 | 54 | { |
55 | | - get => ((EnumDescriptionDisplay<TEnum>)base.SelectedItem).Value; |
| 55 | + get => ((EnumDescriptionDisplay<TEnum>)base.SelectedItem)?.Value ?? default(TEnum); |
56 | 56 | set => base.SelectedItem = base.Items.Cast<EnumDescriptionDisplay<TEnum>>().PredicateOrFirst(e => e.Value.Equals(value)); |
57 | 57 | } |
58 | 58 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: ReClass.NET/UI/EnumDescriptionDisplay.cs +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
5 | 5 | using System.Linq; |
6 | 6 | using System.Reflection; |
7 | 7 | using ReClassNET.Extensions; |
| 8 | +using ReClassNET.Util; |
8 | 9 |
|
9 | 10 | namespace ReClassNET.UI |
10 | 11 | { |
11 | | - public class EnumDescriptionDisplay<TEnum> where TEnum : Enum |
| 12 | + public class EnumDescriptionDisplay<TEnum> where TEnum : struct |
12 | 13 | { |
13 | 14 | public TEnum Value { get; internal set; } |
14 | 15 | public string Description { get; internal set; } |
|