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
- XPathExpr.cs
- SchemaDeclBase.cs
- AuthenticationManager.cs
- XmlNodeComparer.cs
- GridViewCancelEditEventArgs.cs
- QilName.cs
- PageEventArgs.cs
- XamlFrame.cs
- ToolStripContentPanelRenderEventArgs.cs
- AsyncStreamReader.cs
- LicenseProviderAttribute.cs
- EntityContainerRelationshipSet.cs
- PropertyEntry.cs
- Error.cs
- SystemIPv4InterfaceProperties.cs
- DataObjectCopyingEventArgs.cs
- HtmlTableRowCollection.cs
- ObjectItemNoOpAssemblyLoader.cs
- FilteredAttributeCollection.cs
- Visual3D.cs
- RadioButton.cs
- QueryStatement.cs
- EmptyCollection.cs
- Selection.cs
- BuildProviderAppliesToAttribute.cs
- ChannelSettingsElement.cs
- Mappings.cs
- DataTemplate.cs
- OrderedEnumerableRowCollection.cs
- ValueTable.cs
- ZoneLinkButton.cs
- NetworkStream.cs
- SQLInt64.cs
- PassportAuthenticationModule.cs
- OleDbFactory.cs
- MemberHolder.cs
- ProfileParameter.cs
- ComplexPropertyEntry.cs
- CrossSiteScriptingValidation.cs
- SqlUdtInfo.cs
- NullableFloatSumAggregationOperator.cs
- loginstatus.cs
- DataServiceException.cs
- XPathQueryGenerator.cs
- XMLSyntaxException.cs
- RawStylusInput.cs
- CodeAttributeDeclaration.cs
- TextTreePropertyUndoUnit.cs
- ExpandedProjectionNode.cs
- DbDataRecord.cs
- XmlSchemaSet.cs
- IPEndPointCollection.cs
- XMLUtil.cs
- ErrorWebPart.cs
- TimeSpanConverter.cs
- DateTimeParse.cs
- XmlSchemaObjectTable.cs
- DataGridViewColumn.cs
- VideoDrawing.cs
- SpeechAudioFormatInfo.cs
- EllipseGeometry.cs
- Odbc32.cs
- Viewport3DAutomationPeer.cs
- TextSchema.cs
- ConfigXmlComment.cs
- ObjectStateManagerMetadata.cs
- ASCIIEncoding.cs
- InkCollectionBehavior.cs
- HttpContext.cs
- ContentPresenter.cs
- PeerFlooder.cs
- SingleBodyParameterMessageFormatter.cs
- CodeVariableDeclarationStatement.cs
- WindowsPrincipal.cs
- ReadOnlyState.cs
- Attributes.cs
- XdrBuilder.cs
- DoubleStorage.cs
- M3DUtil.cs
- Int64KeyFrameCollection.cs
- ProxyGenerationError.cs
- MethodAccessException.cs
- DoubleStorage.cs
- WebPartVerb.cs
- DateTimeUtil.cs
- TranslateTransform.cs
- LineSegment.cs
- GridViewDeletedEventArgs.cs
- DataControlFieldCollection.cs
- SafePEFileHandle.cs
- CodeMemberProperty.cs
- ImpersonationContext.cs
- HyperLinkStyle.cs
- NestedContainer.cs
- TrustSection.cs
- ToolbarAUtomationPeer.cs
- ThaiBuddhistCalendar.cs
- PerformanceCountersElement.cs
- ColumnClickEvent.cs
- GeneralTransform3DCollection.cs