Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 4.0 .NET反射镜MSIL_Silverlight 4.0_Ria_Reflector - Fatal编程技术网

Silverlight 4.0 .NET反射镜MSIL

Silverlight 4.0 .NET反射镜MSIL,silverlight-4.0,ria,reflector,Silverlight 4.0,Ria,Reflector,查看reflector显示为的AuthorizedChangeSet方法 protected virtual bool AuthorizeChangeSet() { foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) { object entity = entry.Entity; if (entry.DomainOperation

查看reflector显示为的AuthorizedChangeSet方法

protected virtual bool AuthorizeChangeSet()
    {
        foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries)
        {
            object entity = entry.Entity;
            if (entry.DomainOperationEntry != null)
            {
                this.ValidateMethodPermissions(entry.DomainOperationEntry, entity);
            }
            if ((entry.EntityActions != null) && entry.EntityActions.Any<KeyValuePair<string, object[]>>())
            {
                KeyValuePair<string, object[]> pair = entry.EntityActions.Single<KeyValuePair<string, object[]>>();
                DomainOperationEntry customMethod = this.ServiceDescription.GetCustomMethod(entity.GetType(), pair.Key);
                this.ValidateMethodPermissions(customMethod, entity);
            }
        }
        return !this.ChangeSet.HasError;
    }
受保护的虚拟bool authorized变更集()
{
foreach(此.ChangeSet.ChangeSetEntries中的ChangeSetEntry条目)
{
对象实体=entry.entity;
if(entry.DomainOperationEntry!=null)
{
此.ValidateMethodPermissions(entry.DomainOperationEntry,entity);
}
if((entry.EntityActions!=null)和&entry.EntityActions.Any()
{
KeyValuePair=entry.EntityActions.Single();
DomainOperationEntry customMethod=this.ServiceDescription.GetCustomMethod(entity.GetType(),pair.Key);
这个.ValidateMethodPermissions(customMethod,entity);
}
}
return!this.ChangeSet.HasError;
}

当实体对象的强制转换为对象时,如何能够访问foreach循环中实体对象的属性???

仔细阅读,它没有。它只访问条目的成员,而不访问实体的成员。 另一个选项是ValidateMethodPermission使用反射