RE: assembly security/permission question



No - my question is if I put
[assembly:
FileDialogPermission(SecurityAction.RequestRefuse,Unrestricted=true)]

in the assembly of a DLL, and that DLL has an event other DLLs subscribe to
- when that event fires does the above restriction stop the delegates in
other events from calling a FileDialog?

Because all I want to do in the assembly is say my dll does not call
FIleDialog - but that it is fine for other dlls that it calls via an event to
call it.


--
thanks - dave


""Peter Huang" [MSFT]" wrote:

> Hi
>
> Is this what you want?
>
> [DLL]
> [assembly:
> FileDialogPermission(SecurityAction.RequestRefuse,Unrestricted=true)]
> public class TestClass
> {
> public OpenFileDialog openFileDialog1 = new OpenFileDialog();
> public void ShowFileDialog()
> {
> openFileDialog1.ShowDialog();
> openFileDialog1.OpenFile(); //Failed due to security
> }
> }
>
> [Form client]
> TestClass tc = new TestClass();
>
> private void button1_Click(object sender, System.EventArgs e)
> {
> tc.ShowFileDialog();//failed
> }
> private void button2_Click(object sender, System.EventArgs e)
> {
> tc.openFileDialog1.ShowDialog();
> tc.openFileDialog1.OpenFile(); //Succeed.
> }
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
.