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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
//------------------------------------------------------------------------------
// <copyright file="OutputCacheParameters.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.UI
{
using System;
using System.Web.Util;
using System.Security.Permissions;
[FlagsAttribute()]
internal enum OutputCacheParameter : int
{
// Flags to determine if a particular parameter has been set
CacheProfile = 0x00000001,
Duration = 0x00000002,
Enabled = 0x00000004,
Location = 0x00000008,
NoStore = 0x00000010,
SqlDependency = 0x00000020,
VaryByControl = 0x00000040,
VaryByCustom = 0x00000080,
VaryByHeader = 0x00000100,
VaryByParam = 0x00000200,
VaryByContentEncoding = 0x00000400
}
public sealed class OutputCacheParameters
{
#pragma warning disable 0649
private SimpleBitVector32 _flags;
#pragma warning restore 0649
private bool _enabled = true;
private int _duration;
private OutputCacheLocation _location;
private string _varyByCustom;
private string _varyByParam;
private string _varyByContentEncoding;
private string _varyByHeader;
private bool _noStore;
private string _sqlDependency;
private string _varyByControl;
private string _cacheProfile;
public OutputCacheParameters()
{
}
internal bool IsParameterSet(OutputCacheParameter value)
{
return _flags[(int) value];
}
public bool Enabled
{
get {
return _enabled;
}
set {
_flags[(int) OutputCacheParameter.Enabled] = true;
_enabled = value;
}
}
public int Duration
{
get {
return _duration;
}
set {
_flags[(int) OutputCacheParameter.Duration] = true;
_duration = value;
}
}
public OutputCacheLocation Location
{
get {
return _location;
}
set {
_flags[(int) OutputCacheParameter.Location] = true;
_location = value;
}
}
public string VaryByCustom
{
get {
return _varyByCustom;
}
set {
_flags[(int) OutputCacheParameter.VaryByCustom] = true;
_varyByCustom = value;
}
}
public string VaryByParam
{
get {
return _varyByParam;
}
set {
_flags[(int) OutputCacheParameter.VaryByParam] = true;
_varyByParam = value;
}
}
public string VaryByContentEncoding
{
get {
return _varyByContentEncoding;
}
set {
_flags[(int) OutputCacheParameter.VaryByContentEncoding] = true;
_varyByContentEncoding = value;
}
}
public string VaryByHeader
{
get {
return _varyByHeader;
}
set {
_flags[(int) OutputCacheParameter.VaryByHeader] = true;
_varyByHeader = value;
}
}
public bool NoStore
{
get {
return _noStore;
}
set {
_flags[(int) OutputCacheParameter.NoStore] = true;
_noStore = value;
}
}
public string SqlDependency
{
get {
return _sqlDependency;
}
set {
_flags[(int) OutputCacheParameter.SqlDependency] = true;
_sqlDependency = value;
}
}
public string VaryByControl
{
get {
return _varyByControl;
}
set {
_flags[(int) OutputCacheParameter.VaryByControl] = true;
_varyByControl = value;
}
}
public string CacheProfile
{
get {
return _cacheProfile;
}
set {
_flags[(int) OutputCacheParameter.CacheProfile] = true;
_cacheProfile = value;
}
}
}
}
|