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
- TextElementCollection.cs
- BlurBitmapEffect.cs
- Asn1IntegerConverter.cs
- UIntPtr.cs
- Asn1IntegerConverter.cs
- UniqueIdentifierService.cs
- HttpCapabilitiesEvaluator.cs
- EditingScope.cs
- TypeConstant.cs
- FileEnumerator.cs
- MDIControlStrip.cs
- NotFiniteNumberException.cs
- TimerEventSubscriptionCollection.cs
- streamingZipPartStream.cs
- SizeChangedEventArgs.cs
- CallSiteOps.cs
- UnsafeNativeMethods.cs
- ArraySortHelper.cs
- ThemeInfoAttribute.cs
- ProfileSettings.cs
- ResourceProviderFactory.cs
- XmlSchema.cs
- GroupItem.cs
- regiisutil.cs
- SchemeSettingElementCollection.cs
- QilInvoke.cs
- Vector3DCollectionConverter.cs
- KerberosRequestorSecurityToken.cs
- DropTarget.cs
- PenThreadWorker.cs
- AspProxy.cs
- StoreConnection.cs
- Substitution.cs
- Timer.cs
- InstanceNormalEvent.cs
- X509CertificateRecipientClientCredential.cs
- ELinqQueryState.cs
- HideDisabledControlAdapter.cs
- PlainXmlDeserializer.cs
- VersionPair.cs
- CompositeTypefaceMetrics.cs
- SourceItem.cs
- TypeInfo.cs
- FlowPosition.cs
- SqlBooleanMismatchVisitor.cs
- DesignerForm.cs
- RelationshipType.cs
- XmlILTrace.cs
- ColorAnimationBase.cs
- MappingMetadataHelper.cs
- CompiledRegexRunner.cs
- BooleanExpr.cs
- XPathNode.cs
- SharedStatics.cs
- FilteredDataSetHelper.cs
- PingOptions.cs
- UserMapPath.cs
- XmlArrayItemAttribute.cs
- DbProviderFactoriesConfigurationHandler.cs
- CharAnimationBase.cs
- ComplexObject.cs
- WmfPlaceableFileHeader.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- XmlSchemaSequence.cs
- DesignerCommandSet.cs
- _Win32.cs
- ForceCopyBuildProvider.cs
- WebPartVerbCollection.cs
- FastEncoder.cs
- CustomAttributeSerializer.cs
- unitconverter.cs
- ListBindingHelper.cs
- HttpAsyncResult.cs
- XsdCachingReader.cs
- HttpCookiesSection.cs
- XslTransformFileEditor.cs
- wgx_sdk_version.cs
- TableSectionStyle.cs
- SpecialFolderEnumConverter.cs
- StrokeNodeEnumerator.cs
- TextEncodedRawTextWriter.cs
- BrushMappingModeValidation.cs
- SourceLineInfo.cs
- FixedSOMImage.cs
- InkCanvasSelection.cs
- Quaternion.cs
- DataColumnMapping.cs
- XmlNamespaceDeclarationsAttribute.cs
- XmlSchemaAnnotated.cs
- AdRotatorDesigner.cs
- DataGridComponentEditor.cs
- StringKeyFrameCollection.cs
- TemplateNameScope.cs
- BulletChrome.cs
- Pkcs7Recipient.cs
- Grant.cs
- AnonymousIdentificationModule.cs
- BitmapEditor.cs
- ListViewUpdatedEventArgs.cs
- NotConverter.cs