Permalink
Fetching contributors…
Cannot retrieve contributors at this time
205 lines (178 sloc) 12.3 KB
<Type Name="TimeSpanMinutesConverter" FullName="System.Configuration.TimeSpanMinutesConverter">
<TypeSignature Language="C#" Value="public class TimeSpanMinutesConverter : System.Configuration.ConfigurationConverterBase" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit TimeSpanMinutesConverter extends System.Configuration.ConfigurationConverterBase" />
<TypeSignature Language="DocId" Value="T:System.Configuration.TimeSpanMinutesConverter" />
<TypeSignature Language="VB.NET" Value="Public Class TimeSpanMinutesConverter&#xA;Inherits ConfigurationConverterBase" />
<TypeSignature Language="C++ CLI" Value="public ref class TimeSpanMinutesConverter : System::Configuration::ConfigurationConverterBase" />
<TypeSignature Language="F#" Value="type TimeSpanMinutesConverter = class&#xA; inherit ConfigurationConverterBase" />
<AssemblyInfo>
<AssemblyName>System.Configuration</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Configuration.ConfigurationConverterBase</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Converts a time span expressed in minutes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This type, like all the other configuration converter types, converts strings found in the configuration file to and from the related strongly typed properties.
In particular, the <xref:System.Configuration.TimeSpanMinutesConverter> converts <xref:System.String> minutes, assigned to a configuration property, to <xref:System.TimeSpan> minutes and vice versa.
The <xref:System.Configuration.TimeSpanMinutesConverter> persists values of type `long` representing a number of minutes.
## Examples
The following code example shows how to define a custom <xref:System.Configuration.TimeSpanMinutesConverter> type.
[!code-csharp[System.Configuration.TimeSpanMinutesConverter#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs#1)]
[!code-vb[System.Configuration.TimeSpanMinutesConverter#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb#1)]
The following is a configuration excerpt used by the previous example.
```xml
<configuration>
<configSections>
<section name="CustomSection"
type="Samples.AspNet.CustomSection,
ConfigurationConverters,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null"
allowDefinition="Everywhere"
allowExeDefinition="MachineToApplication"
restartOnExternalChanges="true" />
</configSections>
<CustomSection fileName="default.txt" maxIdleTime="90"
timeDelay="infinite" cdStr="str0, str1" permission="Read"
maxUsers="Infinite"/>
</configuration>
```
]]></format>
</remarks>
<altmember cref="T:System.Configuration.GenericEnumConverter" />
<altmember cref="T:System.Configuration.InfiniteIntConverter" />
<altmember cref="T:System.Configuration.InfiniteTimeSpanConverter" />
<altmember cref="T:System.Configuration.TimeSpanMinutesOrInfiniteConverter" />
<altmember cref="T:System.Configuration.TimeSpanSecondsConverter" />
<altmember cref="T:System.Configuration.TimeSpanSecondsOrInfiniteConverter" />
<altmember cref="T:System.Configuration.TypeNameConverter" />
<altmember cref="T:System.Configuration.WhiteSpaceTrimStringConverter" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TimeSpanMinutesConverter ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Configuration.TimeSpanMinutesConverter.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; TimeSpanMinutesConverter();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Configuration</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Configuration.TimeSpanMinutesConverter" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Normally, you use the converter types provided by the system. The only time you need to use the <xref:System.Configuration.TimeSpanMinutesConverter.%23ctor%2A> constructor is when you create your own conversion type.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConvertFrom">
<MemberSignature Language="C#" Value="public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext ctx, System.Globalization.CultureInfo ci, object data);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance object ConvertFrom(class System.ComponentModel.ITypeDescriptorContext ctx, class System.Globalization.CultureInfo ci, object data) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Configuration.TimeSpanMinutesConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ConvertFrom (ctx As ITypeDescriptorContext, ci As CultureInfo, data As Object) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ ctx, System::Globalization::CultureInfo ^ ci, System::Object ^ data);" />
<MemberSignature Language="F#" Value="abstract member ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -&gt; obj&#xA;override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -&gt; obj" Usage="timeSpanMinutesConverter.ConvertFrom (ctx, ci, data)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Configuration</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ctx" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="ci" Type="System.Globalization.CultureInfo" />
<Parameter Name="data" Type="System.Object" />
</Parameters>
<Docs>
<param name="ctx">The <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> object used for type conversions.</param>
<param name="ci">The <see cref="T:System.Globalization.CultureInfo" /> object used during conversion.</param>
<param name="data">The <see cref="T:System.String" /> object to convert.</param>
<summary>Converts a <see cref="T:System.String" /> to a <see cref="T:System.TimeSpan" />.</summary>
<returns>The <see cref="T:System.TimeSpan" /> representing the <paramref name="data" /> parameter in minutes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The system uses the <xref:System.Configuration.TimeSpanMinutesConverter.ConvertFrom%2A> method when reading from a configuration file to convert a <xref:System.String> value to <xref:System.TimeSpan>.
## Examples
The following code example shows how to customize the <xref:System.Configuration.TimeSpanMinutesConverter.ConvertFrom%2A> method.
[!code-csharp[System.Configuration.TimeSpanMinutesConverter#5](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs#5)]
[!code-vb[System.Configuration.TimeSpanMinutesConverter#5](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb#5)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConvertTo">
<MemberSignature Language="C#" Value="public override object ConvertTo (System.ComponentModel.ITypeDescriptorContext ctx, System.Globalization.CultureInfo ci, object value, Type type);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance object ConvertTo(class System.ComponentModel.ITypeDescriptorContext ctx, class System.Globalization.CultureInfo ci, object value, class System.Type type) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Configuration.TimeSpanMinutesConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Object ^ ConvertTo(System::ComponentModel::ITypeDescriptorContext ^ ctx, System::Globalization::CultureInfo ^ ci, System::Object ^ value, Type ^ type);" />
<MemberSignature Language="F#" Value="abstract member ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -&gt; obj&#xA;override this.ConvertTo : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj * Type -&gt; obj" Usage="timeSpanMinutesConverter.ConvertTo (ctx, ci, value, type)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Configuration</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Configuration.ConfigurationManager</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="ctx" Type="System.ComponentModel.ITypeDescriptorContext" />
<Parameter Name="ci" Type="System.Globalization.CultureInfo" />
<Parameter Name="value" Type="System.Object" />
<Parameter Name="type" Type="System.Type" />
</Parameters>
<Docs>
<param name="ctx">The <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> object used for type conversions.</param>
<param name="ci">The <see cref="T:System.Globalization.CultureInfo" /> object used during conversion.</param>
<param name="value">The value to convert to.</param>
<param name="type">The type to convert to.</param>
<summary>Converts a <see cref="T:System.TimeSpan" /> to a <see cref="T:System.String" />.</summary>
<returns>The <see cref="T:System.String" /> representing the <paramref name="value" /> parameter in minutes.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The system uses the <xref:System.Configuration.TimeSpanMinutesConverter.ConvertTo%2A> method when writing to a configuration file to convert a <xref:System.TimeSpan> to a <xref:System.String>.
## Examples
The following code example shows how to customize the <xref:System.Configuration.TimeSpanMinutesConverter.ConvertTo%2A> method.
[!code-csharp[System.Configuration.TimeSpanMinutesConverter#4](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs#4)]
[!code-vb[System.Configuration.TimeSpanMinutesConverter#4](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb#4)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>