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
- LicFileLicenseProvider.cs
- FlowDocumentScrollViewer.cs
- NullExtension.cs
- EnumType.cs
- NonVisualControlAttribute.cs
- Int32RectValueSerializer.cs
- DatePickerTextBox.cs
- CodeIndexerExpression.cs
- CompModSwitches.cs
- Stack.cs
- RemoteWebConfigurationHost.cs
- Substitution.cs
- SplineKeyFrames.cs
- SimpleExpression.cs
- GridViewEditEventArgs.cs
- DataServiceClientException.cs
- SoapSchemaMember.cs
- CalculatedColumn.cs
- RIPEMD160Managed.cs
- Action.cs
- ContractInstanceProvider.cs
- ManagementDateTime.cs
- RtfNavigator.cs
- ModuleBuilderData.cs
- InternalDuplexChannelFactory.cs
- WizardForm.cs
- TrustLevelCollection.cs
- ExpandSegmentCollection.cs
- OutOfMemoryException.cs
- XmlSchemaCompilationSettings.cs
- SourceSwitch.cs
- ParserStreamGeometryContext.cs
- ByeOperation11AsyncResult.cs
- Single.cs
- PropagatorResult.cs
- XmlHierarchicalDataSourceView.cs
- Image.cs
- LogManagementAsyncResult.cs
- IISMapPath.cs
- XPathItem.cs
- PerformanceCounterLib.cs
- ChangeNode.cs
- Attributes.cs
- validation.cs
- ArgumentOutOfRangeException.cs
- DynamicResourceExtension.cs
- ErasingStroke.cs
- TransformDescriptor.cs
- XmlSchemaComplexContentRestriction.cs
- TemplatePropertyEntry.cs
- HtmlProps.cs
- XamlClipboardData.cs
- PrimitiveXmlSerializers.cs
- PointConverter.cs
- sqlmetadatafactory.cs
- WebEventTraceProvider.cs
- KeyTimeConverter.cs
- SmiContext.cs
- SetterBase.cs
- Triplet.cs
- EventEntry.cs
- AnnotationDocumentPaginator.cs
- XmlWellformedWriter.cs
- TextBox.cs
- SignatureHelper.cs
- ComboBox.cs
- SizeAnimation.cs
- XmlAttributeAttribute.cs
- BoundsDrawingContextWalker.cs
- PersonalizableTypeEntry.cs
- SecurityDescriptor.cs
- AspProxy.cs
- ISAPIRuntime.cs
- FileDialog.cs
- XmlNotation.cs
- ChangeNode.cs
- XmlSchemaObjectCollection.cs
- PrintEvent.cs
- VersionUtil.cs
- VersionedStream.cs
- HideDisabledControlAdapter.cs
- TabControl.cs
- ColorBlend.cs
- PingReply.cs
- StaticResourceExtension.cs
- MorphHelper.cs
- OptimalBreakSession.cs
- MappingSource.cs
- RootBrowserWindowProxy.cs
- xmlglyphRunInfo.cs
- NavigationCommands.cs
- MethodBuilderInstantiation.cs
- WebBrowser.cs
- ConnectionProviderAttribute.cs
- DefaultBinder.cs
- CustomError.cs
- SerializerWriterEventHandlers.cs
- AutomationAttributeInfo.cs
- XmlSchemaGroupRef.cs
- CommonXSendMessage.cs