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
- PiiTraceSource.cs
- StringValueSerializer.cs
- DataFormats.cs
- ImageCodecInfo.cs
- ScriptingProfileServiceSection.cs
- SystemSounds.cs
- RectValueSerializer.cs
- DetailsViewDeletedEventArgs.cs
- CodeObject.cs
- DataColumnMappingCollection.cs
- DispatcherFrame.cs
- DesignerVerb.cs
- ActivityDesigner.cs
- StrongNameMembershipCondition.cs
- UserPersonalizationStateInfo.cs
- Partitioner.cs
- DesignerInterfaces.cs
- RowType.cs
- JsonStringDataContract.cs
- Matrix.cs
- IndexingContentUnit.cs
- ExeConfigurationFileMap.cs
- Misc.cs
- SafeLibraryHandle.cs
- Operators.cs
- Base64WriteStateInfo.cs
- TableHeaderCell.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- ChildTable.cs
- ObjectConverter.cs
- MenuItem.cs
- CopyOnWriteList.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Utils.cs
- TextBlock.cs
- PlainXmlWriter.cs
- XmlDeclaration.cs
- Point.cs
- Attributes.cs
- WindowsPen.cs
- KnownBoxes.cs
- VectorKeyFrameCollection.cs
- HtmlTableCellCollection.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- DetectEofStream.cs
- OleDbFactory.cs
- PenCursorManager.cs
- SystemColors.cs
- CallbackHandler.cs
- XmlAggregates.cs
- CacheEntry.cs
- DependencyPropertyAttribute.cs
- Compiler.cs
- PrimarySelectionAdorner.cs
- MappingSource.cs
- StructuredType.cs
- dsa.cs
- SQLMoney.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- ChannelSettingsElement.cs
- ReachBasicContext.cs
- InvalidMessageContractException.cs
- SqlTypeSystemProvider.cs
- QueryReaderSettings.cs
- GPRECTF.cs
- CounterSample.cs
- DataGridRelationshipRow.cs
- CodeMemberField.cs
- NavigationWindow.cs
- ApplicationSettingsBase.cs
- BasicViewGenerator.cs
- UnsafeNativeMethodsTablet.cs
- HyperLinkField.cs
- ClientConfigPaths.cs
- Queue.cs
- xsdvalidator.cs
- CalendarDay.cs
- ListDataHelper.cs
- Pkcs7Recipient.cs
- FixedDSBuilder.cs
- ExtensionSimplifierMarkupObject.cs
- XomlCompilerHelpers.cs
- ReadOnlyTernaryTree.cs
- QueueProcessor.cs
- DataStorage.cs
- EntityProviderFactory.cs
- KeyConverter.cs
- Attribute.cs
- MetadataSerializer.cs
- EntityDesignerBuildProvider.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- SafeThemeHandle.cs
- ModelUtilities.cs
- Soap.cs
- TextTreeTextElementNode.cs
- DataListItem.cs
- ReadOnlyHierarchicalDataSourceView.cs
- EntityDesignerBuildProvider.cs
- EdmToObjectNamespaceMap.cs
- StateFinalizationDesigner.cs