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
- ClassHandlersStore.cs
- WebPartAuthorizationEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- FormViewRow.cs
- CustomLineCap.cs
- Deserializer.cs
- VirtualizingStackPanel.cs
- EntityProxyTypeInfo.cs
- URIFormatException.cs
- EventHandlersStore.cs
- HyperLink.cs
- XmlEnumAttribute.cs
- CodeDomConfigurationHandler.cs
- ObjectContextServiceProvider.cs
- MetadataSerializer.cs
- Expression.cs
- HttpModuleCollection.cs
- RegexNode.cs
- PromptStyle.cs
- Drawing.cs
- XmlSchemaAttributeGroup.cs
- TimeSpanStorage.cs
- XmlParserContext.cs
- GuidelineCollection.cs
- ConsoleKeyInfo.cs
- ArrayExtension.cs
- AttributedMetaModel.cs
- ToolStripRenderer.cs
- SqlReferenceCollection.cs
- GlobalEventManager.cs
- Pair.cs
- NameValuePair.cs
- SafeHGlobalHandleCritical.cs
- PropertyPath.cs
- DataTableMapping.cs
- DeploymentSectionCache.cs
- HighlightComponent.cs
- PropertyManager.cs
- MyContact.cs
- Matrix3DConverter.cs
- ConstantProjectedSlot.cs
- CriticalHandle.cs
- ChangeNode.cs
- GlyphRunDrawing.cs
- TableDetailsCollection.cs
- TypedReference.cs
- ComPlusDiagnosticTraceSchemas.cs
- PagerSettings.cs
- ObjectKeyFrameCollection.cs
- ToolStripDropDownClosingEventArgs.cs
- MultipleViewPattern.cs
- HttpRequest.cs
- CompositeFontInfo.cs
- Material.cs
- DataGridViewRowHeaderCell.cs
- Identity.cs
- Component.cs
- InputLangChangeEvent.cs
- MenuCommand.cs
- KeyInfo.cs
- TdsParameterSetter.cs
- NetworkInformationException.cs
- DelegateSerializationHolder.cs
- DataSvcMapFileSerializer.cs
- PagePropertiesChangingEventArgs.cs
- EncoderParameters.cs
- Propagator.JoinPropagator.cs
- ImageInfo.cs
- HostProtectionPermission.cs
- UiaCoreTypesApi.cs
- QilValidationVisitor.cs
- FaultConverter.cs
- EventEntry.cs
- _emptywebproxy.cs
- XmlTypeAttribute.cs
- KeyConverter.cs
- SqlUdtInfo.cs
- PartEditor.cs
- Model3D.cs
- ContentPlaceHolder.cs
- JpegBitmapEncoder.cs
- DBConcurrencyException.cs
- SignedInfo.cs
- ToolStripButton.cs
- DataGridViewRowPrePaintEventArgs.cs
- Monitor.cs
- Viewport3DAutomationPeer.cs
- SessionStateUtil.cs
- DbConnectionPoolGroupProviderInfo.cs
- CodeIdentifiers.cs
- altserialization.cs
- IBuiltInEvidence.cs
- SafeEventLogWriteHandle.cs
- AccessDataSourceView.cs
- RecognizerInfo.cs
- EntityRecordInfo.cs
- ConnectionStringsSection.cs
- DrawingAttributesDefaultValueFactory.cs
- ParameterCollection.cs
- ThrowHelper.cs