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
- RtfControlWordInfo.cs
- HierarchicalDataSourceDesigner.cs
- XmlEncodedRawTextWriter.cs
- FontUnitConverter.cs
- XmlRawWriter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DefaultSettingsSection.cs
- RequestStatusBarUpdateEventArgs.cs
- TransformPattern.cs
- Inline.cs
- ThreadStartException.cs
- CodeConditionStatement.cs
- prompt.cs
- ColumnTypeConverter.cs
- SignatureHelper.cs
- PropertyValueChangedEvent.cs
- FilteredSchemaElementLookUpTable.cs
- CustomCategoryAttribute.cs
- ControlBuilderAttribute.cs
- ScopedKnownTypes.cs
- DataGridViewTopRowAccessibleObject.cs
- InheritanceService.cs
- Token.cs
- ContextMenuService.cs
- GlyphElement.cs
- SymLanguageType.cs
- DecimalAnimationUsingKeyFrames.cs
- SynchronizationHandlesCodeDomSerializer.cs
- HttpPostedFile.cs
- EntityContainerAssociationSet.cs
- DisplayNameAttribute.cs
- BevelBitmapEffect.cs
- SizeIndependentAnimationStorage.cs
- SQLUtility.cs
- TaskFileService.cs
- CryptoStream.cs
- SelectionItemProviderWrapper.cs
- BrowserCapabilitiesFactory.cs
- Setter.cs
- ScriptHandlerFactory.cs
- PeerResolverSettings.cs
- PreviewPrintController.cs
- SoapProtocolImporter.cs
- BitmapEffectDrawing.cs
- TextLineBreak.cs
- SpecialNameAttribute.cs
- DataGridItemCollection.cs
- GroupStyle.cs
- CodeObject.cs
- safelinkcollection.cs
- CodeMethodMap.cs
- SqlRowUpdatingEvent.cs
- EventSinkHelperWriter.cs
- HitTestResult.cs
- CannotUnloadAppDomainException.cs
- TypedDataSourceCodeGenerator.cs
- DeferredElementTreeState.cs
- HtmlTableCellCollection.cs
- RegexReplacement.cs
- Duration.cs
- DSASignatureDeformatter.cs
- SqlNamer.cs
- QuaternionAnimationUsingKeyFrames.cs
- HostingPreferredMapPath.cs
- PageSetupDialog.cs
- Size3DConverter.cs
- ButtonFlatAdapter.cs
- Attributes.cs
- ColumnResult.cs
- Types.cs
- ScriptResourceInfo.cs
- MonikerHelper.cs
- KeyedPriorityQueue.cs
- EncodingStreamWrapper.cs
- ComContractElement.cs
- ReversePositionQuery.cs
- UnsafeNetInfoNativeMethods.cs
- WsatServiceCertificate.cs
- OleDbConnection.cs
- XmlSchemaSubstitutionGroup.cs
- XmlMtomWriter.cs
- CssTextWriter.cs
- GenericAuthenticationEventArgs.cs
- CompilerWrapper.cs
- XamlStackWriter.cs
- DoubleAnimationUsingKeyFrames.cs
- BindToObject.cs
- xml.cs
- AcceleratedTokenAuthenticator.cs
- PassportPrincipal.cs
- ParserExtension.cs
- MsiStyleLogWriter.cs
- ReflectionTypeLoadException.cs
- BatchStream.cs
- WebPartManager.cs
- ApplyTemplatesAction.cs
- FullTextLine.cs
- FieldCollectionEditor.cs
- AppDomainUnloadedException.cs
- FileSecurity.cs