Skip to content

Commit edb6877

Browse files
committed
Some formatting to changes so that brackets are on next line ala C# conventions
1 parent c6bc397 commit edb6877

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

Couchbase.AspNet/SessionState/CouchbaseSessionStateProvider.cs

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ public class CouchbaseSessionStateProvider : SessionStateStoreProviderBase
3434
/// </summary>
3535
/// <param name="name">Name of the element in the configuration file</param>
3636
/// <param name="config">Configuration values for the provider from the Web.config file</param>
37-
public override void Initialize(
38-
string name,
39-
NameValueCollection config)
37+
public override void Initialize(string name, NameValueCollection config)
4038
{
4139
// Initialize the base class
4240
base.Initialize(name, config);
@@ -53,11 +51,13 @@ public override void Initialize(
5351

5452
// Allow optional header and data prefixes to be used for this application
5553
var headerPrefix = ProviderHelper.GetAndRemove(config, "headerPrefix", false);
56-
if (headerPrefix != null) {
54+
if (headerPrefix != null)
55+
{
5756
HeaderPrefix = headerPrefix;
5857
}
5958
var dataPrefix = ProviderHelper.GetAndRemove(config, "dataPrefix", false);
60-
if (dataPrefix != null) {
59+
if (dataPrefix != null)
60+
{
6161
DataPrefix = dataPrefix;
6262
}
6363

@@ -70,7 +70,8 @@ public override void Initialize(
7070
/// </summary>
7171
public override void Dispose()
7272
{
73-
if (_cluster != null) {
73+
if (_cluster != null)
74+
{
7475
_cluster.Dispose();
7576
_cluster = null;
7677
}
@@ -81,8 +82,7 @@ public override void Dispose()
8182
/// initialization required by the session-state store provider.
8283
/// </summary>
8384
/// <param name="context">HttpContext for the current request</param>
84-
public override void InitializeRequest(
85-
HttpContext context)
85+
public override void InitializeRequest(HttpContext context)
8686
{
8787
}
8888

@@ -91,8 +91,7 @@ public override void InitializeRequest(
9191
/// cleanup required by the session-state store provider.
9292
/// </summary>
9393
/// <param name="context">HttpContext for the current request</param>
94-
public override void EndRequest(
95-
HttpContext context)
94+
public override void EndRequest(HttpContext context)
9695
{
9796
}
9897

@@ -106,9 +105,7 @@ public override void EndRequest(
106105
/// <param name="context">HttpContext for the current request</param>
107106
/// <param name="timeout">Timeout value for the session</param>
108107
/// <returns>New SessionStateStoreData object for storing the session state data</returns>
109-
public override SessionStateStoreData CreateNewStoreData(
110-
HttpContext context,
111-
int timeout)
108+
public override SessionStateStoreData CreateNewStoreData(HttpContext context, int timeout)
112109
{
113110
return new SessionStateStoreData(new SessionStateItemCollection(),
114111
SessionStateUtility.GetSessionStaticObjects(context),
@@ -123,12 +120,10 @@ public override SessionStateStoreData CreateNewStoreData(
123120
/// <param name="context">HttpContext for the current request</param>
124121
/// <param name="id">Session ID for the new session</param>
125122
/// <param name="timeout">Timeout value for the session</param>
126-
public override void CreateUninitializedItem(
127-
HttpContext context,
128-
string id,
129-
int timeout)
123+
public override void CreateUninitializedItem(HttpContext context, string id, int timeout)
130124
{
131-
var e = new SessionStateItem {
125+
var e = new SessionStateItem
126+
{
132127
Data = new SessionStateItemCollection(),
133128
Flag = SessionStateActions.InitializeItem,
134129
LockId = 0,
@@ -215,12 +210,14 @@ public static SessionStateItem GetSessionStoreItem(
215210
if (e == null)
216211
return null;
217212

218-
if (acquireLock) {
213+
if (acquireLock)
214+
{
219215
// repeat until we can update the retrieved
220216
// item (i.e. nobody changes it between the
221217
// time we get it from the store and updates it s attributes)
222218
// Save() will return false if Cas() fails
223-
while (true) {
219+
while (true)
220+
{
224221
if (e.LockId > 0)
225222
break;
226223

@@ -272,7 +269,8 @@ public override void SetAndReleaseItemExclusive(
272269
{
273270
SessionStateItem e;
274271
do {
275-
if (!newItem) {
272+
if (!newItem)
273+
{
276274
var tmp = (ulong)lockId;
277275

278276
// Load the entire item with CAS (need the DataCas value also for the save)
@@ -281,10 +279,13 @@ public override void SetAndReleaseItemExclusive(
281279
// if we're expecting an existing item, but
282280
// it's not in the cache
283281
// or it's locked by someone else, then quit
284-
if (e == null || e.LockId != tmp) {
282+
if (e == null || e.LockId != tmp)
283+
{
285284
return;
286285
}
287-
} else {
286+
}
287+
else
288+
{
288289
// Create a new item if it requested
289290
e = new SessionStateItem();
290291
}
@@ -318,7 +319,8 @@ public override void ReleaseItemExclusive(
318319
e = SessionStateItem.Load(_bucket, id, true);
319320

320321
// Bail if the entry does not exist, or the lock ID does not match our lock ID
321-
if (e == null || e.LockId != tmp) {
322+
if (e == null || e.LockId != tmp)
323+
{
322324
break;
323325
}
324326

@@ -344,7 +346,8 @@ public override void RemoveItem(
344346
var tmp = (ulong)lockId;
345347
var e = SessionStateItem.Load(_bucket, id, true);
346348

347-
if (e != null && e.LockId == tmp) {
349+
if (e != null && e.LockId == tmp)
350+
{
348351
SessionStateItem.Remove(_bucket, id);
349352
}
350353
}
@@ -362,7 +365,8 @@ public override void ResetItemTimeout(
362365
do {
363366
// Load the item with CAS
364367
e = SessionStateItem.Load(_bucket, id, false);
365-
if (e == null) {
368+
if (e == null)
369+
{
366370
break;
367371
}
368372

@@ -376,8 +380,7 @@ public override void ResetItemTimeout(
376380
/// </summary>
377381
/// <param name="expireCallback">Session expiration callback to set</param>
378382
/// <returns>False, since we don't support this feature</returns>
379-
public override bool SetItemExpireCallback(
380-
SessionStateItemExpireCallback expireCallback)
383+
public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
381384
{
382385
return false;
383386
}

0 commit comments

Comments
 (0)