Code:
/ DotNET / DotNET / 8.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
- MatrixStack.cs
- BitmapSourceSafeMILHandle.cs
- PerformanceCounter.cs
- TargetInvocationException.cs
- LineServicesCallbacks.cs
- connectionpool.cs
- ComAdminInterfaces.cs
- MembershipAdapter.cs
- KeyToListMap.cs
- CallbackHandler.cs
- TokenBasedSet.cs
- ImageInfo.cs
- RemoteWebConfigurationHostStream.cs
- OracleInfoMessageEventArgs.cs
- IsolatedStorageFilePermission.cs
- ApplyImportsAction.cs
- VisualSerializer.cs
- WindowsFont.cs
- StrongNamePublicKeyBlob.cs
- OwnerDrawPropertyBag.cs
- CompoundFileStreamReference.cs
- ListenerSessionConnection.cs
- ErrorStyle.cs
- StringResourceManager.cs
- SiteMapNode.cs
- ButtonField.cs
- TextFormatterHost.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- IisTraceListener.cs
- ContentType.cs
- IdnElement.cs
- ProfileService.cs
- XmlAnyElementAttributes.cs
- SamlAttributeStatement.cs
- HttpCapabilitiesEvaluator.cs
- Rectangle.cs
- DoubleAnimationClockResource.cs
- ViewGenResults.cs
- EntityCodeGenerator.cs
- OracleBinary.cs
- UnsafeNativeMethods.cs
- RelationshipType.cs
- StreamInfo.cs
- Region.cs
- PeerService.cs
- Missing.cs
- NotSupportedException.cs
- DesignerView.Commands.cs
- SrgsElement.cs
- Base64Decoder.cs
- PrintDocument.cs
- RemotingHelper.cs
- PropertyGridEditorPart.cs
- ISAPIWorkerRequest.cs
- PointAnimationBase.cs
- UpdateCompiler.cs
- WebPartMovingEventArgs.cs
- UnknownWrapper.cs
- CodeSnippetTypeMember.cs
- GeometryCollection.cs
- DrawingState.cs
- ErrorFormatter.cs
- DataServiceResponse.cs
- OleServicesContext.cs
- ActivationArguments.cs
- ActivityStateRecord.cs
- UnsafeNativeMethods.cs
- HttpServerUtilityWrapper.cs
- ToolStripDropDownMenu.cs
- EventLogHandle.cs
- PerformanceCounter.cs
- ConsoleTraceListener.cs
- HttpValueCollection.cs
- XmlArrayItemAttribute.cs
- Visual3DCollection.cs
- _LocalDataStoreMgr.cs
- HttpResponseWrapper.cs
- XmlQueryCardinality.cs
- HTMLTextWriter.cs
- CategoryGridEntry.cs
- CanExecuteRoutedEventArgs.cs
- HttpModuleCollection.cs
- OrthographicCamera.cs
- SettingsProviderCollection.cs
- TypeLibConverter.cs
- KnownBoxes.cs
- BaseComponentEditor.cs
- EmptyStringExpandableObjectConverter.cs
- Rotation3DAnimationBase.cs
- XmlAttributeCache.cs
- XmlSchemaAnnotation.cs
- X509Extension.cs
- QueryCreatedEventArgs.cs
- FixedFlowMap.cs
- CustomAttributeFormatException.cs
- SmiRecordBuffer.cs
- Attributes.cs
- MachineSettingsSection.cs
- GraphicsState.cs
- XPathDocumentNavigator.cs