2 // HttpApplicationStateWrapper.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2008 Novell Inc. http://novell.com
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Collections.Specialized;
34 using System.Globalization;
35 using System.Runtime.CompilerServices;
36 using System.Runtime.Serialization;
37 using System.Security.Permissions;
38 using System.Security.Principal;
39 using System.Web.Caching;
44 [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
46 [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
47 [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
48 public class HttpApplicationStateWrapper : HttpApplicationStateBase
50 HttpApplicationState w;
52 public HttpApplicationStateWrapper (HttpApplicationState httpApplicationState)
54 if (httpApplicationState == null)
55 throw new ArgumentNullException ("httpApplicationState");
56 w = httpApplicationState;
59 public override string [] AllKeys {
60 get { return w.AllKeys; }
63 public override HttpApplicationStateBase Contents {
64 get { return new HttpApplicationStateWrapper (w.Contents); }
67 public override int Count {
68 get { return w.Count; }
71 public override bool IsSynchronized {
72 get { return ((ICollection) this).IsSynchronized; }
75 public override object this [int index] {
76 get { return Get (index); }
79 public override object this [string name] {
80 get { return Get (name); }
81 set { Set (name, value); }
84 public override NameObjectCollectionBase.KeysCollection Keys {
85 get { return w.Keys; }
88 public override HttpStaticObjectsCollectionBase StaticObjects {
89 get { return new HttpStaticObjectsCollectionWrapper (w.StaticObjects); }
92 public override object SyncRoot {
93 get { return ((ICollection) this).SyncRoot; }
96 public override void Add (string name, object value)
101 public override void Clear ()
106 public override void CopyTo (Array array, int index)
108 ((ICollection) this).CopyTo (array, index);
111 public override object Get (int index)
113 return w.Get (index);
116 public override object Get (string name)
121 public override IEnumerator GetEnumerator ()
123 return w.GetEnumerator ();
126 public override string GetKey (int index)
128 return w.GetKey (index);
132 public override void GetObjectData (SerializationInfo info, StreamingContext context)
134 w.GetObjectData (info, context);
136 throw new NotImplementedException ();
139 public override void Lock ()
144 public override void OnDeserialization (object sender)
146 w.OnDeserialization (sender);
149 public override void Remove (string name)
154 public override void RemoveAll ()
159 public override void RemoveAt (int index)
164 public override void Set (string name, object value)
169 public override void UnLock ()