Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / DoubleConverter.cs / 1 / DoubleConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Runtime.Remoting; using System.Runtime.Serialization.Formatters; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class DoubleConverter : BaseNumberConverter { ///Provides a type /// converter to convert double-precision, floating point number objects to and from various /// other representations. ////// Determines whether this editor will attempt to convert hex (0x or #) strings /// internal override bool AllowHex { get { return false; } } ////// The Type this converter is targeting (e.g. Int16, UInt32, etc.) /// internal override Type TargetType { get { return typeof(Double); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToDouble(value, CultureInfo.CurrentCulture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Double.Parse(value, NumberStyles.Float, formatInfo); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return Double.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Double)value).ToString("R", formatInfo); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ShaperBuffers.cs
- CryptoKeySecurity.cs
- GCHandleCookieTable.cs
- EventListener.cs
- GridItemProviderWrapper.cs
- ComponentDispatcher.cs
- BaseParagraph.cs
- sqlnorm.cs
- SystemNetworkInterface.cs
- Root.cs
- CommandSet.cs
- SemanticKeyElement.cs
- messageonlyhwndwrapper.cs
- CalloutQueueItem.cs
- TextViewSelectionProcessor.cs
- MaterialGroup.cs
- CodeRegionDirective.cs
- Blend.cs
- ProfilePropertySettingsCollection.cs
- ApplicationId.cs
- WebPartEditVerb.cs
- X509CertificateCollection.cs
- TextReader.cs
- PocoPropertyAccessorStrategy.cs
- InsufficientMemoryException.cs
- dataprotectionpermission.cs
- TypeBuilder.cs
- X509Certificate2Collection.cs
- Attributes.cs
- ByteAnimationBase.cs
- CallbackCorrelationInitializer.cs
- CompositeKey.cs
- IImplicitResourceProvider.cs
- PropertyMetadata.cs
- UniqueEventHelper.cs
- XmlDocumentSchema.cs
- ToolStripArrowRenderEventArgs.cs
- ListBoxItemWrapperAutomationPeer.cs
- SymbolType.cs
- DocumentViewerAutomationPeer.cs
- HwndStylusInputProvider.cs
- DbConnectionHelper.cs
- SafeViewOfFileHandle.cs
- DbDataAdapter.cs
- WebPartHelpVerb.cs
- SqlStream.cs
- DataObjectCopyingEventArgs.cs
- RegexStringValidator.cs
- Dynamic.cs
- JsonObjectDataContract.cs
- DefaultValueTypeConverter.cs
- PerspectiveCamera.cs
- Table.cs
- ValueCollectionParameterReader.cs
- GeometryDrawing.cs
- SortKey.cs
- ValueConversionAttribute.cs
- GlyphRunDrawing.cs
- RectIndependentAnimationStorage.cs
- UInt32Storage.cs
- TdsParserStateObject.cs
- ProvidePropertyAttribute.cs
- relpropertyhelper.cs
- InvalidFilterCriteriaException.cs
- figurelengthconverter.cs
- Common.cs
- HTTPNotFoundHandler.cs
- XmlCharType.cs
- ToolboxItemFilterAttribute.cs
- UIPermission.cs
- EventQueueState.cs
- ObjectKeyFrameCollection.cs
- TextDpi.cs
- ObjectDataSourceMethodEventArgs.cs
- ConfigurationCollectionAttribute.cs
- ManagementPath.cs
- SerializableAuthorizationContext.cs
- DelegateBodyWriter.cs
- DocumentXPathNavigator.cs
- RemoteHelper.cs
- XmlDictionary.cs
- DataGridViewUtilities.cs
- EventEntry.cs
- WebEventCodes.cs
- CodeArrayIndexerExpression.cs
- GridViewRowPresenter.cs
- FormatException.cs
- SerializationObjectManager.cs
- MapPathBasedVirtualPathProvider.cs
- Util.cs
- Tool.cs
- CompilerWrapper.cs
- Pair.cs
- WriterOutput.cs
- SqlConnectionStringBuilder.cs
- IntegerValidatorAttribute.cs
- OutputCacheProfile.cs
- ObjectDataSource.cs
- LocatorManager.cs
- WindowsToolbarAsMenu.cs