Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- XmlQueryCardinality.cs
- CultureSpecificCharacterBufferRange.cs
- SqlReorderer.cs
- TableLayoutRowStyleCollection.cs
- LicenseProviderAttribute.cs
- ThaiBuddhistCalendar.cs
- StylusPointCollection.cs
- SafeArrayTypeMismatchException.cs
- ToolZone.cs
- CryptoSession.cs
- Serializer.cs
- RawStylusInputCustomData.cs
- ReadOnlyDictionary.cs
- OutputScope.cs
- ParameterCollection.cs
- Literal.cs
- DataGridViewDataConnection.cs
- SqlStatistics.cs
- BezierSegment.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- EntityStoreSchemaFilterEntry.cs
- IncrementalReadDecoders.cs
- MailSettingsSection.cs
- ExtentKey.cs
- FrameworkObject.cs
- Fonts.cs
- Point3DConverter.cs
- EpmSourceTree.cs
- UpdateRecord.cs
- FtpWebResponse.cs
- NativeRecognizer.cs
- AssignDesigner.xaml.cs
- SelectionRangeConverter.cs
- ColorTranslator.cs
- MultiAsyncResult.cs
- SqlWebEventProvider.cs
- invalidudtexception.cs
- DataGridTextBox.cs
- _ListenerResponseStream.cs
- XAMLParseException.cs
- KeyEvent.cs
- Deflater.cs
- ExpressionBindingCollection.cs
- Parallel.cs
- NodeFunctions.cs
- FlagsAttribute.cs
- BindingGroup.cs
- TTSEvent.cs
- ImageSourceValueSerializer.cs
- TagMapInfo.cs
- ManipulationVelocities.cs
- Funcletizer.cs
- CfgSemanticTag.cs
- ApplicationCommands.cs
- UpdateTranslator.cs
- ArithmeticException.cs
- ReadOnlyCollectionBase.cs
- InvalidateEvent.cs
- ICollection.cs
- ExpressionNode.cs
- ListViewGroupConverter.cs
- ChangeProcessor.cs
- ProfileSection.cs
- TwoPhaseCommit.cs
- ColorContextHelper.cs
- HttpClientProtocol.cs
- Section.cs
- BitmapScalingModeValidation.cs
- PassportAuthentication.cs
- WebPartZoneAutoFormat.cs
- UrlAuthorizationModule.cs
- cookieexception.cs
- PointAnimationClockResource.cs
- XamlSerializer.cs
- BitmapEffect.cs
- JumpPath.cs
- UndoEngine.cs
- ObjectStorage.cs
- TypeInitializationException.cs
- StringValueSerializer.cs
- InputScopeManager.cs
- Size3DValueSerializer.cs
- LoginCancelEventArgs.cs
- ToolStripRendererSwitcher.cs
- AsyncOperationManager.cs
- CodeAccessPermission.cs
- filewebresponse.cs
- DrawingImage.cs
- CompoundFileStreamReference.cs
- SimpleHandlerFactory.cs
- SBCSCodePageEncoding.cs
- TCPClient.cs
- TextureBrush.cs
- SubMenuStyleCollection.cs
- CodeTypeReferenceCollection.cs
- StickyNoteAnnotations.cs
- PrinterSettings.cs
- HyperLinkDesigner.cs
- TextEditorCharacters.cs
- TargetControlTypeAttribute.cs