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
- EmulateRecognizeCompletedEventArgs.cs
- CodeTypeDeclaration.cs
- DesignerInterfaces.cs
- DbProviderServices.cs
- AssemblyFilter.cs
- WebPartCancelEventArgs.cs
- CodeSubDirectory.cs
- latinshape.cs
- XmlEntityReference.cs
- GenericWebPart.cs
- VideoDrawing.cs
- RoleManagerSection.cs
- XmlAggregates.cs
- CanonicalFormWriter.cs
- HMACRIPEMD160.cs
- Propagator.cs
- RelationshipDetailsCollection.cs
- LongTypeConverter.cs
- Clause.cs
- HwndSubclass.cs
- NavigationFailedEventArgs.cs
- WinEventTracker.cs
- PageCodeDomTreeGenerator.cs
- ThreadStartException.cs
- TrackingStringDictionary.cs
- InputLangChangeEvent.cs
- TransactionContextValidator.cs
- TemplatePartAttribute.cs
- WebPartAddingEventArgs.cs
- TreeNodeStyleCollection.cs
- FontCacheLogic.cs
- CrossAppDomainChannel.cs
- OdbcConnectionOpen.cs
- GradientBrush.cs
- WebPartAuthorizationEventArgs.cs
- MediaTimeline.cs
- Rfc4050KeyFormatter.cs
- PriorityBindingExpression.cs
- SrgsGrammar.cs
- TextOutput.cs
- TileBrush.cs
- StatusBarItemAutomationPeer.cs
- SmiTypedGetterSetter.cs
- StringAnimationBase.cs
- GradientStop.cs
- Formatter.cs
- XPathScanner.cs
- WmpBitmapDecoder.cs
- basemetadatamappingvisitor.cs
- CodeArrayIndexerExpression.cs
- WindowsFormsSectionHandler.cs
- XMLSchema.cs
- SendMessageContent.cs
- SecurityTokenSerializer.cs
- TextInfo.cs
- WebServicesInteroperability.cs
- PathParser.cs
- HtmlTableCellCollection.cs
- ChameleonKey.cs
- SessionStateSection.cs
- CatalogPartCollection.cs
- ManifestBasedResourceGroveler.cs
- RtType.cs
- NTAccount.cs
- InkPresenter.cs
- TypeToken.cs
- PageHandlerFactory.cs
- StorageComplexPropertyMapping.cs
- RectangleGeometry.cs
- GridViewCancelEditEventArgs.cs
- BindingBase.cs
- _NegoStream.cs
- RegistryKey.cs
- JournalEntryStack.cs
- BrushValueSerializer.cs
- MULTI_QI.cs
- ConfigurationException.cs
- SQLStringStorage.cs
- FixedTextContainer.cs
- DelegateTypeInfo.cs
- Rotation3D.cs
- Comparer.cs
- PropertyGridDesigner.cs
- WebRequestModuleElement.cs
- ZeroOpNode.cs
- StringInfo.cs
- Light.cs
- Pts.cs
- DataGridColumnStyleMappingNameEditor.cs
- sqlcontext.cs
- HttpWriter.cs
- PEFileReader.cs
- SignerInfo.cs
- BinaryConverter.cs
- XmlAttributeAttribute.cs
- FileSecurity.cs
- ToolStripHighContrastRenderer.cs
- CFGGrammar.cs
- BufferBuilder.cs
- BinaryObjectInfo.cs