从反射器反汇编的代码中的 CachedAnonymousMethodDelegate1
我正在探索将 silverlight 的 System.ComponentModel.DataAnnotations 移植到桌面的可能性,以便重用在我的 silverlight 业务对象中完成的验证(不要问...)。
问题是我得到的代码类似于...
// Methods
protected ValidationAttribute() : this(CS$<>9__CachedAnonymousMethodDelegate1)
{
if (CS$<>9__CachedAnonymousMethodDelegate1 == null)
{
CS$<>9__CachedAnonymousMethodDelegate1 = new Func<string>(null, (IntPtr) <.ctor>b__0);
}
}
protected ValidationAttribute(Func<string> errorMessageAccessor)
{
this._syncLock = new object();
this._errorMessageResourceAccessor = errorMessageAccessor;
}
protected ValidationAttribute(string errorMessage) : this(new Func<string>(class2, (IntPtr) this.<.ctor>b__2))
{
}
有没有办法解决这个问题?
I'm exploring the possibility of porting silverlight's System.ComponentModel.DataAnnotations to the desktop in order to reuse validation done in my silverlight business objects (don't ask...).
The problem is I'm getting code like...
// Methods
protected ValidationAttribute() : this(CSlt;>9__CachedAnonymousMethodDelegate1)
{
if (CSlt;>9__CachedAnonymousMethodDelegate1 == null)
{
CSlt;>9__CachedAnonymousMethodDelegate1 = new Func<string>(null, (IntPtr) <.ctor>b__0);
}
}
protected ValidationAttribute(Func<string> errorMessageAccessor)
{
this._syncLock = new object();
this._errorMessageResourceAccessor = errorMessageAccessor;
}
protected ValidationAttribute(string errorMessage) : this(new Func<string>(class2, (IntPtr) this.<.ctor>b__2))
{
}
Is there anyway that I can work around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是编译后匿名委托的样子。
您可以将源中的匿名委托更改为声明的委托。
那么使用类似反射器的工具对其进行逆向工程应该没有问题。
This is the way an anonymous delegate looks like, after compilation.
You could change the anonymous delegate in the source to be a declared delegate.
Then it should be no problem to reverse engineer it with a reflector like tool.