Code:
/ DotNET / DotNET / 8.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
- XmlAttributeOverrides.cs
- XmlQueryStaticData.cs
- WebPartManagerInternals.cs
- ComboBox.cs
- ComponentConverter.cs
- WorkflowServiceNamespace.cs
- OleDbParameterCollection.cs
- GeneralTransform3DTo2D.cs
- ProgressChangedEventArgs.cs
- GAC.cs
- XmlBaseWriter.cs
- CommunicationObjectManager.cs
- UnionCqlBlock.cs
- PrintEvent.cs
- MulticastOption.cs
- TraceInternal.cs
- SimpleWebHandlerParser.cs
- Predicate.cs
- FileRecordSequence.cs
- Page.cs
- URLString.cs
- InstanceLockedException.cs
- SharedStream.cs
- CodeSubDirectory.cs
- SharedPerformanceCounter.cs
- HtmlInputReset.cs
- WindowPattern.cs
- NavigationPropertyEmitter.cs
- XmlParser.cs
- ListViewItem.cs
- RadioButtonStandardAdapter.cs
- formatstringdialog.cs
- WindowsUserNameCachingSecurityTokenAuthenticator.cs
- HWStack.cs
- SymmetricAlgorithm.cs
- HyperlinkAutomationPeer.cs
- PathTooLongException.cs
- DragCompletedEventArgs.cs
- ListChangedEventArgs.cs
- MemoryFailPoint.cs
- WebControlParameterProxy.cs
- MessageDispatch.cs
- KeyValueConfigurationCollection.cs
- WebPartDisplayMode.cs
- KeyValueInternalCollection.cs
- MessageDecoder.cs
- BuildManagerHost.cs
- SamlAssertion.cs
- GroupDescription.cs
- WebBrowser.cs
- DataColumn.cs
- XmlTypeAttribute.cs
- Button.cs
- ObjectStorage.cs
- QueryInterceptorAttribute.cs
- PersistenceTypeAttribute.cs
- EventSinkHelperWriter.cs
- AsnEncodedData.cs
- DocumentEventArgs.cs
- InfiniteTimeSpanConverter.cs
- AssemblyFilter.cs
- EventManager.cs
- DependentList.cs
- AdapterDictionary.cs
- RelationshipEndMember.cs
- XmlReaderSettings.cs
- XslVisitor.cs
- DesignBindingConverter.cs
- DictionaryTraceRecord.cs
- OptionUsage.cs
- ImportContext.cs
- CompiledQueryCacheKey.cs
- StorageComplexPropertyMapping.cs
- HttpResponse.cs
- HttpWebRequest.cs
- Compilation.cs
- DesignerSerializationManager.cs
- versioninfo.cs
- StyleCollectionEditor.cs
- LifetimeServices.cs
- FloatMinMaxAggregationOperator.cs
- ResourceReferenceExpression.cs
- ConnectionPoolManager.cs
- BaseTemplateBuildProvider.cs
- AmbiguousMatchException.cs
- ConsoleKeyInfo.cs
- CollectionMarkupSerializer.cs
- FileChangeNotifier.cs
- ControlEvent.cs
- OptionUsage.cs
- LoginNameDesigner.cs
- RangeBaseAutomationPeer.cs
- DataBindingExpressionBuilder.cs
- AccessDataSource.cs
- Material.cs
- RadioButtonPopupAdapter.cs
- MenuItemStyle.cs
- IIS7WorkerRequest.cs
- Bidi.cs
- StdValidatorsAndConverters.cs