UIPermission Constructor (UIPermissionClipboard)

Initializes a new instance of the UIPermission class with the permissions for the clipboard, and no access to windows.

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)

public UIPermission (
	UIPermissionClipboard clipboardFlag
)
public UIPermission (
	UIPermissionClipboard clipboardFlag
)
public function UIPermission (
	clipboardFlag : UIPermissionClipboard
)

Parameters

clipboardFlag

One of the UIPermissionClipboard values.

Exception typeCondition

ArgumentException

The clipboardFlag parameter is not a valid UIPermissionClipboard value.

To set both the clipboard and window permissions, use the constructor that takes parameters for both.

For the complete example, see the UIPermission class topic.

public bool CreateUI(out UIPermissionClipboard cb)
{


    if (cbIndex >= myCB.Length)
    {
        cb = UIPermissionClipboard.NoClipboard;
        return false;
    }

    cb = myCB[cbIndex++];
    return true;
}

// Create a UIPermission using the specified UIPermissionClipboard 
// enumeration to set Clipboard permissions.
public boolean CreateUI(UIPermission uiPerm[], 
    UIPermissionClipboard cb[])
{
    if (cbIndex >= myCB.length) {
        uiPerm[0] = new UIPermission(PermissionState.None);
        cb[0] = UIPermissionClipboard.NoClipboard;
        return false;
    }
    cb[0] = myCB[cbIndex++];
    try {
        uiPerm[0] = new UIPermission(cb[0]);
        return true;
    }
    catch (System.Exception e) {
        Console.WriteLine(("Cannot create UIPermission: " 
            + cb[0] + " " + e));
        uiPerm[0] = new UIPermission(PermissionState.None);
        cb[0] = UIPermissionClipboard.NoClipboard;
        return true;
    }
} //CreateUI

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: