Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / SingleConverter.cs / 1 / SingleConverter.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 SingleConverter : BaseNumberConverter { ///Provides a type /// converter to convert single-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(Single); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToSingle(value, CultureInfo.CurrentCulture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Single.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 Single.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Single)value).ToString("R", formatInfo); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AxisAngleRotation3D.cs
- SqlDataSourceStatusEventArgs.cs
- ResXFileRef.cs
- CSharpCodeProvider.cs
- SimpleBitVector32.cs
- DoubleCollection.cs
- EntityCollection.cs
- ValuePatternIdentifiers.cs
- EnumerableRowCollectionExtensions.cs
- OutputCacheProfileCollection.cs
- WinInetCache.cs
- LogicalChannelCollection.cs
- sqlcontext.cs
- List.cs
- GradientStop.cs
- StylusLogic.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- AppSettingsReader.cs
- HttpStreamMessage.cs
- TileBrush.cs
- PassportAuthentication.cs
- HtmlGenericControl.cs
- MonthCalendar.cs
- SetStateEventArgs.cs
- MultipartIdentifier.cs
- WebControlsSection.cs
- WebBrowserEvent.cs
- DataGridViewCheckBoxCell.cs
- GeometryGroup.cs
- CapabilitiesSection.cs
- ListViewTableCell.cs
- OrderByLifter.cs
- DataTableMapping.cs
- FileEnumerator.cs
- TextBoxRenderer.cs
- DrawingImage.cs
- ProjectionPathSegment.cs
- SqlCacheDependencySection.cs
- QuaternionAnimation.cs
- SchemaImporterExtensionsSection.cs
- _ContextAwareResult.cs
- CardSpacePolicyElement.cs
- ContainerFilterService.cs
- TrackingStringDictionary.cs
- CodeDirectoryCompiler.cs
- DataViewManager.cs
- ValueUtilsSmi.cs
- MenuItemBindingCollection.cs
- CssTextWriter.cs
- __Filters.cs
- CircleHotSpot.cs
- PrintDialog.cs
- RowToParametersTransformer.cs
- Base64Decoder.cs
- StorageInfo.cs
- RequestSecurityTokenResponse.cs
- _LocalDataStoreMgr.cs
- PageEventArgs.cs
- TableColumnCollectionInternal.cs
- EdmFunctions.cs
- StateManagedCollection.cs
- MonthCalendar.cs
- PartialArray.cs
- UnmanagedHandle.cs
- TextAdaptor.cs
- ToolStripSettings.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- EmbeddedObject.cs
- XmlNamespaceManager.cs
- DataGridViewSortCompareEventArgs.cs
- PreviewPageInfo.cs
- RecipientInfo.cs
- HwndSource.cs
- ServiceContractGenerationContext.cs
- IDQuery.cs
- LinqDataSourceDeleteEventArgs.cs
- StrokeNode.cs
- DtdParser.cs
- QuaternionKeyFrameCollection.cs
- XmlSchemaImporter.cs
- DataTableReader.cs
- ErrorRuntimeConfig.cs
- XmlSchemaComplexContent.cs
- SystemIPGlobalStatistics.cs
- SystemFonts.cs
- OpacityConverter.cs
- BooleanStorage.cs
- Control.cs
- IntSecurity.cs
- CodeDirectiveCollection.cs
- PropertyCollection.cs
- InvokeDelegate.cs
- IntAverageAggregationOperator.cs
- SqlDataRecord.cs
- HandlerFactoryWrapper.cs
- SkinBuilder.cs
- ChtmlMobileTextWriter.cs
- DataShape.cs
- ComboBox.cs
- StreamSecurityUpgradeInitiatorBase.cs