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
- SystemParameters.cs
- ConfigurationConverterBase.cs
- Point3DConverter.cs
- XmlQueryType.cs
- BuildResultCache.cs
- OverflowException.cs
- GridItemProviderWrapper.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Condition.cs
- CookieHandler.cs
- NamedPipeTransportManager.cs
- DataBindingExpressionBuilder.cs
- SymbolEqualComparer.cs
- TabItemAutomationPeer.cs
- EntityModelBuildProvider.cs
- TrackingRecord.cs
- EditingCoordinator.cs
- UndoManager.cs
- PlainXmlDeserializer.cs
- XamlPathDataSerializer.cs
- InfoCardArgumentException.cs
- ListBoxAutomationPeer.cs
- BuildResult.cs
- SplayTreeNode.cs
- ButtonRenderer.cs
- Rect.cs
- ExtensibleClassFactory.cs
- BitmapEffectInput.cs
- XmlSchemaIdentityConstraint.cs
- ConfigXmlSignificantWhitespace.cs
- DodSequenceMerge.cs
- IIS7WorkerRequest.cs
- DropShadowBitmapEffect.cs
- SerialStream.cs
- XmlSchemaFacet.cs
- XmlAttributeAttribute.cs
- ReadOnlyCollection.cs
- TimeStampChecker.cs
- Underline.cs
- QueryStringParameter.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ButtonFlatAdapter.cs
- CodeDirectiveCollection.cs
- ConfigurationConverterBase.cs
- StylusShape.cs
- CalculatedColumn.cs
- TextServicesDisplayAttribute.cs
- CornerRadius.cs
- TreeViewHitTestInfo.cs
- ListViewItem.cs
- PropagatorResult.cs
- DataIdProcessor.cs
- Image.cs
- BaseHashHelper.cs
- DictionaryBase.cs
- WebPartConnectionsCancelEventArgs.cs
- EmptyElement.cs
- SequentialUshortCollection.cs
- ParseChildrenAsPropertiesAttribute.cs
- FamilyCollection.cs
- ConfigurationManagerHelper.cs
- StateItem.cs
- TemplateFactory.cs
- CaseCqlBlock.cs
- DtrList.cs
- SHA1CryptoServiceProvider.cs
- ProxyManager.cs
- DocumentViewerAutomationPeer.cs
- ProfileModule.cs
- ColorIndependentAnimationStorage.cs
- TextStore.cs
- Parsers.cs
- AppliedDeviceFiltersEditor.cs
- SelectionEditor.cs
- ExtensibleClassFactory.cs
- ProcessRequestArgs.cs
- HtmlElement.cs
- Floater.cs
- UnsafeNativeMethodsPenimc.cs
- StorageTypeMapping.cs
- DbModificationClause.cs
- ECDsa.cs
- MouseButton.cs
- MethodBody.cs
- ComponentResourceKey.cs
- StringExpressionSet.cs
- ObjectDataSourceView.cs
- DataGridItemCollection.cs
- InfoCardProofToken.cs
- XPathScanner.cs
- CompositeKey.cs
- CqlGenerator.cs
- Point3DAnimation.cs
- UserNamePasswordServiceCredential.cs
- WorkflowViewStateService.cs
- FamilyTypeface.cs
- SqlTriggerContext.cs
- XmlNodeReader.cs
- ModelTypeConverter.cs
- DbDataReader.cs