...
namespace ContosoProviders
{
public sealed class Roles : RoleProvider
{
private bool pWriteExceptionsToEventLog = false;
public bool WriteExceptionsToEventLog
{
get { return pWriteExceptionsToEventLog; }
set { pWriteExceptionsToEventLog = value; }
}
//
// System.Configuration.Provider.ProviderBase.Initialize method.
//
public override void Initialize(string name, NameValueCollection config)
{
// Initialize the abstract base class.
base.Initialize(name, config);
}
//
// System.Web.Security.RoleProvider properties.
//
private string pApplicationName = "";
public override string ApplicationName
{
get { return pApplicationName; }
set { pApplicationName = value; }
}
//
// System.Web.Security.RoleProvider methods.
//
//
// RoleProvider.AddUsersToRoles
//
public override void AddUsersToRoles(string[] usernames, string[] rolenames)
{
throw new NotImplementedException();
}
// CUT
}
}
Autentyczny styl z przykładu MSDN (CUT – wycięty fragment, styl przed i po CUT zachowany). Znaleziony w pliku ContosoProviders_MSDNExample.zip na Code MSDN do którego odnośnik jest na stronach MSDN (nie mogę znaleźć linków).