Merge pull request #3622 from rolfbjarne/remove-stray-file
[mono.git] / mcs / class / referencesource / System.Web / Profile / ProfileProvider.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="ProfileProvider.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6 /*
7  * ProfileProvider
8  *
9  * Copyright (c) 2002 Microsoft Corporation
10  */
11 namespace System.Web.Profile
12 {
13     using System.Security.Principal;
14     using System.Security.Permissions;
15     using System.Collections;
16     using System.Collections.Specialized;
17     using System.Web.Configuration;
18     using System.Web.Util;
19     using System.Web.Security;
20     using System.Web.Compilation;
21     using System.Configuration;
22     using System.Configuration.Provider;
23     using System.Reflection;
24     using System.CodeDom;
25
26     public  abstract class ProfileProvider : SettingsProvider
27     {
28         public abstract int  DeleteProfiles (ProfileInfoCollection  profiles);
29         public abstract int  DeleteProfiles (string[]               usernames);
30
31         public abstract int  DeleteInactiveProfiles         (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
32         public abstract int  GetNumberOfInactiveProfiles    (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
33
34         public abstract ProfileInfoCollection GetAllProfiles                (ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords);
35         public abstract ProfileInfoCollection GetAllInactiveProfiles        (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
36         public abstract ProfileInfoCollection FindProfilesByUserName        (ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
37         public abstract ProfileInfoCollection FindInactiveProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
38     }
39
40     public sealed class ProfileProviderCollection : SettingsProviderCollection
41     {
42         public override void Add(ProviderBase provider)
43         {
44             if( provider == null )
45             {
46                 throw new ArgumentNullException( "provider" );
47             }
48
49             if( !( provider is ProfileProvider ) )
50             {
51                 throw new ArgumentException(SR.GetString(SR.Provider_must_implement_type, typeof(ProfileProvider).ToString()), "provider");
52             }
53
54             base.Add( provider );
55         }
56
57         new public ProfileProvider this[string name]
58         {
59             get
60             {
61                 return (ProfileProvider) base[name];
62             }
63         }
64     }
65
66 }