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
- AudioStateChangedEventArgs.cs
- KnownTypeDataContractResolver.cs
- EntityWithKeyStrategy.cs
- TextTreeDeleteContentUndoUnit.cs
- X509WindowsSecurityToken.cs
- datacache.cs
- ScrollPattern.cs
- PipeSecurity.cs
- ActivityAction.cs
- DataBindingValueUIHandler.cs
- NativeBuffer.cs
- DefaultWorkflowSchedulerService.cs
- TraceSection.cs
- Vector3DValueSerializer.cs
- StrokeCollection.cs
- CommandField.cs
- ExtensionFile.cs
- RuntimeHelpers.cs
- HttpAsyncResult.cs
- BaseDataList.cs
- DoubleAnimationClockResource.cs
- ListParagraph.cs
- PermissionSetEnumerator.cs
- XmlNode.cs
- Latin1Encoding.cs
- XmlSchemaChoice.cs
- PassportAuthenticationEventArgs.cs
- DatagridviewDisplayedBandsData.cs
- TextRenderer.cs
- ScriptDescriptor.cs
- RegexRunnerFactory.cs
- GetPolicyDetailsRequest.cs
- OracleConnectionFactory.cs
- SqlDataAdapter.cs
- DebugHandleTracker.cs
- JavaScriptString.cs
- XmlWrappingReader.cs
- XmlNamedNodeMap.cs
- _CommandStream.cs
- DataControlImageButton.cs
- CodeSnippetCompileUnit.cs
- ViewValidator.cs
- PKCS1MaskGenerationMethod.cs
- Nullable.cs
- XmlSequenceWriter.cs
- ColorDialog.cs
- SqlUtil.cs
- CodeRegionDirective.cs
- GeneralTransformGroup.cs
- GeometryModel3D.cs
- TypeUtil.cs
- LowerCaseStringConverter.cs
- LocatorBase.cs
- XPathNodeList.cs
- MatrixAnimationBase.cs
- SqlProfileProvider.cs
- NativeCompoundFileAPIs.cs
- StreamingContext.cs
- ToolStripGrip.cs
- BinHexDecoder.cs
- FormatSettings.cs
- NavigatorInput.cs
- SessionStateSection.cs
- NTAccount.cs
- MenuItemCollection.cs
- ColumnTypeConverter.cs
- SchemaLookupTable.cs
- EntryWrittenEventArgs.cs
- InternalSafeNativeMethods.cs
- ModuleBuilderData.cs
- TransformGroup.cs
- FormViewPagerRow.cs
- ZoneMembershipCondition.cs
- WsdlHelpGeneratorElement.cs
- WebPartCatalogAddVerb.cs
- MaskedTextProvider.cs
- XPathNode.cs
- TabItemAutomationPeer.cs
- _NTAuthentication.cs
- TypeConverterValueSerializer.cs
- MessageSecurityOverHttpElement.cs
- ContainerActivationHelper.cs
- TextParagraph.cs
- ZipFileInfoCollection.cs
- RequestCachePolicy.cs
- ValueType.cs
- ClientApiGenerator.cs
- ConditionValidator.cs
- xmlglyphRunInfo.cs
- ObjectViewQueryResultData.cs
- MembershipSection.cs
- SspiHelper.cs
- NCryptSafeHandles.cs
- IteratorFilter.cs
- RuleProcessor.cs
- _FtpDataStream.cs
- IISUnsafeMethods.cs
- ConversionContext.cs
- prefixendpointaddressmessagefiltertable.cs
- XmlNodeChangedEventManager.cs