Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / InfiniteIntConverter.cs / 1305376 / InfiniteIntConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections; using System.IO; using System.Reflection; using System.Security.Permissions; using System.Xml; using System.Collections.Specialized; using System.Globalization; using System.ComponentModel; using System.Security; using System.Text; namespace System.Configuration { public sealed class InfiniteIntConverter : ConfigurationConverterBase { public override object ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type) { ValidateType(value, typeof(int)); if ((int)value == int.MaxValue) { return "Infinite"; } else { return ((int)value).ToString(CultureInfo.InvariantCulture); } } public override object ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, object data) { Debug.Assert(data is string, "data is string"); if ((string)data == "Infinite") { return int.MaxValue; } else { return Convert.ToInt32((string)data, 10); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IndexedDataBuffer.cs
- Roles.cs
- TaskFormBase.cs
- XPathNode.cs
- GeneralTransformCollection.cs
- ToolboxItem.cs
- RegexCompilationInfo.cs
- RegexWorker.cs
- HttpWebRequest.cs
- TheQuery.cs
- TemplatePropertyEntry.cs
- ObjectFullSpanRewriter.cs
- TextFormattingConverter.cs
- MouseCaptureWithinProperty.cs
- GenericIdentity.cs
- CalendarButtonAutomationPeer.cs
- CompiledELinqQueryState.cs
- DataGridViewCellFormattingEventArgs.cs
- InheritanceRules.cs
- ApplicationFileParser.cs
- LOSFormatter.cs
- pingexception.cs
- ClientTarget.cs
- SingleTagSectionHandler.cs
- JournalNavigationScope.cs
- HttpCookieCollection.cs
- DataGridTextBox.cs
- FontDriver.cs
- XmlSubtreeReader.cs
- ProjectionCamera.cs
- WebPartMenu.cs
- TextServicesCompartmentEventSink.cs
- CreateRefExpr.cs
- RequestCacheEntry.cs
- CookielessHelper.cs
- NavigationProgressEventArgs.cs
- Encoder.cs
- Vector3DConverter.cs
- XmlSchemaSimpleTypeList.cs
- MethodImplAttribute.cs
- ValidationEventArgs.cs
- ClientProxyGenerator.cs
- XmlAttributeCache.cs
- ApplicationSettingsBase.cs
- Int32RectValueSerializer.cs
- X500Name.cs
- VectorCollectionConverter.cs
- HtmlControl.cs
- TransformerTypeCollection.cs
- ForeignKeyConstraint.cs
- URIFormatException.cs
- ProfileGroupSettingsCollection.cs
- WindowsListViewGroup.cs
- BaseTreeIterator.cs
- Crc32Helper.cs
- ListControlActionList.cs
- InfoCardBaseException.cs
- _WinHttpWebProxyDataBuilder.cs
- ListChangedEventArgs.cs
- QualifiedId.cs
- ValueExpressions.cs
- DataObjectMethodAttribute.cs
- MsmqHostedTransportConfiguration.cs
- PolyQuadraticBezierSegment.cs
- OneToOneMappingSerializer.cs
- TreeNodeMouseHoverEvent.cs
- ConfigurationManagerInternalFactory.cs
- ISCIIEncoding.cs
- FocusWithinProperty.cs
- GeneralTransform.cs
- DateRangeEvent.cs
- Line.cs
- ControlIdConverter.cs
- CannotUnloadAppDomainException.cs
- CacheChildrenQuery.cs
- TreeChangeInfo.cs
- SchemaNamespaceManager.cs
- PaginationProgressEventArgs.cs
- Int16AnimationUsingKeyFrames.cs
- UIntPtr.cs
- Popup.cs
- EventRouteFactory.cs
- RPIdentityRequirement.cs
- WsdlImporterElementCollection.cs
- CodeMethodInvokeExpression.cs
- BufferedOutputAsyncStream.cs
- ProtocolsConfiguration.cs
- ListManagerBindingsCollection.cs
- basevalidator.cs
- DataBoundControlDesigner.cs
- FlowNode.cs
- StructuredTypeEmitter.cs
- PasswordRecovery.cs
- ExpressionConverter.cs
- BindingExpressionBase.cs
- TextContainerHelper.cs
- XComponentModel.cs
- WinEventTracker.cs
- WSHttpTransportSecurityElement.cs
- BitmapEffectDrawingContextState.cs