annotate Demo/Asp.Net/BusinessLogic/ProfileProvider.cs @ 8:a34cfdde80d6

removed strong signing added FrameworkPathOverride for linux builds
author cin
date Wed, 29 Nov 2017 12:43:52 +0300
parents f990fcb411a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using System;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2 using System.Collections.Generic;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3 using System.Collections.Specialized;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4 using System.Configuration;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 using System.Web.Profile;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7 namespace PetShop.BusinessLogic
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9 using DataAccess;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 using ObjectModel;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 public sealed class ProfileProvider : System.Web.Profile.ProfileProvider
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14 private static string _applicationName = ".NET Pet Shop 4.0";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 /// The name of the application using the custom profile provider.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 public override string ApplicationName
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21 get { return _applicationName; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 set { _applicationName = value; }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
25 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
26 /// Initializes the provider.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
27 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
28 /// <param name="name">The friendly name of the provider.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
29 /// <param name="config">A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
30 public override void Initialize(string name, NameValueCollection config)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
31 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
32 if (config == null)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
33 throw new ArgumentNullException("config");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
34
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
35 if (string.IsNullOrEmpty(config["description"]))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
36 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
37 config.Remove("description");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
38 config.Add("description", "Pet Shop Custom Profile Provider");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
39 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
40
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
41 if (string.IsNullOrEmpty(name))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
42 name = "PetShopProfileProvider";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
43
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
44 if (config["applicationName"] != null && !string.IsNullOrEmpty(config["applicationName"].Trim()))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
45 _applicationName = config["applicationName"];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
46
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
47 base.Initialize(name, config);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
48 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
49
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
50 private const string ERR_INVALID_PARAMETER = "Invalid Profile parameter:";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
51 private const string PROFILE_SHOPPINGCART = "ShoppingCart";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
52 private const string PROFILE_WISHLIST = "WishList";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
53 private const string PROFILE_ACCOUNT = "AccountInfo";
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
54
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
55 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
56 /// Returns the collection of settings property values for the specified application instance and settings property group.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
57 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
58 /// <param name="context">A System.Configuration.SettingsContext describing the current application use.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
59 /// <param name="collection">A System.Configuration.SettingsPropertyCollection containing the settings property group whose values are to be retrieved.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
60 /// <returns>A System.Configuration.SettingsPropertyValueCollection containing the values for the specified settings property group.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
61 public override SettingsPropertyValueCollection GetPropertyValues(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
62 SettingsContext context, SettingsPropertyCollection collection)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
63 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
64 string username = (string)context["UserName"];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
65 bool isAuthenticated = (bool) context["IsAuthenticated"];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
66
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
67 SettingsPropertyValueCollection svc = new SettingsPropertyValueCollection();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
68
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
69 foreach (SettingsProperty prop in collection)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
70 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
71 SettingsPropertyValue pv = new SettingsPropertyValue(prop);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
72
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
73 switch (pv.Property.Name)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
74 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
75 case PROFILE_SHOPPINGCART: pv.PropertyValue = GetCartItems(username, true); break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
76 case PROFILE_WISHLIST: pv.PropertyValue = GetCartItems(username, false); break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
77 case PROFILE_ACCOUNT:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
78 if (isAuthenticated)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
79 pv.PropertyValue = GetAccountInfo(username);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
80 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
81
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
82 default:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
83 throw new ApplicationException(ERR_INVALID_PARAMETER + " name.");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
84 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
85
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
86 svc.Add(pv);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
87 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
88
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
89 return svc;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
90 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
91
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
92 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
93 /// Sets the values of the specified group of property settings.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
94 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
95 /// <param name="context">A System.Configuration.SettingsContext describing the current application usage.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
96 /// <param name="collection">A System.Configuration.SettingsPropertyValueCollection representing the group of property settings to set.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
97 public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
98 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
99 string username = (string)context["UserName"];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
100
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
101 CheckUserName(username);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
102
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
103 bool isAuthenticated = (bool)context["IsAuthenticated"];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
104 int uniqueID = GetUniqueID(username, isAuthenticated, false, ApplicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
105
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
106 foreach (SettingsPropertyValue pv in collection)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
107 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
108 if (pv.PropertyValue != null)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
109 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
110 switch (pv.Property.Name)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
111 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
112 case PROFILE_SHOPPINGCART: SetCartItems(uniqueID, (Cart)pv.PropertyValue, true); break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
113 case PROFILE_WISHLIST: SetCartItems(uniqueID, (Cart)pv.PropertyValue, false); break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
114 case PROFILE_ACCOUNT:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
115 if (isAuthenticated)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
116 SetAccountInfo(uniqueID, (Address)pv.PropertyValue);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
117 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
118
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
119 default:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
120 throw new ApplicationException(ERR_INVALID_PARAMETER + " name.");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
121 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
122 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
123 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
124
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
125 UpdateActivityDates(username, false);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
126 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
127
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
128 private int GetUniqueID(string userName, bool isAuthenticated, bool ignoreAuthenticationType, string appName)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
129 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
130 int? uniqueID = ignoreAuthenticationType ?
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
131 Accessor.GetUniqueID (userName, appName) :
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
132 Accessor.GetUniqueIDAuth(userName, appName, isAuthenticated);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
133
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
134 return uniqueID ?? Accessor.CreateProfile(userName, appName, isAuthenticated);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
135 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
136
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
137 private Address GetAccountInfo(string username)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
138 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
139 return Accessor.GetAccountInfo(username, _applicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
140 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
141
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
142 private Cart GetCartItems(string username, bool isShoppingCart)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
143 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
144 Cart cart = new Cart();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
145
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
146 foreach (CartItem cartItem in Accessor.GetCartItems(username, _applicationName, isShoppingCart))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
147 cart.Add(cartItem);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
148
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
149 return cart;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
150 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
151
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
152 private void SetAccountInfo(int uniqueID, Address address)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
153 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
154 Accessor.SetAccountInfo(uniqueID, address);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
155 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
156
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
157 private void SetCartItems(int uniqueID, Cart cart, bool isShoppingCart)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
158 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
159 Accessor.SetCartItems(uniqueID, cart.Items, isShoppingCart);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
160 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
161
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
162 // UpdateActivityDates
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
163 // Updates the LastActivityDate and LastUpdatedDate values
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
164 // when profile properties are accessed by the
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
165 // GetPropertyValues and SetPropertyValues methods.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
166 // Passing true as the activityOnly parameter will update
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
167 // only the LastActivityDate.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
168 private void UpdateActivityDates(string username, bool activityOnly)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
169 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
170 if (activityOnly)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
171 Accessor.UpdateActivityDate(username, _applicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
172 else
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
173 Accessor.UpdateActivityAndUdpateDates(username, _applicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
174 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
175
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
176 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
177 /// Deletes profile properties and information for the supplied list of profiles.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
178 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
179 /// <param name="profiles">A System.Web.Profile.ProfileInfoCollection of information about profiles that are to be deleted.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
180 /// <returns>The number of profiles deleted from the data source.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
181 public override int DeleteProfiles(ProfileInfoCollection profiles)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
182 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
183 int deleteCount = 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
184
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
185 foreach (ProfileInfo p in profiles)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
186 if (DeleteProfile(p.UserName))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
187 deleteCount++;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
188
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
189 return deleteCount;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
190 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
191
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
192 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
193 /// Deletes profile properties and information for profiles that match the supplied list of user names.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
194 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
195 /// <param name="usernames">A string array of user names for profiles to be deleted.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
196 /// <returns>The number of profiles deleted from the data source.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
197 public override int DeleteProfiles(string[] usernames)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
198 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
199 int deleteCount = 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
200
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
201 foreach (string user in usernames)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
202 if (DeleteProfile(user))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
203 deleteCount++;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
204
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
205 return deleteCount;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
206 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
207
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
208 // DeleteProfile
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
209 // Deletes profile data from the database for the specified user name.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
210 private bool DeleteProfile(string username)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
211 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
212 CheckUserName(username);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
213
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
214 int? uniqueID = Accessor.GetUniqueID(username, _applicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
215
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
216 return uniqueID != null && Accessor.DeleteProfile(uniqueID.Value) > 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
217 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
218
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
219 // Verifies user name for sise and comma
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
220 private static void CheckUserName(string userName)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
221 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
222 if (string.IsNullOrEmpty(userName) || userName.Length > 256 || userName.IndexOf(",") > 0)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
223 throw new ApplicationException(ERR_INVALID_PARAMETER + " user name.");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
224 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
225
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
226 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
227 /// Deletes all user-profile data for profiles in which the last activity date occurred before the specified date.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
228 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
229 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are deleted.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
230 /// <param name="userInactiveSinceDate">A System.DateTime that identifies which user profiles are considered inactive. If the System.Web.Profile.ProfileInfo.LastActivityDate value of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
231 /// <returns>The number of profiles deleted from the data source.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
232 public override int DeleteInactiveProfiles(ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
233 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
234 IList<string> list;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
235
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
236 switch (authenticationOption)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
237 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
238 case ProfileAuthenticationOption.Anonymous:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
239 list = Accessor.GetInactiveProfiles(userInactiveSinceDate, ApplicationName, true);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
240 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
241
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
242 case ProfileAuthenticationOption.Authenticated:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
243 list = Accessor.GetInactiveProfiles(userInactiveSinceDate, ApplicationName, false);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
244 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
245
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
246 default:
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
247 list = Accessor.GetInactiveProfiles(userInactiveSinceDate, ApplicationName);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
248 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
249 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
250
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
251 string[] userArray = new string[list.Count];
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
252
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
253 list.CopyTo(userArray, 0);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
254
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
255 return DeleteProfiles(userArray);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
256 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
257
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
258 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
259 /// Retrieves profile information for profiles in which the user name matches the specified user names.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
260 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
261 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
262 /// <param name="usernameToMatch">The user name to search for.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
263 /// <param name="pageIndex">The index of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
264 /// <param name="pageSize">The size of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
265 /// <param name="totalRecords">When this method returns, contains the total number of profiles.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
266 /// <returns>A System.Web.Profile.ProfileInfoCollection containing user-profile information
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
267 /// for profiles where the user name matches the supplied usernameToMatch parameter.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
268 public override ProfileInfoCollection FindProfilesByUserName(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
269 ProfileAuthenticationOption authenticationOption, string usernameToMatch,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
270 int pageIndex, int pageSize, out int totalRecords)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
271 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
272 CheckParameters(pageIndex, pageSize);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
273
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
274 return GetProfileInfo(authenticationOption, usernameToMatch, null, pageIndex, pageSize, out totalRecords);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
275 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
276
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
277 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
278 /// Retrieves profile information for profiles in which the last activity date occurred on or before the specified date and the user name matches the specified user name.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
279 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
280 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
281 /// <param name="usernameToMatch">The user name to search for.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
282 /// <param name="userInactiveSinceDate">A System.DateTime that identifies which user profiles are considered inactive. If the System.Web.Profile.ProfileInfo.LastActivityDate value of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
283 /// <param name="pageIndex">The index of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
284 /// <param name="pageSize">The size of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
285 /// <param name="totalRecords">When this method returns, contains the total number of profiles.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
286 /// <returns>A System.Web.Profile.ProfileInfoCollection containing user profile information for inactive profiles where the user name matches the supplied usernameToMatch parameter.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
287 public override ProfileInfoCollection FindInactiveProfilesByUserName(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
288 ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
289 int pageIndex, int pageSize, out int totalRecords)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
290 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
291 CheckParameters(pageIndex, pageSize);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
292
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
293 return GetProfileInfo(authenticationOption, usernameToMatch, userInactiveSinceDate, pageIndex, pageSize, out totalRecords);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
294 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
295
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
296 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
297 /// Retrieves user profile data for all profiles in the data source.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
298 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
299 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
300 /// <param name="pageIndex">The index of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
301 /// <param name="pageSize">The size of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
302 /// <param name="totalRecords">When this method returns, contains the total number of profiles.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
303 /// <returns>A System.Web.Profile.ProfileInfoCollection containing user-profile information for all profiles in the data source.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
304 public override ProfileInfoCollection GetAllProfiles(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
305 ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
306 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
307 CheckParameters(pageIndex, pageSize);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
308
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
309 return GetProfileInfo(authenticationOption, null, null, pageIndex, pageSize, out totalRecords);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
310 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
311
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
312 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
313 /// Retrieves user-profile data from the data source for profiles in which the last activity date occurred on or before the specified date.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
314 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
315 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
316 /// <param name="userInactiveSinceDate">A System.DateTime that identifies which user profiles are considered inactive. If the System.Web.Profile.ProfileInfo.LastActivityDate of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
317 /// <param name="pageIndex">The index of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
318 /// <param name="pageSize">The size of the page of results to return.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
319 /// <param name="totalRecords">When this method returns, contains the total number of profiles.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
320 /// <returns>A System.Web.Profile.ProfileInfoCollection containing user-profile information about the inactive profiles.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
321 public override ProfileInfoCollection GetAllInactiveProfiles(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
322 ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
323 int pageIndex, int pageSize, out int totalRecords)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
324 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
325 CheckParameters(pageIndex, pageSize);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
326
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
327 return GetProfileInfo(authenticationOption, null, userInactiveSinceDate, pageIndex, pageSize, out totalRecords);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
328 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
329
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
330 /// <summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
331 /// Returns the number of profiles in which the last activity date occurred on or before the specified date.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
332 /// </summary>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
333 /// <param name="authenticationOption">One of the System.Web.Profile.ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
334 /// <param name="userInactiveSinceDate">A System.DateTime that identifies which user profiles are considered inactive. If the System.Web.Profile.ProfileInfo.LastActivityDate of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
335 /// <returns>The number of profiles in which the last activity date occurred on or before the specified date.</returns>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
336 public override int GetNumberOfInactiveProfiles(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
337 ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
338 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
339 int inactiveProfiles = 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
340
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
341 ProfileInfoCollection profiles = GetProfileInfo(authenticationOption, null, userInactiveSinceDate, 0, 0, out inactiveProfiles);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
342
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
343 return inactiveProfiles;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
344 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
345
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
346 private static void CheckParameters(int pageIndex, int pageSize)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
347 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
348 if (pageIndex < 1 || pageSize < 1)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
349 throw new ApplicationException(ERR_INVALID_PARAMETER + " page index.");
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
350 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
351
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
352 // GetProfileInfo
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
353 // Retrieves a count of profiles and creates a
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
354 // ProfileInfoCollection from the profile data in the
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
355 // database. Called by GetAllProfiles, GetAllInactiveProfiles,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
356 // FindProfilesByUserName, FindInactiveProfilesByUserName,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
357 // and GetNumberOfInactiveProfiles.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
358 // Specifying a pageIndex of 0 retrieves a count of the results only.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
359 private ProfileInfoCollection GetProfileInfo(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
360 ProfileAuthenticationOption authenticationOption,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
361 string usernameToMatch,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
362 DateTime? userInactiveSinceDate,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
363 int pageIndex,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
364 int pageSize,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
365 out int totalRecords)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
366 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
367 totalRecords = 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
368
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
369 ProfileInfoCollection profiles = new ProfileInfoCollection();
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
370
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
371 // Count profiles only.
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
372 if (pageSize == 0)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
373 return profiles;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
374
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
375 int counter = 0;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
376 int startIndex = pageSize * (pageIndex - 1);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
377 int endIndex = startIndex + pageSize - 1;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
378
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
379 bool? isAnonymous = null;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
380
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
381 if (authenticationOption == ProfileAuthenticationOption.Anonymous)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
382 isAnonymous = true;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
383 else if (authenticationOption == ProfileAuthenticationOption.Authenticated)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
384 isAnonymous = false;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
385
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
386 foreach (CustomProfile profile in Accessor.GetProfile(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
387 isAnonymous, usernameToMatch, userInactiveSinceDate, _applicationName, out totalRecords))
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
388 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
389 if (counter >= startIndex)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
390 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
391 ProfileInfo p = new ProfileInfo(
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
392 profile.UserName,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
393 profile.IsAnonymous ?? true,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
394 profile.LastActivityDate ?? DateTime.MinValue,
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
395 profile.LastUpdatedDate ?? DateTime.MinValue, 0);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
396
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
397 profiles.Add(p);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
398 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
399
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
400 if (counter >= endIndex)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
401 break;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
402
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
403 counter++;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
404 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
405
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
406 return profiles;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
407 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
408
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
409 #region Accessor
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
410
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
411 ProfileAccessor Accessor
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
412 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
413 [System.Diagnostics.DebuggerStepThrough]
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
414 get { return ProfileAccessor.CreateInstance(); }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
415 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
416
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
417 #endregion
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
418 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
419 }