/
DataSourceCacheDurationConverter.xml
310 lines (291 loc) · 23.1 KB
/
DataSourceCacheDurationConverter.xml
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<Type Name="DataSourceCacheDurationConverter" FullName="System.Web.UI.DataSourceCacheDurationConverter">
<TypeSignature Language="C#" Value="public class DataSourceCacheDurationConverter : System.ComponentModel.Int32Converter" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DataSourceCacheDurationConverter extends System.ComponentModel.Int32Converter" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.DataSourceCacheDurationConverter" />
<TypeSignature Language="VB.NET" Value="Public Class DataSourceCacheDurationConverter
Inherits Int32Converter" />
<TypeSignature Language="F#" Value="type DataSourceCacheDurationConverter = class
 inherit Int32Converter" />
<TypeSignature Language="C++ CLI" Value="public ref class DataSourceCacheDurationConverter : System::ComponentModel::Int32Converter" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ComponentModel.Int32Converter</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides a type converter to convert 32-bit signed integer objects to and from data source control cache duration representations.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET data source controls that support caching typically provide a `CacheDuration` property that you can set to the number of seconds that the control caches data. The value 0 represents "Infinite" in these caching contexts, and the <xref:System.Web.UI.DataSourceCacheDurationConverter> class takes care of this explicit conversion.
Page developers do not use the <xref:System.Web.UI.DataSourceCacheDurationConverter> class. Control developers who are developing data source controls that support caching use this type converter along with the <xref:System.ComponentModel.TypeConverterAttribute> attribute to decorate a property that represents a cache duration setting of a custom data source control.
## Examples
The following code example demonstrates how you can decorate a property on a data source control that supports caching with a <xref:System.ComponentModel.TypeConverterAttribute> attribute. In this example, the data source control supports caching semantics and exposes three properties modeled after other ASP.NET data source controls: `EnableCaching`, `CacheDuration`, and `CacheExpirationPolicy`. The `CacheDuration` property uses the <xref:System.Web.UI.DataSourceCacheDurationConverter> type converter.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.DataSourceCacheDurationConverter/CS/somedatasourcecdc.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.DataSourceCacheDurationConverter/VB/somedatasourcecdc.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.SqlDataSource.CacheDuration" />
<altmember cref="P:System.Web.UI.WebControls.ObjectDataSource.CacheDuration" />
<altmember cref="P:System.Web.UI.WebControls.XmlDataSource.CacheDuration" />
<altmember cref="T:System.ComponentModel.Int32Converter" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DataSourceCacheDurationConverter ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 DataSourceCacheDurationConverter();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.DataSourceCacheDurationConverter" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CanConvertFrom">
<MemberSignature Language="C#" Value="public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext context, Type sourceType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool CanConvertFrom(class System.ComponentModel.ITypeDescriptorContext context, class System.Type sourceType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Type)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function CanConvertFrom (context As ITypeDescriptorContext, sourceType As Type) As Boolean" />
<MemberSignature Language="F#" Value="override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool" Usage="dataSourceCacheDurationConverter.CanConvertFrom (context, sourceType)" />
<MemberSignature Language="C++ CLI" Value="public:
 override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ sourceType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="sourceType" Type="System.Type" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<param name="sourceType">A <see cref="T:System.Type" /> that represents a type that the converter converts.</param>
<summary>Determines whether the <see cref="T:System.Web.UI.DataSourceCacheDurationConverter" /> can convert an object in the given source type to an <see cref="T:System.Int32" /> object.</summary>
<returns>
<see langword="true" /> if this converter can perform the operation; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter> class explicitly handles `string` types. Otherwise, it calls on its base class, <xref:System.ComponentModel.Int32Converter>, to make the determination.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CanConvertTo">
<MemberSignature Language="C#" Value="public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext context, Type destinationType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool CanConvertTo(class System.ComponentModel.ITypeDescriptorContext context, class System.Type destinationType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Type)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function CanConvertTo (context As ITypeDescriptorContext, destinationType As Type) As Boolean" />
<MemberSignature Language="F#" Value="override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool" Usage="dataSourceCacheDurationConverter.CanConvertTo (context, destinationType)" />
<MemberSignature Language="C++ CLI" Value="public:
 override bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ destinationType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="destinationType" Type="System.Type" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<param name="destinationType">A <see cref="T:System.Type" /> that represents the type to which you want to convert.</param>
<summary>Returns a value indicating whether the <see cref="T:System.Web.UI.DataSourceCacheDurationConverter" /> instance can convert an object to the given destination type.</summary>
<returns>
<see langword="true" /> if this converter can perform the operation; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter> explicitly handles conversion to `string` and <xref:System.ComponentModel.Design.Serialization.InstanceDescriptor> types. Otherwise, it calls on its base class, <xref:System.ComponentModel.Int32Converter>, to make the determination.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConvertFrom">
<MemberSignature Language="C#" Value="public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance object ConvertFrom(class System.ComponentModel.ITypeDescriptorContext context, class System.Globalization.CultureInfo culture, object value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ConvertFrom (context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As Object" />
<MemberSignature Language="F#" Value="override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj" Usage="dataSourceCacheDurationConverter.ConvertFrom (context, culture, value)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="culture" Type="System.Globalization.CultureInfo" />
<Parameter Name="value" Type="System.Object" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<param name="culture">A <see cref="T:System.Globalization.CultureInfo" /> that specifies the culture in which to represent the number.</param>
<param name="value">The object to convert.</param>
<summary>Converts the specified object to an <see cref="T:System.Int32" /> object.</summary>
<returns>An object that represents the converted value. If <see langword="null" /> is passed in the value parameter, <see langword="null" /> is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter.ConvertFrom%2A?displayProperty=nameWithType> method converts an <xref:System.String.Empty?displayProperty=nameWithType> string or the string "Infinite" to the value 0. Other values are handled by the base class, <xref:System.ComponentModel.Int32Converter>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConvertTo">
<MemberSignature Language="C#" Value="public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance object ConvertTo(class System.ComponentModel.ITypeDescriptorContext context, class System.Globalization.CultureInfo culture, object value, class System.Type destinationType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ConvertTo (context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object" />
<MemberSignature Language="F#" Value="override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -> obj" Usage="dataSourceCacheDurationConverter.ConvertTo (context, culture, value, destinationType)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value, Type ^ destinationType);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="culture" Type="System.Globalization.CultureInfo" />
<Parameter Name="value" Type="System.Object" />
<Parameter Name="destinationType" Type="System.Type" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<param name="culture">A <see cref="T:System.Globalization.CultureInfo" /> that specifies the culture in which to represent the number.</param>
<param name="value">The object to convert.</param>
<param name="destinationType">The type to convert the object to.</param>
<summary>Converts the specified object to another type.</summary>
<returns>An object that represents the converted value.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter.ConvertTo%28System.ComponentModel.ITypeDescriptorContext%2CSystem.Globalization.CultureInfo%2CSystem.Object%2CSystem.Type%29> method converts a valid value of 0 to the string "Infinite". Other values are handled by the base class, <xref:System.ComponentModel.Int32Converter>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetStandardValues">
<MemberSignature Language="C#" Value="public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues (System.ComponentModel.ITypeDescriptorContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.ComponentModel.TypeConverter/StandardValuesCollection GetStandardValues(class System.ComponentModel.ITypeDescriptorContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValues(System.ComponentModel.ITypeDescriptorContext)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetStandardValues (context As ITypeDescriptorContext) As TypeConverter.StandardValuesCollection" />
<MemberSignature Language="F#" Value="override this.GetStandardValues : System.ComponentModel.ITypeDescriptorContext -> System.ComponentModel.TypeConverter.StandardValuesCollection" Usage="dataSourceCacheDurationConverter.GetStandardValues context" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::ComponentModel::TypeConverter::StandardValuesCollection ^ GetStandardValues(System::ComponentModel::ITypeDescriptorContext ^ context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.TypeConverter+StandardValuesCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<summary>Returns a collection of standard values for the data type the <see cref="T:System.Web.UI.DataSourceCacheDurationConverter" /> instance is designed for.</summary>
<returns>A <see cref="T:System.ComponentModel.TypeConverter.StandardValuesCollection" /> that contains 0 for cache duration, which represents "Infinite".</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetStandardValuesExclusive">
<MemberSignature Language="C#" Value="public override bool GetStandardValuesExclusive (System.ComponentModel.ITypeDescriptorContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool GetStandardValuesExclusive(class System.ComponentModel.ITypeDescriptorContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetStandardValuesExclusive (context As ITypeDescriptorContext) As Boolean" />
<MemberSignature Language="F#" Value="override this.GetStandardValuesExclusive : System.ComponentModel.ITypeDescriptorContext -> bool" Usage="dataSourceCacheDurationConverter.GetStandardValuesExclusive context" />
<MemberSignature Language="C++ CLI" Value="public:
 override bool GetStandardValuesExclusive(System::ComponentModel::ITypeDescriptorContext ^ context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<summary>Specifies whether the collection of standard values returned from the <see cref="Overload:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValues" /> method is an exclusive list, using the specified context.</summary>
<returns>
<see langword="false" /> in all cases.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter> class always returns `false` to indicate that the <xref:System.ComponentModel.TypeConverter.StandardValuesCollection> collection returned from the <xref:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValues%2A> method is not an exhaustive list of possible values.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetStandardValuesSupported">
<MemberSignature Language="C#" Value="public override bool GetStandardValuesSupported (System.ComponentModel.ITypeDescriptorContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool GetStandardValuesSupported(class System.ComponentModel.ITypeDescriptorContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetStandardValuesSupported (context As ITypeDescriptorContext) As Boolean" />
<MemberSignature Language="F#" Value="override this.GetStandardValuesSupported : System.ComponentModel.ITypeDescriptorContext -> bool" Usage="dataSourceCacheDurationConverter.GetStandardValuesSupported context" />
<MemberSignature Language="C++ CLI" Value="public:
 override bool GetStandardValuesSupported(System::ComponentModel::ITypeDescriptorContext ^ context);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.ComponentModel.ITypeDescriptorContext" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context.</param>
<summary>Specifies whether the <see cref="T:System.Web.UI.DataSourceCacheDurationConverter" /> object supports a standard set of values that can be picked from a list, using the specified context.</summary>
<returns>
<see langword="true" /> in all cases.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.DataSourceCacheDurationConverter> object always returns `true` to indicate that the <xref:System.Web.UI.DataSourceCacheDurationConverter.GetStandardValues%2A> method should be called to find a common set of values the converter supports.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>