Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RelationshipManager.cs
- StringUtil.cs
- IconBitmapDecoder.cs
- SQLUtility.cs
- BookmarkManager.cs
- BitmapImage.cs
- IResourceProvider.cs
- MemberAssignmentAnalysis.cs
- OrthographicCamera.cs
- Select.cs
- PeerNameRecord.cs
- QueryableDataSourceView.cs
- RoutedPropertyChangedEventArgs.cs
- ElementNotEnabledException.cs
- DesignerActionUIStateChangeEventArgs.cs
- XmlNodeChangedEventArgs.cs
- LocalizableResourceBuilder.cs
- Storyboard.cs
- FileLoadException.cs
- Frame.cs
- EpmSyndicationContentDeSerializer.cs
- FontDifferentiator.cs
- BoolExpr.cs
- FlowLayoutPanel.cs
- Triplet.cs
- UIntPtr.cs
- WindowProviderWrapper.cs
- SchemaType.cs
- RoleGroupCollection.cs
- DesignerEditorPartChrome.cs
- AuthorizationRuleCollection.cs
- BuildResultCache.cs
- ContractBase.cs
- NullableLongSumAggregationOperator.cs
- RegexCapture.cs
- UriTemplateDispatchFormatter.cs
- ManualResetEvent.cs
- MsdtcClusterUtils.cs
- HttpSessionStateWrapper.cs
- MouseActionConverter.cs
- CompositeTypefaceMetrics.cs
- WebPartConnectionsDisconnectVerb.cs
- ParameterRetriever.cs
- OracleConnectionFactory.cs
- ApplicationSecurityManager.cs
- ProcessThread.cs
- RecordManager.cs
- ExpressionBuilderContext.cs
- DrawingState.cs
- SubqueryRules.cs
- Literal.cs
- WindowsListViewItem.cs
- AutoGeneratedFieldProperties.cs
- PolicyException.cs
- StreamAsIStream.cs
- Signature.cs
- CatalogZoneDesigner.cs
- DataContext.cs
- ZipIOLocalFileBlock.cs
- WindowsGraphicsCacheManager.cs
- DefaultValidator.cs
- controlskin.cs
- GeneralTransform.cs
- XamlSerializerUtil.cs
- EventManager.cs
- InternalConfigHost.cs
- Configuration.cs
- ModuleBuilder.cs
- UrlAuthorizationModule.cs
- ResolveNextArgumentWorkItem.cs
- X509ThumbprintKeyIdentifierClause.cs
- DbgCompiler.cs
- TransformedBitmap.cs
- propertyentry.cs
- DependencyObject.cs
- AvTrace.cs
- DefaultSerializationProviderAttribute.cs
- XNodeNavigator.cs
- CalendarDateRange.cs
- InternalsVisibleToAttribute.cs
- Compiler.cs
- GrammarBuilderDictation.cs
- PreProcessInputEventArgs.cs
- HtmlCommandAdapter.cs
- SubclassTypeValidator.cs
- EntityWithKeyStrategy.cs
- BitmapFrame.cs
- FixedFlowMap.cs
- DecimalAnimationBase.cs
- BreakRecordTable.cs
- TreeViewDesigner.cs
- FormatConvertedBitmap.cs
- ObjectConverter.cs
- XmlNodeChangedEventManager.cs
- ClientRoleProvider.cs
- MultiplexingDispatchMessageFormatter.cs
- SerialPort.cs
- OleDbConnectionInternal.cs
- PageThemeBuildProvider.cs
- GeometryGroup.cs