Code:
/ FX-1434 / FX-1434 / 1.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
- ApplicationContext.cs
- PenCursorManager.cs
- FocusManager.cs
- TimeZoneInfo.cs
- FragmentQueryProcessor.cs
- QueryResults.cs
- RepeaterDataBoundAdapter.cs
- DbConnectionOptions.cs
- DeleteIndexBinder.cs
- UxThemeWrapper.cs
- ExpressionVisitor.cs
- QueryableDataSourceHelper.cs
- SqlBooleanMismatchVisitor.cs
- SinglePhaseEnlistment.cs
- PtsCache.cs
- CatalogUtil.cs
- CompilerResults.cs
- DebugInfoGenerator.cs
- StrongNameUtility.cs
- documentsequencetextview.cs
- CheckableControlBaseAdapter.cs
- DependencyPropertyAttribute.cs
- DateTimeConverter2.cs
- TypeResolver.cs
- SqlTriggerContext.cs
- PageFunction.cs
- ButtonBase.cs
- ClientEventManager.cs
- GridEntry.cs
- IndentedWriter.cs
- WebConfigManager.cs
- TraceSection.cs
- TargetInvocationException.cs
- ErrorTableItemStyle.cs
- AuthenticationModuleElementCollection.cs
- FixUp.cs
- hresults.cs
- SwitchElementsCollection.cs
- SafeCryptoKeyHandle.cs
- OleDbMetaDataFactory.cs
- ZipIOExtraFieldElement.cs
- Binding.cs
- Trace.cs
- ISCIIEncoding.cs
- ConfigurationManagerHelperFactory.cs
- SimpleMailWebEventProvider.cs
- LinearGradientBrush.cs
- InternalUserCancelledException.cs
- FormViewDeleteEventArgs.cs
- DomNameTable.cs
- PackWebResponse.cs
- XmlSchemaObjectTable.cs
- HttpApplicationFactory.cs
- Listbox.cs
- KnownTypesProvider.cs
- SchemaImporter.cs
- IItemProperties.cs
- DefaultSection.cs
- PageVisual.cs
- DisableDpiAwarenessAttribute.cs
- _Connection.cs
- NotSupportedException.cs
- OdbcConnectionString.cs
- KeyBinding.cs
- SectionUpdates.cs
- ObjectItemCollection.cs
- Transactions.cs
- ToolStripDropDownItem.cs
- FixedSOMImage.cs
- InvalidCastException.cs
- TearOffProxy.cs
- WebEventCodes.cs
- CodeDOMProvider.cs
- MouseEventArgs.cs
- TransferMode.cs
- UnionCodeGroup.cs
- VectorAnimation.cs
- LongValidatorAttribute.cs
- RuntimeArgumentHandle.cs
- NativeMethods.cs
- PerfService.cs
- UnicastIPAddressInformationCollection.cs
- IChannel.cs
- ElementProxy.cs
- XmlCDATASection.cs
- WebBrowserDocumentCompletedEventHandler.cs
- MessagingDescriptionAttribute.cs
- DecoderExceptionFallback.cs
- Root.cs
- XmlParserContext.cs
- Pair.cs
- CookieProtection.cs
- InstanceCreationEditor.cs
- EncodedStreamFactory.cs
- NumericUpDown.cs
- LicFileLicenseProvider.cs
- PositiveTimeSpanValidator.cs
- EntityViewGenerationAttribute.cs
- WindowsListViewGroupHelper.cs
- SymmetricKeyWrap.cs