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
- ProcessThreadCollection.cs
- ComponentConverter.cs
- X509SecurityToken.cs
- BitmapImage.cs
- BaseTemplateBuildProvider.cs
- EffectiveValueEntry.cs
- SplitContainer.cs
- ByteStack.cs
- CodeArrayIndexerExpression.cs
- TokenBasedSet.cs
- DecoderReplacementFallback.cs
- BlurEffect.cs
- SystemThemeKey.cs
- CodeMemberProperty.cs
- FillBehavior.cs
- DebugView.cs
- CheckBoxField.cs
- TypeLoadException.cs
- RadioButtonStandardAdapter.cs
- TimeStampChecker.cs
- x509utils.cs
- TraceLevelStore.cs
- BlockUIContainer.cs
- LinqDataSourceSelectEventArgs.cs
- TextRunTypographyProperties.cs
- XmlCharacterData.cs
- ConstructorExpr.cs
- OutputCacheSection.cs
- RoamingStoreFile.cs
- CompilationRelaxations.cs
- UInt64.cs
- PagedControl.cs
- QueryContext.cs
- querybuilder.cs
- DataServiceQueryException.cs
- ImportContext.cs
- QuotedStringWriteStateInfo.cs
- XmlSchemaIdentityConstraint.cs
- ConstraintConverter.cs
- SiteMapDataSource.cs
- DictionaryManager.cs
- DoubleLinkList.cs
- VideoDrawing.cs
- BufferBuilder.cs
- GenericUriParser.cs
- PrintingPermission.cs
- RequiredFieldValidator.cs
- StyleXamlParser.cs
- CodeExpressionRuleDeclaration.cs
- GacUtil.cs
- XPathDocument.cs
- DocumentSequenceHighlightLayer.cs
- MsmqTransportBindingElement.cs
- HtmlInputCheckBox.cs
- XmlQueryRuntime.cs
- DBSchemaTable.cs
- OleDbDataAdapter.cs
- NativeMethods.cs
- AssemblyBuilderData.cs
- StyleCollection.cs
- UserPersonalizationStateInfo.cs
- WindowVisualStateTracker.cs
- DataGridBoolColumn.cs
- SqlRetyper.cs
- WebPartExportVerb.cs
- OuterGlowBitmapEffect.cs
- DbDataAdapter.cs
- TimeSpanConverter.cs
- SecureStringHasher.cs
- DataGridViewEditingControlShowingEventArgs.cs
- WebServiceMethodData.cs
- CapabilitiesRule.cs
- ConcurrentQueue.cs
- InputLangChangeRequestEvent.cs
- PropertyValueUIItem.cs
- WebServiceErrorEvent.cs
- CodeFieldReferenceExpression.cs
- WindowsRichEdit.cs
- BatchServiceHost.cs
- Range.cs
- DispatcherSynchronizationContext.cs
- SwitchElementsCollection.cs
- ToolboxItemLoader.cs
- DynamicResourceExtension.cs
- ConstructorNeedsTagAttribute.cs
- RIPEMD160.cs
- MetadataAssemblyHelper.cs
- ProjectedSlot.cs
- WebPartConnection.cs
- CompositionAdorner.cs
- WebResourceUtil.cs
- DbSourceCommand.cs
- LayoutEditorPart.cs
- HeaderedContentControl.cs
- BindingOperations.cs
- GeneralTransform.cs
- ReferencedCollectionType.cs
- MessageLogger.cs
- ListBase.cs
- AttributeQuery.cs