We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ref: tonerdo/pose#57
Note that this would be incompatible with the changes in #13. Or at the very least it would introduce an alternate API.
The text was updated successfully, but these errors were encountered:
This would indeed be possible by adding the following code to Shim.
Shim
public static Shim UnsafeReplace(MethodInfo method, bool setter = false) { return new Shim(method, method.DeclaringType) { _setter = setter }; }
The above supports both methods and properties. The UnsafeReplace method would be used as follows:
UnsafeReplace
var methodInfo = typeof(Class).GetMethod("PrivateMethod", BindingFlags.Instance | BindingFlags.NonPublic); var with = Shim.UnsafeReplace(methodInfo).With((Class @this) => 100);
Please note, however, that this:
I cannot see a good reason for shimming private members. That is not to say that it won't be implemented.
Sorry, something went wrong.
No branches or pull requests
Ref: tonerdo/pose#57
Note that this would be incompatible with the changes in #13. Or at the very least it would introduce an alternate API.
The text was updated successfully, but these errors were encountered: