Skip to content

Instantly share code, notes, and snippets.

/// <summary>
/// The RolesAttribute extends the <see cref="AuthorizeAttribute"/> by allowing you to just assign a list of strings.
/// </summary>
public class RolesAttribute : AuthorizeAttribute
{
public RolesAttribute(params string[] roles)
{
if (roles == null)
throw new ArgumentNullException("roles", "roles can not be a null reference.");
@wcabus
wcabus / SortableBindingList.vb
Last active March 18, 2016 23:33
SortableBindingList is a list that supports sorting its items and filtering them.
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Reflection
Imports System.Linq
Imports System.Linq.Dynamic
''' <summary>
''' SortableBindingList is a list that supports sorting its items and filtering them.
''' When binding a <see cref="System.Collections.Generic.List(Of T)"/> to a <see cref="System.Windows.Forms.DataGridView"/>, you can not sort by clicking on the columns
''' or filter the list. With this list, you can.