Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / SingleConverter.cs / 1305376 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PermissionAttributes.cs
- HttpModuleActionCollection.cs
- WindowsAuthenticationModule.cs
- UnSafeCharBuffer.cs
- SparseMemoryStream.cs
- PaperSource.cs
- SHA512Cng.cs
- FindCompletedEventArgs.cs
- DBConnectionString.cs
- FileUpload.cs
- figurelengthconverter.cs
- ProcessModelInfo.cs
- ContractInstanceProvider.cs
- XmlDataSourceView.cs
- InputReportEventArgs.cs
- ControlParameter.cs
- EnumDataContract.cs
- TypeDependencyAttribute.cs
- ConcurrentDictionary.cs
- WindowAutomationPeer.cs
- CompensationTokenData.cs
- EntityContainerEntitySet.cs
- PropertyGridCommands.cs
- AvTraceFormat.cs
- RequestQueue.cs
- Utility.cs
- HtmlTableCellCollection.cs
- WebPartConnection.cs
- SqlRowUpdatedEvent.cs
- ComponentCollection.cs
- DataRecordInfo.cs
- PerspectiveCamera.cs
- QilVisitor.cs
- VectorKeyFrameCollection.cs
- WebRequestModuleElement.cs
- AttributeQuery.cs
- RectAnimationUsingKeyFrames.cs
- ScriptingWebServicesSectionGroup.cs
- HtmlLink.cs
- SHA256Cng.cs
- ActivityBuilder.cs
- SqlDelegatedTransaction.cs
- PriorityQueue.cs
- BoolExpr.cs
- ListItemConverter.cs
- LineSegment.cs
- CodeTypeDelegate.cs
- ItemsPanelTemplate.cs
- DrawingServices.cs
- WindowsFont.cs
- XmlSiteMapProvider.cs
- UserControl.cs
- smtppermission.cs
- Baml2006ReaderContext.cs
- ManagementOptions.cs
- PolicyLevel.cs
- MessageHeaders.cs
- RectConverter.cs
- ToolStripCustomTypeDescriptor.cs
- SqlStream.cs
- ExclusiveTcpListener.cs
- StringResourceManager.cs
- InputLangChangeEvent.cs
- DataGridViewLinkColumn.cs
- Context.cs
- DataServiceProviderMethods.cs
- CleanUpVirtualizedItemEventArgs.cs
- XhtmlBasicImageAdapter.cs
- CompositeKey.cs
- WindowsSysHeader.cs
- WmfPlaceableFileHeader.cs
- SystemIcons.cs
- CopyOfAction.cs
- SafeNativeMethods.cs
- StrokeDescriptor.cs
- MetafileHeaderEmf.cs
- DrawItemEvent.cs
- RegularExpressionValidator.cs
- LineSegment.cs
- TableLayoutStyleCollection.cs
- ResourceDescriptionAttribute.cs
- GeometryHitTestParameters.cs
- DisplayNameAttribute.cs
- LinkConverter.cs
- SiteOfOriginPart.cs
- WhitespaceRuleReader.cs
- SettingsSavedEventArgs.cs
- ApplicationDirectoryMembershipCondition.cs
- HandlerBase.cs
- GlyphShapingProperties.cs
- HandlerBase.cs
- ReflectPropertyDescriptor.cs
- X509RawDataKeyIdentifierClause.cs
- SamlDelegatingWriter.cs
- ThemeDictionaryExtension.cs
- ZoneLinkButton.cs
- FileLevelControlBuilderAttribute.cs
- AspNetHostingPermission.cs
- ButtonFieldBase.cs
- Attributes.cs