internal SecurityDeclaration(MetadataHeader header, MetadataToken token, MetadataRow <ushort, uint, uint> row) : base(header, token, row) { Action = (SecurityAction)row.Column1; var tableStream = header.GetStream <TableStream>(); _parent = new LazyValue <IHasSecurityAttribute>(() => { var parentToken = tableStream.GetIndexEncoder(CodedIndex.HasDeclSecurity).DecodeIndex(row.Column2); return(parentToken.Rid != 0 ? (IHasSecurityAttribute)tableStream.ResolveMember(parentToken) : null); }); _permissionSet = new LazyValue <PermissionSetSignature>(() => PermissionSetSignature.FromReader(header, header.GetStream <BlobStream>().CreateBlobReader(row.Column3))); }
internal SecurityDeclaration(MetadataImage image, MetadataRow <SecurityAction, uint, uint> row) : base(row.MetadataToken) { _image = image; var tableStream = image.Header.GetStream <TableStream>(); Action = row.Column1; _parent = new LazyValue <IHasSecurityAttribute>(() => { var parentToken = tableStream.GetIndexEncoder(CodedIndex.HasDeclSecurity).DecodeIndex(row.Column2); return(parentToken.Rid != 0 ? (IHasSecurityAttribute)_image.ResolveMember(parentToken) : null); }); _permissionSet = new LazyValue <PermissionSetSignature>(() => PermissionSetSignature.FromReader(image, tableStream.MetadataHeader.GetStream <BlobStream>().CreateBlobReader(row.Column3))); CustomAttributes = new CustomAttributeCollection(this); }