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
- BuilderInfo.cs
- SHA512.cs
- HitTestParameters3D.cs
- ConcurrentDictionary.cs
- XmlSchemaComplexType.cs
- OracleNumber.cs
- NameObjectCollectionBase.cs
- PropertyGeneratedEventArgs.cs
- ToolboxItem.cs
- StringValidatorAttribute.cs
- SvcFileManager.cs
- DivideByZeroException.cs
- InvalidPrinterException.cs
- DataPointer.cs
- BindingSource.cs
- ProgressBarAutomationPeer.cs
- GenericsInstances.cs
- DateTimeParse.cs
- DataSourceControl.cs
- LoginName.cs
- ProxyWebPartConnectionCollection.cs
- SplineKeyFrames.cs
- BuildManager.cs
- ContextStaticAttribute.cs
- TemplateField.cs
- TransformationRules.cs
- IDQuery.cs
- List.cs
- NegotiationTokenAuthenticatorState.cs
- TextFindEngine.cs
- DispatchChannelSink.cs
- FontWeights.cs
- StringFreezingAttribute.cs
- Debugger.cs
- OperationAbortedException.cs
- SqlGatherConsumedAliases.cs
- XmlCollation.cs
- HttpBufferlessInputStream.cs
- DialogResultConverter.cs
- VideoDrawing.cs
- VarRefManager.cs
- NodeInfo.cs
- PassportIdentity.cs
- SystemColorTracker.cs
- XmlSerializationReader.cs
- ProgressChangedEventArgs.cs
- DataGridItem.cs
- IsolatedStorage.cs
- ActiveXContainer.cs
- DataGridViewAutoSizeModeEventArgs.cs
- QilStrConcat.cs
- DefaultProfileManager.cs
- HashAlgorithm.cs
- ToolbarAUtomationPeer.cs
- SafeNativeMethodsCLR.cs
- BuildDependencySet.cs
- PropertyNames.cs
- XmlSchemaComplexContentExtension.cs
- FlowchartSizeFeature.cs
- Optimizer.cs
- XmlAttributeCollection.cs
- FormsAuthenticationUser.cs
- CategoryAttribute.cs
- ServiceOperationInfoTypeConverter.cs
- DebuggerAttributes.cs
- XmlElementList.cs
- View.cs
- XmlnsCache.cs
- PathGradientBrush.cs
- SizeLimitedCache.cs
- ApplicationGesture.cs
- StreamWriter.cs
- ProcessHostConfigUtils.cs
- QuaternionKeyFrameCollection.cs
- PageVisual.cs
- LateBoundBitmapDecoder.cs
- ProgressBarRenderer.cs
- ParamArrayAttribute.cs
- SystemWebSectionGroup.cs
- SerializableAttribute.cs
- WindowsAuthenticationModule.cs
- TouchEventArgs.cs
- CriticalExceptions.cs
- DataGridViewTextBoxCell.cs
- ReceiveMessageRecord.cs
- MouseCaptureWithinProperty.cs
- SingleAnimation.cs
- CodeSubDirectoriesCollection.cs
- TextTreeExtractElementUndoUnit.cs
- clipboard.cs
- ConfigPathUtility.cs
- WebPartCollection.cs
- RegexReplacement.cs
- CheckBoxList.cs
- NameTable.cs
- DrawingAttributesDefaultValueFactory.cs
- MsmqIntegrationInputChannel.cs
- FontFamilyConverter.cs
- BasicHttpBinding.cs
- GridEntryCollection.cs