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
- TargetControlTypeCache.cs
- FunctionUpdateCommand.cs
- RenamedEventArgs.cs
- CodeCatchClauseCollection.cs
- DataGridColumnHeaderAutomationPeer.cs
- ValidationError.cs
- Int32Rect.cs
- ContractHandle.cs
- PolicyLevel.cs
- SiteMapNodeItem.cs
- RelationshipType.cs
- QilIterator.cs
- httpapplicationstate.cs
- FileLogRecordStream.cs
- ReturnType.cs
- SiteMap.cs
- Dispatcher.cs
- SettingsPropertyIsReadOnlyException.cs
- CompilerGeneratedAttribute.cs
- ClientTarget.cs
- XmlMemberMapping.cs
- ContentElement.cs
- EnumerableRowCollection.cs
- MatrixTransform.cs
- BaseCollection.cs
- SymLanguageType.cs
- WrappedIUnknown.cs
- Adorner.cs
- ItemChangedEventArgs.cs
- HwndAppCommandInputProvider.cs
- RemoteWebConfigurationHost.cs
- PersonalizationStateQuery.cs
- ReadOnlyCollection.cs
- VersionPair.cs
- StrokeNodeData.cs
- MinMaxParagraphWidth.cs
- EDesignUtil.cs
- DirectionalLight.cs
- Rfc2898DeriveBytes.cs
- BindingElement.cs
- XmlMapping.cs
- ActivityBindForm.cs
- ConfigXmlAttribute.cs
- XmlObjectSerializerReadContextComplexJson.cs
- EncodingFallbackAwareXmlTextWriter.cs
- SchemaTableColumn.cs
- IdentityNotMappedException.cs
- Page.cs
- LabelEditEvent.cs
- JournalEntry.cs
- CallContext.cs
- SqlUserDefinedAggregateAttribute.cs
- BitVec.cs
- CodeArrayIndexerExpression.cs
- OrthographicCamera.cs
- CollectionView.cs
- StringWriter.cs
- ProviderCommandInfoUtils.cs
- TypedElement.cs
- XmlValidatingReader.cs
- SafeNativeMethods.cs
- ClientSettingsSection.cs
- DeobfuscatingStream.cs
- MruCache.cs
- EnumMemberAttribute.cs
- ColorAnimationUsingKeyFrames.cs
- JapaneseLunisolarCalendar.cs
- TabControl.cs
- MulticastNotSupportedException.cs
- BCLDebug.cs
- PostBackOptions.cs
- CustomErrorCollection.cs
- PathGeometry.cs
- DataExchangeServiceBinder.cs
- SelectorItemAutomationPeer.cs
- TypeDescriptor.cs
- PrefixHandle.cs
- WebPartMenu.cs
- CookielessHelper.cs
- XsdDateTime.cs
- XmlBindingWorker.cs
- Monitor.cs
- Attachment.cs
- PasswordBoxAutomationPeer.cs
- TreeNode.cs
- Freezable.cs
- HttpCachePolicy.cs
- AccessViolationException.cs
- QilStrConcatenator.cs
- TextElementEditingBehaviorAttribute.cs
- TypeRefElement.cs
- CFStream.cs
- DataBinder.cs
- CaseCqlBlock.cs
- DockAndAnchorLayout.cs
- ScriptControl.cs
- FileVersion.cs
- TaiwanLunisolarCalendar.cs
- Subordinate.cs
- PrintingPermissionAttribute.cs