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
- QilUnary.cs
- SqlParameterizer.cs
- JournalNavigationScope.cs
- ActivityValidator.cs
- AccessDataSourceView.cs
- MultitargetingHelpers.cs
- EdmConstants.cs
- KeyBinding.cs
- WebProxyScriptElement.cs
- FixedPage.cs
- HelpKeywordAttribute.cs
- CodeDOMProvider.cs
- SystemResourceKey.cs
- FileChangesMonitor.cs
- DoubleLinkListEnumerator.cs
- TableParaClient.cs
- ParseChildrenAsPropertiesAttribute.cs
- MutexSecurity.cs
- XmlSchemaSimpleContentRestriction.cs
- QilFunction.cs
- PlatformNotSupportedException.cs
- DataControlCommands.cs
- DecimalFormatter.cs
- TextRenderer.cs
- DirectoryObjectSecurity.cs
- IIS7UserPrincipal.cs
- ProcessThread.cs
- ScriptingAuthenticationServiceSection.cs
- PartitionedStream.cs
- LineBreakRecord.cs
- CompilerHelpers.cs
- RegisteredHiddenField.cs
- TreeViewImageIndexConverter.cs
- DataKey.cs
- METAHEADER.cs
- HtmlSelect.cs
- InstanceDescriptor.cs
- HttpCacheVaryByContentEncodings.cs
- AtomicFile.cs
- TypeSystem.cs
- AnnotationService.cs
- AnnotationService.cs
- PrintDialogException.cs
- XPathPatternParser.cs
- KerberosRequestorSecurityToken.cs
- BitmapEffectCollection.cs
- RoleManagerSection.cs
- COAUTHIDENTITY.cs
- RNGCryptoServiceProvider.cs
- CoreSwitches.cs
- ConfigXmlWhitespace.cs
- Tuple.cs
- SkewTransform.cs
- SqlDataSourceConfigureSelectPanel.cs
- UIElement3DAutomationPeer.cs
- ApplicationManager.cs
- NameHandler.cs
- ProxyManager.cs
- GridViewCommandEventArgs.cs
- OLEDB_Enum.cs
- EntitySet.cs
- MemoryRecordBuffer.cs
- DataExpression.cs
- Attachment.cs
- FileUtil.cs
- MSAAWinEventWrap.cs
- HttpContextBase.cs
- ValidationEventArgs.cs
- CanExecuteRoutedEventArgs.cs
- UnmanagedMarshal.cs
- DataSourceDesigner.cs
- WebContext.cs
- MultiByteCodec.cs
- Int32Storage.cs
- DiscardableAttribute.cs
- MsmqTransportSecurityElement.cs
- SqlDataSourceStatusEventArgs.cs
- ImageListStreamer.cs
- ResXResourceSet.cs
- InstanceCompleteException.cs
- ViewKeyConstraint.cs
- FilterQuery.cs
- SelectionList.cs
- TreeNodeClickEventArgs.cs
- _ChunkParse.cs
- BitmapPalette.cs
- RenderOptions.cs
- ConsoleKeyInfo.cs
- RegionInfo.cs
- OleDbDataAdapter.cs
- DataRelationCollection.cs
- EncoderParameters.cs
- HtmlTable.cs
- MyContact.cs
- EndGetFileNameFromUserRequest.cs
- AuthenticationException.cs
- ReflectEventDescriptor.cs
- ContractUtils.cs
- StylusTouchDevice.cs
- AmbientValueAttribute.cs