Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- RequestStatusBarUpdateEventArgs.cs
- UpDownBase.cs
- TimelineGroup.cs
- TypeConverterAttribute.cs
- BitmapEffectCollection.cs
- Identifier.cs
- TextTreeInsertElementUndoUnit.cs
- ContentPlaceHolder.cs
- PipelineModuleStepContainer.cs
- SqlDataReader.cs
- DynamicResourceExtension.cs
- TextServicesContext.cs
- WebServiceReceive.cs
- HeaderCollection.cs
- MexHttpsBindingElement.cs
- LocatorPartList.cs
- ResourceCategoryAttribute.cs
- COM2PropertyPageUITypeConverter.cs
- _RequestCacheProtocol.cs
- TemplateControlParser.cs
- CompositionTarget.cs
- Point3DAnimationBase.cs
- DataSetFieldSchema.cs
- filewebrequest.cs
- PropertyTab.cs
- PolyLineSegmentFigureLogic.cs
- Mutex.cs
- KeySplineConverter.cs
- Inflater.cs
- unsafeIndexingFilterStream.cs
- SizeF.cs
- ProfilePropertyNameValidator.cs
- ToolStripContentPanelRenderEventArgs.cs
- ContainerParaClient.cs
- ForAllOperator.cs
- HashAlgorithm.cs
- DataQuery.cs
- SplitterEvent.cs
- BinaryUtilClasses.cs
- PropertyGrid.cs
- TextSelection.cs
- BaseTemplateParser.cs
- WinInet.cs
- SqlRecordBuffer.cs
- WebPartConnection.cs
- EntityContainerEmitter.cs
- GCHandleCookieTable.cs
- DataColumnCollection.cs
- UnsafeNativeMethods.cs
- TypeListConverter.cs
- AssociationSetMetadata.cs
- DocumentReferenceCollection.cs
- Drawing.cs
- HandledEventArgs.cs
- PartitionedStreamMerger.cs
- OleDbMetaDataFactory.cs
- NavigationCommands.cs
- ThreadAttributes.cs
- Vector3DAnimationBase.cs
- WebPartRestoreVerb.cs
- EqualityComparer.cs
- DocumentScope.cs
- SiteMap.cs
- TrackingConditionCollection.cs
- DataServices.cs
- SystemDropShadowChrome.cs
- PtsCache.cs
- validationstate.cs
- BaseHashHelper.cs
- TryExpression.cs
- HyperLinkStyle.cs
- XmlMtomWriter.cs
- PKCS1MaskGenerationMethod.cs
- ValidationErrorEventArgs.cs
- GAC.cs
- ToolStripTemplateNode.cs
- EntityConnectionStringBuilder.cs
- NonClientArea.cs
- TabControlEvent.cs
- DataDocumentXPathNavigator.cs
- ApplicationException.cs
- TagMapCollection.cs
- TransformValueSerializer.cs
- RequestQueue.cs
- InstanceNotReadyException.cs
- OleDbConnection.cs
- Error.cs
- XmlResolver.cs
- TextDecoration.cs
- ExtensionSimplifierMarkupObject.cs
- BitmapEditor.cs
- UserControl.cs
- AutoResetEvent.cs
- ICspAsymmetricAlgorithm.cs
- BinaryMethodMessage.cs
- BitmapDecoder.cs
- DesignerActionTextItem.cs
- RoleManagerSection.cs
- TripleDES.cs
- SqlNotificationRequest.cs