Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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); } } } // 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
- SponsorHelper.cs
- DefaultValidator.cs
- AssemblyBuilderData.cs
- DbProviderConfigurationHandler.cs
- ValueSerializer.cs
- XmlSerializerNamespaces.cs
- NativeMethods.cs
- SetIterators.cs
- AnnotationDocumentPaginator.cs
- OleDbConnectionFactory.cs
- ListViewContainer.cs
- FormViewUpdateEventArgs.cs
- safesecurityhelperavalon.cs
- SessionStateItemCollection.cs
- StoreItemCollection.Loader.cs
- SQLBinary.cs
- CorrelationTokenInvalidatedHandler.cs
- TypeLoadException.cs
- ByteAnimationUsingKeyFrames.cs
- ECDsaCng.cs
- CanExpandCollapseAllConverter.cs
- DynamicActivity.cs
- VirtualizingStackPanel.cs
- StrokeNodeData.cs
- ColorAnimation.cs
- SystemIcmpV6Statistics.cs
- ScriptDescriptor.cs
- PersonalizationProviderHelper.cs
- MultiView.cs
- ServiceBusyException.cs
- _KerberosClient.cs
- GrammarBuilderRuleRef.cs
- RegistryKey.cs
- VSWCFServiceContractGenerator.cs
- AsymmetricAlgorithm.cs
- ParserOptions.cs
- DataObjectCopyingEventArgs.cs
- Configuration.cs
- ConfigXmlWhitespace.cs
- CursorInteropHelper.cs
- XmlSchemaObject.cs
- IndependentAnimationStorage.cs
- EmptyReadOnlyDictionaryInternal.cs
- TimelineCollection.cs
- WebPartDisplayModeCollection.cs
- RootProfilePropertySettingsCollection.cs
- ObjectStateFormatter.cs
- _SSPISessionCache.cs
- ConnectionInterfaceCollection.cs
- UserControlBuildProvider.cs
- StringValidator.cs
- TextServicesCompartmentContext.cs
- SafeLocalMemHandle.cs
- Transaction.cs
- ToolStrip.cs
- ReflectionHelper.cs
- ListenerAdapterBase.cs
- PenThreadWorker.cs
- BasicExpressionVisitor.cs
- ActivityExecutionContext.cs
- LiteralTextParser.cs
- ListControl.cs
- DataGridViewSelectedCellCollection.cs
- AnyAllSearchOperator.cs
- PageHandlerFactory.cs
- FieldTemplateFactory.cs
- XmlCharCheckingReader.cs
- AccessedThroughPropertyAttribute.cs
- StreamGeometry.cs
- ImportRequest.cs
- RangeContentEnumerator.cs
- CharacterBufferReference.cs
- WebPart.cs
- SqlInternalConnectionSmi.cs
- XmlReaderSettings.cs
- KnownIds.cs
- VersionedStreamOwner.cs
- PageWrapper.cs
- ListViewGroupConverter.cs
- LicFileLicenseProvider.cs
- FlowPosition.cs
- BoolLiteral.cs
- WpfWebRequestHelper.cs
- RichTextBox.cs
- ConfigsHelper.cs
- WindowAutomationPeer.cs
- CacheEntry.cs
- WinEventWrap.cs
- ContentDefinition.cs
- EntityDataSourceChangingEventArgs.cs
- NativeCppClassAttribute.cs
- ProxyWebPartManager.cs
- PermissionAttributes.cs
- ReferencedCollectionType.cs
- DelayedRegex.cs
- EntityTypeEmitter.cs
- SystemResourceKey.cs
- PerformanceCounterPermissionEntry.cs
- PartialClassGenerationTaskInternal.cs
- ValuePattern.cs