2011-11-16 196 views
0

我正在探索移植Silverlight的System.ComponentModel.DataAnnotations到桌面的可能性,以便重用在我的Silverlight业务对象中完成验证(不要问...)。CachedAnonymousMethodDelegate1从代码反汇编代码

的问题是我得到这样的代码......

// 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)) 
{ 
} 

反正是有,我可以解决此问题?

回答

0

编译后,这就是匿名委托的样子。

您可以将源中的匿名委托更改为已声明的委托。

那么用反射镜工具对其进行反向工程应该没有问题。