1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
//------------------------------------------------------------------------------
// <copyright file="HttpApplicationStateWrapper.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web {
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Runtime.CompilerServices;
[SuppressMessage("Microsoft.Security", "CA2126:TypeLinkDemandsRequireInheritanceDemands", Justification="Workaround for FxCop Bug")]
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix",
Justification = "This type is an abstraction for HttpApplicationState.")]
[TypeForwardedFrom("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
public class HttpApplicationStateWrapper : HttpApplicationStateBase {
private HttpApplicationState _application;
public HttpApplicationStateWrapper(HttpApplicationState httpApplicationState) {
if (httpApplicationState == null) {
throw new ArgumentNullException("httpApplicationState");
}
_application = httpApplicationState;
}
public override string[] AllKeys {
get {
return _application.AllKeys;
}
}
public override HttpApplicationStateBase Contents {
get {
return this;
}
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public override int Count {
get {
return _application.Count;
}
}
public override bool IsSynchronized {
get {
return ((ICollection)_application).IsSynchronized;
}
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public override NameObjectCollectionBase.KeysCollection Keys {
get {
return _application.Keys;
}
}
public override object SyncRoot {
get {
return ((ICollection)_application).SyncRoot;
}
}
public override object this[int index] {
get {
return _application[index];
}
}
public override object this[string name] {
get {
return _application[name];
}
set {
_application[name] = value;
}
}
public override HttpStaticObjectsCollectionBase StaticObjects {
get {
// method returns an empty collection rather than null
return new HttpStaticObjectsCollectionWrapper(_application.StaticObjects);
}
}
public override void Add(string name, object value) {
_application.Add(name, value);
}
public override void Clear() {
_application.Clear();
}
public override void CopyTo(Array array, int index) {
((ICollection)_application).CopyTo(array, index);
}
public override object Get(int index) {
return _application.Get(index);
}
public override object Get(string name) {
return _application.Get(name);
}
public override IEnumerator GetEnumerator() {
return ((IEnumerable)_application).GetEnumerator();
}
public override string GetKey(int index) {
return _application.GetKey(index);
}
[SuppressMessage("Microsoft.Security", "CA2114:MethodSecurityShouldBeASupersetOfType", Justification = "Workaround for FxCop Bug")]
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context) {
_application.GetObjectData(info, context);
}
public override void Lock() {
_application.Lock();
}
[SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public override void OnDeserialization(object sender) {
_application.OnDeserialization(sender);
}
public override void Remove(string name) {
_application.Remove(name);
}
public override void RemoveAll() {
_application.RemoveAll();
}
public override void RemoveAt(int index) {
_application.RemoveAt(index);
}
public override void Set(string name, object value) {
_application.Set(name, value);
}
public override void UnLock() {
_application.UnLock();
}
}
}
|