Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FormsAuthenticationConfiguration.cs
- PropertyGroupDescription.cs
- WebPartEditVerb.cs
- CodeDomExtensionMethods.cs
- RegistryExceptionHelper.cs
- HotSpotCollection.cs
- IDReferencePropertyAttribute.cs
- EventProvider.cs
- SafeEventLogWriteHandle.cs
- StringBlob.cs
- EndpointAddress10.cs
- PropertyTab.cs
- DivideByZeroException.cs
- Mapping.cs
- UnsafeNetInfoNativeMethods.cs
- SyntaxCheck.cs
- CopyAction.cs
- PerformanceCounterManager.cs
- ConfigurationPropertyAttribute.cs
- WebSysDefaultValueAttribute.cs
- XslVisitor.cs
- SemanticValue.cs
- SizeChangedEventArgs.cs
- Asn1IntegerConverter.cs
- LinkedResourceCollection.cs
- DetailsView.cs
- EventLogEntry.cs
- TrackingServices.cs
- EdmItemError.cs
- ISessionStateStore.cs
- VisualBrush.cs
- EntityObject.cs
- PkcsUtils.cs
- WebPartVerbCollection.cs
- KnownIds.cs
- WebPartManagerInternals.cs
- ReflectEventDescriptor.cs
- OutgoingWebRequestContext.cs
- DispatcherExceptionEventArgs.cs
- DataGridBoolColumn.cs
- SortQuery.cs
- RadioButtonStandardAdapter.cs
- PropertyOrder.cs
- CompositionTarget.cs
- ConstNode.cs
- SoundPlayerAction.cs
- EventArgs.cs
- DesignerTransaction.cs
- ConvertTextFrag.cs
- AudioDeviceOut.cs
- DBSchemaRow.cs
- SchemaTableColumn.cs
- PropertyGridEditorPart.cs
- ClientSettingsProvider.cs
- DesignConnectionCollection.cs
- CellParagraph.cs
- DataListCommandEventArgs.cs
- XmlSchemaParticle.cs
- StandardOleMarshalObject.cs
- TargetControlTypeCache.cs
- ExclusiveCanonicalizationTransform.cs
- RegexGroupCollection.cs
- TextRenderingModeValidation.cs
- MsmqSecureHashAlgorithm.cs
- CodeStatementCollection.cs
- FormViewInsertedEventArgs.cs
- MergeFilterQuery.cs
- AssemblyLoader.cs
- ControllableStoryboardAction.cs
- WinEventWrap.cs
- JsonEnumDataContract.cs
- CounterSample.cs
- ShapeTypeface.cs
- Exceptions.cs
- Matrix3DConverter.cs
- CultureTableRecord.cs
- BitmapEditor.cs
- OrElse.cs
- SmiEventSink_DeferedProcessing.cs
- ProvidePropertyAttribute.cs
- TextServicesProperty.cs
- ColumnWidthChangingEvent.cs
- HttpCookie.cs
- HotCommands.cs
- BlurBitmapEffect.cs
- DockingAttribute.cs
- LoginView.cs
- PathSegment.cs
- XmlBaseWriter.cs
- SslStreamSecurityUpgradeProvider.cs
- ScrollItemProviderWrapper.cs
- PaginationProgressEventArgs.cs
- Timer.cs
- Rectangle.cs
- MethodBuilderInstantiation.cs
- TaiwanCalendar.cs
- IdentityNotMappedException.cs
- WrapPanel.cs
- ShapeTypeface.cs
- ListViewEditEventArgs.cs