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
- RoleManagerModule.cs
- DeviceContext.cs
- TablePatternIdentifiers.cs
- PointCollectionValueSerializer.cs
- SafeViewOfFileHandle.cs
- GlyphManager.cs
- RegexMatchCollection.cs
- NetworkAddressChange.cs
- DataTable.cs
- FloaterParaClient.cs
- Socket.cs
- CodeCatchClause.cs
- LocatorGroup.cs
- ResourceAttributes.cs
- NavigatingCancelEventArgs.cs
- BasicDesignerLoader.cs
- ItemList.cs
- BamlRecords.cs
- SoapRpcServiceAttribute.cs
- SoapProtocolReflector.cs
- EntitySqlQueryCacheKey.cs
- HttpModule.cs
- LinqDataSourceValidationException.cs
- ToolStripButton.cs
- MarginsConverter.cs
- SqlError.cs
- DLinqDataModelProvider.cs
- EditorZoneBase.cs
- WinEventQueueItem.cs
- FilteredSchemaElementLookUpTable.cs
- OperationCanceledException.cs
- BreakRecordTable.cs
- XPathChildIterator.cs
- ConfigurationManagerInternalFactory.cs
- ContextMenuStripGroupCollection.cs
- RewritingPass.cs
- UICuesEvent.cs
- TransformGroup.cs
- EventWaitHandle.cs
- NativeMethods.cs
- DataBinding.cs
- LineBreakRecord.cs
- AddValidationError.cs
- ClientScriptItem.cs
- FormClosedEvent.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- Size3D.cs
- BreakRecordTable.cs
- GridViewRowPresenter.cs
- DataGridColumnCollection.cs
- Application.cs
- CompensationParticipant.cs
- EmptyReadOnlyDictionaryInternal.cs
- ComplexPropertyEntry.cs
- ClientCultureInfo.cs
- ColumnCollection.cs
- Gdiplus.cs
- TableParaClient.cs
- XMLDiffLoader.cs
- EntityStoreSchemaGenerator.cs
- AmbientLight.cs
- TextViewBase.cs
- TransactionBridge.cs
- RolePrincipal.cs
- TextRangeEditLists.cs
- SchemaComplexType.cs
- DtdParser.cs
- SyntaxCheck.cs
- DrawingBrush.cs
- MappingSource.cs
- RightsManagementInformation.cs
- SpecialNameAttribute.cs
- PageContent.cs
- SafeMemoryMappedViewHandle.cs
- WeakReferenceEnumerator.cs
- ElementAction.cs
- ChangePassword.cs
- IImplicitResourceProvider.cs
- Effect.cs
- SqlParameterCollection.cs
- DirectoryLocalQuery.cs
- Int64Storage.cs
- NullableLongSumAggregationOperator.cs
- Journal.cs
- DrawingGroupDrawingContext.cs
- ReadOnlyPropertyMetadata.cs
- BlurBitmapEffect.cs
- BulletedListEventArgs.cs
- TargetControlTypeAttribute.cs
- AccessibleObject.cs
- InstrumentationTracker.cs
- XmlWriterTraceListener.cs
- CodeExpressionCollection.cs
- ChannelServices.cs
- ToolStripOverflowButton.cs
- CodeMethodReturnStatement.cs
- HtmlInputReset.cs
- InternalTypeHelper.cs
- SqlSupersetValidator.cs
- SelectionWordBreaker.cs