PermissionSet permissions = new PermissionSet(); bool isEmpty = permissions.IsEmpty; //returns true
PermissionSet permissions = new PermissionSet(); permissions.AddPermission(new FileIOPermission(FileIOPermissionAccess.Read, "C:\\temp\\file.txt")); bool isEmpty = permissions.IsEmpty; //returns falseIn this example, a new PermissionSet object is created and a FileIOPermission object is added to it. The IsEmpty property is checked, which returns false since the permission set now contains a permission. This property is part of the System.Security namespace, which is part of the .NET Framework Class Library.