-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extra debugging and possible workaround for lost grids
- Loading branch information
Showing
6 changed files
with
230 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace Meds.Wrapper.Shim | ||
{ | ||
public static class PatchExtensions | ||
{ | ||
public static bool TryFindArg(this MethodBase method, Type type, out int index) | ||
{ | ||
if (type.IsAssignableFrom(method.DeclaringType)) | ||
{ | ||
index = 0; | ||
return true; | ||
} | ||
|
||
var args = method.GetParameters(); | ||
for (var i = 0; i < args.Length; i++) | ||
{ | ||
if (type.IsAssignableFrom(args[i].ParameterType)) | ||
{ | ||
index = i + (method.IsStatic ? 0 : 1); | ||
return true; | ||
} | ||
} | ||
|
||
index = default; | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters