diff options
Diffstat (limited to 'mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs')
-rw-r--r-- | mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs index b3beb7700fa..97292277471 100644 --- a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs +++ b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs @@ -1,41 +1,41 @@ //
-// Mainsoft.Web.Profile.DerbyProfileProvider -// -// Authors: -// Vladimir Krasnov (vladimirk@mainsoft.com) -// -// (C) 2006 Mainsoft -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_2_0 - +// Mainsoft.Web.Profile.DerbyProfileProvider
+//
+// Authors:
+// Vladimir Krasnov (vladimirk@mainsoft.com)
+//
+// (C) 2006 Mainsoft
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
using System;
using System.Data.OleDb;
using System.Data.Common;
-using System.Collections; +using System.Collections;
using System.Configuration;
using System.Globalization;
using System.Web.Profile;
-using System.Web.Configuration; +using System.Web.Configuration;
using System.Collections.Specialized;
using System.Text;
using System.IO;
@@ -43,21 +43,21 @@ using System.IO; using Mainsoft.Web.Security;
using System.Configuration.Provider;
-namespace Mainsoft.Web.Profile -{ +namespace Mainsoft.Web.Profile
+{
/// <summary>
/// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
/// <para>Manages storage of profile information for an ASP.NET application in a Derby database.</para>
- /// </summary> - public class DerbyProfileProvider : ProfileProvider + /// </summary>
+ public class DerbyProfileProvider : ProfileProvider
{
ConnectionStringSettings _connectionString;
- string _applicationName = string.Empty; + string _applicationName = string.Empty;
bool _schemaChecked = false;
- DerbyUnloadManager.DerbyShutDownPolicy _shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default; - - public DerbyProfileProvider () - { + DerbyUnloadManager.DerbyShutDownPolicy _shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;
+
+ public DerbyProfileProvider ()
+ {
}
public override string ApplicationName
@@ -78,13 +78,13 @@ namespace Mainsoft.Web.Profile OleDbConnection connection = new OleDbConnection (_connectionString.ConnectionString);
connection.Open ();
return connection;
- } - - public override int DeleteInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate) + }
+
+ public override int DeleteInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
{
using (DbConnection connection = CreateConnection ()) {
return DerbyProfileHelper.Profile_DeleteInactiveProfiles (connection, ApplicationName, (int) authenticationOption, userInactiveSinceDate);
- } + }
}
public override int DeleteProfiles (ProfileInfoCollection profiles)
@@ -130,9 +130,9 @@ namespace Mainsoft.Web.Profile }
return DeleteProfilesInternal (usernames);
- } - - private int DeleteProfilesInternal (string[] usernames) + }
+
+ private int DeleteProfilesInternal (string[] usernames)
{
using (DbConnection connection = CreateConnection ()) {
return DerbyProfileHelper.Profile_DeleteProfiles (connection, ApplicationName, usernames);
@@ -186,13 +186,13 @@ namespace Mainsoft.Web.Profile return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);
}
}
- } - - public override ProfileInfoCollection GetAllInactiveProfiles (ProfileAuthenticationOption authenticationOption, - DateTime userInactiveSinceDate, - int pageIndex, - int pageSize, - out int totalRecords) + }
+
+ public override ProfileInfoCollection GetAllInactiveProfiles (ProfileAuthenticationOption authenticationOption,
+ DateTime userInactiveSinceDate,
+ int pageIndex,
+ int pageSize,
+ out int totalRecords)
{
if (pageIndex < 0)
throw new ArgumentException ("pageIndex is less than zero");
@@ -211,12 +211,12 @@ namespace Mainsoft.Web.Profile return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);
}
}
- } - - public override ProfileInfoCollection GetAllProfiles (ProfileAuthenticationOption authenticationOption, - int pageIndex, - int pageSize, - out int totalRecords) + }
+
+ public override ProfileInfoCollection GetAllProfiles (ProfileAuthenticationOption authenticationOption,
+ int pageIndex,
+ int pageSize,
+ out int totalRecords)
{
if (pageIndex < 0)
throw new ArgumentException ("pageIndex is less than zero");
@@ -235,17 +235,17 @@ namespace Mainsoft.Web.Profile return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);
}
}
- } - - public override int GetNumberOfInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate) + }
+
+ public override int GetNumberOfInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
{
using (DbConnection connection = CreateConnection ()) {
return DerbyProfileHelper.Profile_GetNumberOfInactiveProfiles (
connection, ApplicationName, (int) authenticationOption, userInactiveSinceDate);
}
- } - - public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext sc, SettingsPropertyCollection properties) + }
+
+ public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext sc, SettingsPropertyCollection properties)
{
SettingsPropertyValueCollection settings = new SettingsPropertyValueCollection ();
@@ -301,8 +301,8 @@ namespace Mainsoft.Web.Profile buf, username, authenticated, DateTime.UtcNow);
}
}
- - public override void Initialize (string name, NameValueCollection config) +
+ public override void Initialize (string name, NameValueCollection config)
{
if (config == null)
throw new ArgumentNullException ("config");
@@ -359,7 +359,7 @@ namespace Mainsoft.Web.Profile int size = reader.GetInt32 (4);
return new ProfileInfo (username, anonymous, lastActivity, lastUpdate, size);
- } + }
// Helper methods
private void DecodeProfileData (string allnames, string values, byte [] buf, SettingsPropertyValueCollection properties)
@@ -466,8 +466,8 @@ namespace Mainsoft.Web.Profile throw new ArgumentException (String.Format ("invalid format for {0}", pName));
}
- - } -} - -#endif +
+ }
+}
+
+#endif
|