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
- SelectedGridItemChangedEvent.cs
- EntityDataSourceStatementEditorForm.cs
- Schema.cs
- RSAPKCS1SignatureFormatter.cs
- EnterpriseServicesHelper.cs
- HttpResponse.cs
- AttachedPropertyMethodSelector.cs
- ReflectionUtil.cs
- ACE.cs
- QueryContinueDragEventArgs.cs
- HtmlEncodedRawTextWriter.cs
- GraphicsPathIterator.cs
- SchemaLookupTable.cs
- ListBindingHelper.cs
- MDIControlStrip.cs
- TabControlCancelEvent.cs
- FileIOPermission.cs
- XmlBindingWorker.cs
- SafeNativeMethods.cs
- ElementNotEnabledException.cs
- IndentedWriter.cs
- XsdCachingReader.cs
- ZoneButton.cs
- PerformanceCountersElement.cs
- SecurityUtils.cs
- PropertyReferenceSerializer.cs
- InstanceDataCollection.cs
- ValidationVisibilityAttribute.cs
- handlecollector.cs
- CompModSwitches.cs
- WebServiceHandlerFactory.cs
- SqlNamer.cs
- ExternalFile.cs
- SignatureTargetIdManager.cs
- SqlBulkCopy.cs
- DEREncoding.cs
- ArglessEventHandlerProxy.cs
- MetadataItemSerializer.cs
- CollectionViewGroup.cs
- AssemblyCache.cs
- Tuple.cs
- DataRecordObjectView.cs
- AspCompat.cs
- OdbcException.cs
- DBAsyncResult.cs
- SystemIcons.cs
- _UriTypeConverter.cs
- StrokeDescriptor.cs
- SystemPens.cs
- CalendarDateChangedEventArgs.cs
- _DigestClient.cs
- PenContexts.cs
- ProcessHost.cs
- PageClientProxyGenerator.cs
- WindowManager.cs
- WebAdminConfigurationHelper.cs
- SHA1.cs
- Graphics.cs
- RowsCopiedEventArgs.cs
- TransformDescriptor.cs
- BlurBitmapEffect.cs
- CodeDomSerializerException.cs
- SectionUpdates.cs
- InternalControlCollection.cs
- TextBoxDesigner.cs
- TreeView.cs
- HandleTable.cs
- StringExpressionSet.cs
- XmlNullResolver.cs
- DataGridTable.cs
- AccessibleObject.cs
- Msec.cs
- HostedElements.cs
- XmlRootAttribute.cs
- XPathDocumentBuilder.cs
- TdsParserSessionPool.cs
- DataSourceView.cs
- LicenseManager.cs
- GridViewRowCollection.cs
- ILGenerator.cs
- AccessDataSource.cs
- XmlEntityReference.cs
- SyndicationSerializer.cs
- TreeViewAutomationPeer.cs
- BaseCodeDomTreeGenerator.cs
- RuntimeIdentifierPropertyAttribute.cs
- OdbcConnectionHandle.cs
- StreamInfo.cs
- SerialErrors.cs
- AssemblyBuilder.cs
- SuppressMergeCheckAttribute.cs
- CodeGeneratorOptions.cs
- DynamicDataResources.Designer.cs
- IDispatchConstantAttribute.cs
- DodSequenceMerge.cs
- CompleteWizardStep.cs
- ListViewCommandEventArgs.cs
- NativeActivityMetadata.cs
- HitTestParameters3D.cs
- HwndStylusInputProvider.cs