Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / SingleConverter.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SharedPerformanceCounter.cs
- RequestCache.cs
- ScriptControlDescriptor.cs
- PermissionSetTriple.cs
- URLMembershipCondition.cs
- DocumentGrid.cs
- RequestSecurityTokenSerializer.cs
- ResourceManagerWrapper.cs
- ParameterReplacerVisitor.cs
- TreePrinter.cs
- externdll.cs
- DbConnectionOptions.cs
- XmlSchemaNotation.cs
- ModelServiceImpl.cs
- TraceProvider.cs
- Label.cs
- UnauthorizedWebPart.cs
- SamlAuthorizationDecisionClaimResource.cs
- NetPipeSection.cs
- SafeFindHandle.cs
- ObjectQuery.cs
- HttpListener.cs
- MonthCalendar.cs
- ItemDragEvent.cs
- ServicePoint.cs
- IndexerNameAttribute.cs
- WebSysDescriptionAttribute.cs
- ColumnPropertiesGroup.cs
- WebPartZone.cs
- MemberAssignmentAnalysis.cs
- PersonalizationState.cs
- BamlLocalizableResource.cs
- SvcMapFileLoader.cs
- ValueTypeFixupInfo.cs
- InputMethodStateChangeEventArgs.cs
- EdmProperty.cs
- DataBindingExpressionBuilder.cs
- XmlSerializerOperationBehavior.cs
- SystemWebSectionGroup.cs
- WebPartUtil.cs
- _Rfc2616CacheValidators.cs
- KeyTime.cs
- Visual3D.cs
- ProvidersHelper.cs
- BoolExpr.cs
- AutomationAttributeInfo.cs
- CategoryAttribute.cs
- ToolboxItemAttribute.cs
- QilValidationVisitor.cs
- ConfigsHelper.cs
- Bitmap.cs
- GraphicsContainer.cs
- CaseInsensitiveOrdinalStringComparer.cs
- XmlExtensionFunction.cs
- CustomCredentialPolicy.cs
- AddingNewEventArgs.cs
- ProcessHost.cs
- DbConnectionPoolGroupProviderInfo.cs
- ColumnCollection.cs
- ComponentResourceManager.cs
- ClientRuntime.cs
- Int32Rect.cs
- XDeferredAxisSource.cs
- XhtmlTextWriter.cs
- ExtentJoinTreeNode.cs
- RemoteCryptoSignHashRequest.cs
- UTF7Encoding.cs
- Panel.cs
- MissingMethodException.cs
- OutputScope.cs
- ThicknessConverter.cs
- ListSourceHelper.cs
- TextFormatter.cs
- XmlQueryContext.cs
- AmbiguousMatchException.cs
- RegistrationServices.cs
- ResizingMessageFilter.cs
- WebPartTransformer.cs
- RawKeyboardInputReport.cs
- ButtonColumn.cs
- QuaternionConverter.cs
- OleDbConnectionInternal.cs
- ResponseStream.cs
- BindingManagerDataErrorEventArgs.cs
- EntitySetDataBindingList.cs
- _UriTypeConverter.cs
- SafeNativeMethods.cs
- PersonalizationProviderCollection.cs
- ConfigXmlComment.cs
- CodeTypeReferenceExpression.cs
- LinqDataSourceContextData.cs
- HttpRawResponse.cs
- TypedReference.cs
- versioninfo.cs
- PermissionToken.cs
- FilterEventArgs.cs
- SiteMapProvider.cs
- SizeChangedInfo.cs
- TextInfo.cs
- DbException.cs