X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web%2FHttpApplicationState.cs;h=3b0f3e1ad6f9cf8e1c3e7ca6c8ca6f3a2e50a600;hb=b6969f355f56af8e2b62fa705f799e87f5226502;hp=de259d16d38dafa268a512c90bf653235043f8a3;hpb=9d61782c6e2392d7ceec2006b35be582598a70ae;p=mono.git diff --git a/mcs/class/System.Web/System.Web/HttpApplicationState.cs b/mcs/class/System.Web/System.Web/HttpApplicationState.cs index de259d16d38..3b0f3e1ad6f 100644 --- a/mcs/class/System.Web/System.Web/HttpApplicationState.cs +++ b/mcs/class/System.Web/System.Web/HttpApplicationState.cs @@ -34,12 +34,12 @@ namespace System.Web { // CAS - no InheritanceDemand here as the class is sealed [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public sealed class HttpApplicationState : NameObjectCollectionBase + public sealed class HttpApplicationState : NameObjectCollectionBase { - private HttpStaticObjectsCollection _AppObjects; - private HttpStaticObjectsCollection _SessionObjects; + HttpStaticObjectsCollection _AppObjects; + HttpStaticObjectsCollection _SessionObjects; - private ReaderWriterLock _Lock; + ReaderWriterLock _Lock; internal HttpApplicationState () { @@ -52,21 +52,21 @@ namespace System.Web { internal HttpApplicationState (HttpStaticObjectsCollection AppObj, HttpStaticObjectsCollection SessionObj) { - if (null != AppObj) + if (null != AppObj) { _AppObjects = AppObj; - } - else + } + else { // do not use the public (empty) ctor as it required UnmanagedCode permission _AppObjects = new HttpStaticObjectsCollection (this); } - if (null != SessionObj) + if (null != SessionObj) { _SessionObjects = SessionObj; - } - else + } + else { // do not use the public (empty) ctor as it required UnmanagedCode permission _SessionObjects = new HttpStaticObjectsCollection (this); @@ -77,11 +77,11 @@ namespace System.Web { public void Add (string name, object value) { _Lock.AcquireWriterLock (-1); - try + try { BaseAdd (name, value); - } - finally + } + finally { _Lock.ReleaseWriterLock (); } @@ -90,11 +90,11 @@ namespace System.Web { public void Clear () { _Lock.AcquireWriterLock (-1); - try + try { BaseClear (); - } - finally + } + finally { _Lock.ReleaseWriterLock (); } @@ -105,11 +105,11 @@ namespace System.Web { object ret = null; _Lock.AcquireReaderLock (-1); - try + try { ret = BaseGet (name); - } - finally + } + finally { _Lock.ReleaseReaderLock (); } @@ -122,11 +122,11 @@ namespace System.Web { object ret = null; _Lock.AcquireReaderLock (-1); - try + try { ret = BaseGet (index); - } - finally + } + finally { _Lock.ReleaseReaderLock (); } @@ -139,11 +139,11 @@ namespace System.Web { string ret = null; _Lock.AcquireReaderLock (-1); - try + try { ret = BaseGetKey (index); - } - finally + } + finally { _Lock.ReleaseReaderLock (); } @@ -159,11 +159,11 @@ namespace System.Web { public void Remove (string name) { _Lock.AcquireWriterLock (-1); - try + try { BaseRemove (name); - } - finally + } + finally { _Lock.ReleaseWriterLock (); } @@ -177,11 +177,11 @@ namespace System.Web { public void RemoveAt (int index) { _Lock.AcquireWriterLock (-1); - try + try { BaseRemoveAt (index); - } - finally + } + finally { _Lock.ReleaseWriterLock (); } @@ -190,11 +190,11 @@ namespace System.Web { public void Set (string name, object value) { _Lock.AcquireWriterLock (-1); - try + try { BaseSet (name, value); - } - finally + } + finally { _Lock.ReleaseWriterLock (); } @@ -205,18 +205,18 @@ namespace System.Web { _Lock.ReleaseWriterLock (); } - public string [] AllKeys + public string [] AllKeys { - get + get { string [] ret = null; _Lock.AcquireReaderLock (-1); - try + try { ret = BaseGetAllKeys (); - } - finally + } + finally { _Lock.ReleaseReaderLock (); } @@ -225,23 +225,23 @@ namespace System.Web { } } - public HttpApplicationState Contents + public HttpApplicationState Contents { get { return this; } } - public override int Count + public override int Count { - get + get { int ret = 0; _Lock.AcquireReaderLock (-1); - try + try { ret = base.Count; - } - finally + } + finally { _Lock.ReleaseReaderLock (); } @@ -250,25 +250,25 @@ namespace System.Web { } } - public object this [string name] + public object this [string name] { get { return Get (name); } set { Set (name, value); } } - public object this [int index] + public object this [int index] { get { return Get (index); } } // ASP Session based objects - internal HttpStaticObjectsCollection SessionObjects + internal HttpStaticObjectsCollection SessionObjects { get { return _SessionObjects; } } // ASP App based objects - public HttpStaticObjectsCollection StaticObjects + public HttpStaticObjectsCollection StaticObjects { get { return _AppObjects; } }