Visual Guard Class Library Documentation

VGPermissionsLoadingEventArgs Class

Provides data for the PermissionsLoading event.

For a list of all members of this type, see VGPermissionsLoadingEventArgs Members.

System.Object
   EventArgs
      VGPermissionsLoadingEventArgs

public class VGPermissionsLoadingEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

This example display how to use the event PermissionsLoading to allow the user select a roles in the list of granted roles.

[Visual Basic]
Private Sub OnPermissionLoading(ByVal sender As Object, ByVal e As VGPermissionsLoadingEventArgs)
    If e.Roles.Length > 0 Then
        Dim form As New SelectRoleForm
        form.Roles = e.Roles
        If form.ShowDialog() = DialogResult.OK Then
            e.Roles = form.Roles
        Else
            e.Status = VGAuthorizationStatus.Failure Or VGAuthorizationStatus.ProcessCanceled;
        End If
    End If
End Sub
[C#]
private void OnPermissionLoading (object sender, VGPermissionsLoadingEventArgs args)
{
    if (e.Roles.Length > 0)
        SelectRoleForm form = new SelectRoleForm();
        form.Roles = e.Roles;
        if (form.ShowDialog() == DialogResult.OK)
        {
            e.Roles = form.Roles;
        }
        else
        {
            e.Status = VGAuthorizationStatus.Failure | VGAuthorizationStatus.ProcessCanceled;
        }
    }
}

Requirements

Namespace: Novalys.VisualGuard.Security

Assembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll)

See Also

VGPermissionsLoadingEventArgs Members | Novalys.VisualGuard.Security Namespace