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
- SqlFlattener.cs
- DivideByZeroException.cs
- XmlValidatingReader.cs
- PropertyStore.cs
- ButtonField.cs
- DocumentPageViewAutomationPeer.cs
- WebPartDisplayModeCancelEventArgs.cs
- StrongName.cs
- __Filters.cs
- PenLineJoinValidation.cs
- RootNamespaceAttribute.cs
- PersonalizationState.cs
- cookiecollection.cs
- AttributeData.cs
- ViewLoader.cs
- TextSchema.cs
- SystemIPInterfaceStatistics.cs
- DescendentsWalker.cs
- PositiveTimeSpanValidatorAttribute.cs
- TypedTableBaseExtensions.cs
- Validator.cs
- UIElementAutomationPeer.cs
- CreateUserWizard.cs
- Utility.cs
- ItemContainerGenerator.cs
- LinqDataSourceUpdateEventArgs.cs
- MyContact.cs
- FrameSecurityDescriptor.cs
- DataGridItem.cs
- OdbcErrorCollection.cs
- unsafenativemethodsother.cs
- DecoderReplacementFallback.cs
- ClientTargetSection.cs
- EmissiveMaterial.cs
- handlecollector.cs
- LocatorGroup.cs
- ThreadStaticAttribute.cs
- DynamicQueryableWrapper.cs
- Vector3DConverter.cs
- XsdBuildProvider.cs
- FieldToken.cs
- XamlRtfConverter.cs
- DataContractSerializerSection.cs
- EventLogSession.cs
- ImplicitInputBrush.cs
- sortedlist.cs
- XmlSchemaCompilationSettings.cs
- XmlDataSourceView.cs
- NameNode.cs
- SafeReversePInvokeHandle.cs
- XmlNamespaceMappingCollection.cs
- DesignUtil.cs
- StaticResourceExtension.cs
- DataControlLinkButton.cs
- CmsInterop.cs
- EntityDesignerBuildProvider.cs
- HttpResponse.cs
- DataGridViewButtonCell.cs
- Deflater.cs
- SharedMemory.cs
- SocketStream.cs
- _ConnectStream.cs
- StreamSecurityUpgradeAcceptorBase.cs
- PersonalizablePropertyEntry.cs
- WebPartPersonalization.cs
- ViewUtilities.cs
- TextParagraphCache.cs
- FrameworkReadOnlyPropertyMetadata.cs
- RepeaterItem.cs
- GeometryCollection.cs
- ToolStripDropDownItem.cs
- ConfigXmlWhitespace.cs
- Addressing.cs
- GraphicsContainer.cs
- _LocalDataStoreMgr.cs
- ResourcesChangeInfo.cs
- ElementNotEnabledException.cs
- NavigationHelper.cs
- DataFormat.cs
- MethodExpr.cs
- CompilerState.cs
- SkipQueryOptionExpression.cs
- CapabilitiesSection.cs
- ResolvedKeyFrameEntry.cs
- VBIdentifierTrimConverter.cs
- InputElement.cs
- Pair.cs
- BuildProviderAppliesToAttribute.cs
- XmlDomTextWriter.cs
- HtmlInputPassword.cs
- DataGridColumnHeader.cs
- TokenBasedSetEnumerator.cs
- TypeKeyValue.cs
- InputReportEventArgs.cs
- HttpConfigurationContext.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- PathFigure.cs
- InputScopeNameConverter.cs
- SourceExpressionException.cs
- XmlConvert.cs