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
- SortedDictionary.cs
- FontFamilyConverter.cs
- XmlUtilWriter.cs
- XmlElementCollection.cs
- ZipIOLocalFileBlock.cs
- Utils.cs
- SqlDataSourceQueryEditorForm.cs
- Aggregates.cs
- Helpers.cs
- Completion.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- IApplicationTrustManager.cs
- AgileSafeNativeMemoryHandle.cs
- UntypedNullExpression.cs
- CopyEncoder.cs
- SQLResource.cs
- UiaCoreApi.cs
- MenuStrip.cs
- Random.cs
- recordstate.cs
- QualifiedCellIdBoolean.cs
- RSACryptoServiceProvider.cs
- CryptoKeySecurity.cs
- DataList.cs
- StorageAssociationTypeMapping.cs
- Rfc2898DeriveBytes.cs
- PrintingPermissionAttribute.cs
- Duration.cs
- TitleStyle.cs
- Rss20ItemFormatter.cs
- WindowsFont.cs
- InputScopeConverter.cs
- AvtEvent.cs
- RegexCapture.cs
- Image.cs
- Package.cs
- DesignerTextViewAdapter.cs
- EnumBuilder.cs
- DoubleAnimationUsingPath.cs
- TraceEventCache.cs
- StickyNote.cs
- MetadataPropertyvalue.cs
- FixedFindEngine.cs
- TrackingRecord.cs
- CharKeyFrameCollection.cs
- HistoryEventArgs.cs
- EditorZoneBase.cs
- StateManagedCollection.cs
- PropertyDescriptorComparer.cs
- PrivilegeNotHeldException.cs
- XmlFormatReaderGenerator.cs
- DropDownList.cs
- QuotaExceededException.cs
- ServiceReference.cs
- HostingEnvironment.cs
- EditorAttribute.cs
- ToolStripContentPanelDesigner.cs
- SafeSecurityHandles.cs
- HttpCacheVary.cs
- CompilerLocalReference.cs
- DiscoveryClientDuplexChannel.cs
- CompModSwitches.cs
- TextPattern.cs
- ConditionedDesigner.cs
- Component.cs
- ThousandthOfEmRealDoubles.cs
- DataSourceControlBuilder.cs
- TreeView.cs
- InputLanguageSource.cs
- InputScope.cs
- PerformanceCounter.cs
- SystemEvents.cs
- GPRECTF.cs
- PathSegment.cs
- ObjectDataSourceMethodEditor.cs
- WebPartDescriptionCollection.cs
- TextLineBreak.cs
- VectorCollection.cs
- DispatcherOperation.cs
- BindingList.cs
- ImageButton.cs
- BaseDataBoundControl.cs
- MainMenu.cs
- SerializableAttribute.cs
- ListSourceHelper.cs
- UserValidatedEventArgs.cs
- ListViewTableRow.cs
- DriveInfo.cs
- PerformanceCounterPermissionEntryCollection.cs
- GZipStream.cs
- FixedPageStructure.cs
- XmlObjectSerializerWriteContext.cs
- XmlParserContext.cs
- MetadataArtifactLoaderResource.cs
- RtfToken.cs
- ListViewItemMouseHoverEvent.cs
- DiagnosticsConfiguration.cs
- QueryResults.cs
- XmlQueryStaticData.cs
- UpdatePanel.cs