Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProxySimple.cs
- DotExpr.cs
- ListViewInsertedEventArgs.cs
- BufferedGraphicsManager.cs
- DataGridViewLinkCell.cs
- ColumnClickEvent.cs
- ColorBlend.cs
- Menu.cs
- ProjectionCamera.cs
- UrlEncodedParameterWriter.cs
- ListViewInsertEventArgs.cs
- NotCondition.cs
- DataServiceResponse.cs
- TraceHandler.cs
- DefaultValueConverter.cs
- ColumnWidthChangedEvent.cs
- WebConfigurationHost.cs
- DrawingBrush.cs
- PriorityQueue.cs
- CheckBoxFlatAdapter.cs
- FtpCachePolicyElement.cs
- IntSecurity.cs
- RevocationPoint.cs
- StatusStrip.cs
- OracleEncoding.cs
- DataFieldEditor.cs
- PersistenceTypeAttribute.cs
- SqlNodeAnnotation.cs
- Number.cs
- ExtensionElement.cs
- BooleanAnimationBase.cs
- ResXResourceSet.cs
- ExtendedPropertyCollection.cs
- LinearGradientBrush.cs
- KnownIds.cs
- cookieexception.cs
- DocumentAutomationPeer.cs
- DictionaryMarkupSerializer.cs
- UnwrappedTypesXmlSerializerManager.cs
- SystemFonts.cs
- SQLCharsStorage.cs
- BufferedGraphicsManager.cs
- FileCodeGroup.cs
- RegexWorker.cs
- DataGridColumnsPage.cs
- ViewManager.cs
- MetadataCache.cs
- AnnotationObservableCollection.cs
- XsltSettings.cs
- OracleParameter.cs
- ScrollBarRenderer.cs
- ChtmlTextWriter.cs
- SpellerHighlightLayer.cs
- LinkClickEvent.cs
- XLinq.cs
- WaitHandle.cs
- MethodCallConverter.cs
- DefaultObjectSerializer.cs
- DomainLiteralReader.cs
- Polyline.cs
- WebBrowserSiteBase.cs
- InstanceData.cs
- mongolianshape.cs
- ZipIOLocalFileBlock.cs
- CodeParameterDeclarationExpression.cs
- DbConnectionStringBuilder.cs
- ScriptingSectionGroup.cs
- FormsAuthenticationCredentials.cs
- WindowsTab.cs
- Font.cs
- CodeDOMProvider.cs
- NonSerializedAttribute.cs
- EntityClientCacheKey.cs
- StrongNamePublicKeyBlob.cs
- DrawingVisual.cs
- InstanceData.cs
- StateDesigner.cs
- CacheModeConverter.cs
- FontCacheLogic.cs
- ConsoleEntryPoint.cs
- OLEDB_Enum.cs
- EventProviderTraceListener.cs
- DataBindingValueUIHandler.cs
- WebBrowserDocumentCompletedEventHandler.cs
- FlowchartStart.xaml.cs
- DataGridViewRowPostPaintEventArgs.cs
- ObjectTokenCategory.cs
- TextElement.cs
- SEHException.cs
- ClientRuntimeConfig.cs
- InvalidCardException.cs
- AccessDataSourceView.cs
- DirectoryObjectSecurity.cs
- ContentPropertyAttribute.cs
- ZoneLinkButton.cs
- CanExecuteRoutedEventArgs.cs
- WindowsGraphics.cs
- XmlDictionaryWriter.cs
- SecurityTokenRequirement.cs
- CodeGenerator.cs