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
- DbMetaDataCollectionNames.cs
- SafeNativeMethods.cs
- XmlTextWriter.cs
- Pair.cs
- DataErrorValidationRule.cs
- ActiveXContainer.cs
- RequestTimeoutManager.cs
- TextViewSelectionProcessor.cs
- MouseEvent.cs
- GenericUriParser.cs
- X509WindowsSecurityToken.cs
- WpfMemberInvoker.cs
- MonthChangedEventArgs.cs
- PolicyStatement.cs
- LayoutDump.cs
- PublisherIdentityPermission.cs
- ComponentCodeDomSerializer.cs
- DefaultTextStoreTextComposition.cs
- LayoutExceptionEventArgs.cs
- Calendar.cs
- HTMLTagNameToTypeMapper.cs
- BitmapEffectvisualstate.cs
- HttpResponseHeader.cs
- Transactions.cs
- ToolboxItemFilterAttribute.cs
- ReturnValue.cs
- SmiTypedGetterSetter.cs
- COM2Enum.cs
- LockRecoveryTask.cs
- PageAsyncTaskManager.cs
- IndentedTextWriter.cs
- ActivityExecutorOperation.cs
- ClientSponsor.cs
- RemoteAsymmetricSignatureFormatter.cs
- PartialCachingAttribute.cs
- WorkerRequest.cs
- QfeChecker.cs
- RegionData.cs
- SQLBytes.cs
- ServiceManagerHandle.cs
- DtdParser.cs
- EnumValAlphaComparer.cs
- FrugalList.cs
- BaseProcessor.cs
- SerializerWriterEventHandlers.cs
- HttpListener.cs
- ThreadAbortException.cs
- BuildProvidersCompiler.cs
- BufferedGraphics.cs
- SystemUnicastIPAddressInformation.cs
- XmlSchemaAll.cs
- TextFormatterImp.cs
- FixedElement.cs
- XmlSchemaParticle.cs
- OpCodes.cs
- WebProxyScriptElement.cs
- ArglessEventHandlerProxy.cs
- SHA512Managed.cs
- DragEvent.cs
- CounterCreationDataCollection.cs
- ZipIOLocalFileHeader.cs
- MetadataImporter.cs
- PersonalizablePropertyEntry.cs
- ExpandCollapsePattern.cs
- InteropBitmapSource.cs
- SimpleHandlerFactory.cs
- CharStorage.cs
- wmiprovider.cs
- WmlImageAdapter.cs
- RuleInfoComparer.cs
- CanExecuteRoutedEventArgs.cs
- TemplateParser.cs
- XmlMemberMapping.cs
- SizeConverter.cs
- FunctionDefinition.cs
- ListViewUpdatedEventArgs.cs
- ListBoxItemWrapperAutomationPeer.cs
- PeerObject.cs
- TypeUtil.cs
- _NegoState.cs
- MailBnfHelper.cs
- ValueTable.cs
- EncoderFallback.cs
- XmlDocumentSchema.cs
- ClientRoleProvider.cs
- PassportAuthentication.cs
- Menu.cs
- Metadata.cs
- PropertyChangeTracker.cs
- RelationshipType.cs
- StrokeIntersection.cs
- TouchEventArgs.cs
- EditCommandColumn.cs
- SmtpNegotiateAuthenticationModule.cs
- DLinqAssociationProvider.cs
- DataTableNewRowEvent.cs
- CharEntityEncoderFallback.cs
- BitmapEffect.cs
- SqlMetaData.cs
- GridItemPattern.cs