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
- ChildChangedEventArgs.cs
- CompilerGlobalScopeAttribute.cs
- HtmlHead.cs
- CaseStatementSlot.cs
- Expander.cs
- ProcessManager.cs
- NativeMethodsOther.cs
- recordstatefactory.cs
- FontCacheLogic.cs
- RealProxy.cs
- HighlightVisual.cs
- ClientSideQueueItem.cs
- IDReferencePropertyAttribute.cs
- CalendarTable.cs
- PanelContainerDesigner.cs
- WsdlParser.cs
- LoadRetryHandler.cs
- QfeChecker.cs
- DataGridViewImageColumn.cs
- ExpandedProjectionNode.cs
- Wildcard.cs
- ContractInferenceHelper.cs
- SubstitutionList.cs
- WindowsFormsLinkLabel.cs
- DecoderExceptionFallback.cs
- MenuAdapter.cs
- SID.cs
- Helper.cs
- TakeOrSkipQueryOperator.cs
- EventSourceCreationData.cs
- WebPartEventArgs.cs
- HttpCookie.cs
- Size.cs
- mediaeventshelper.cs
- MulticastIPAddressInformationCollection.cs
- AppModelKnownContentFactory.cs
- NumberFunctions.cs
- XamlSerializerUtil.cs
- ConnectionManagementSection.cs
- ObjectContextServiceProvider.cs
- DockPanel.cs
- GeometryHitTestParameters.cs
- ExpressionLexer.cs
- ClientRuntimeConfig.cs
- ObjectManager.cs
- CodeMethodInvokeExpression.cs
- recordstatescratchpad.cs
- HtmlControlPersistable.cs
- WebScriptEnablingBehavior.cs
- ImageAutomationPeer.cs
- XmlDataSource.cs
- ResourceType.cs
- SqlDataSourceDesigner.cs
- EarlyBoundInfo.cs
- HashSetDebugView.cs
- ChangeConflicts.cs
- UnsafeNativeMethods.cs
- WithStatement.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- XamlParser.cs
- XmlAttributeCollection.cs
- XsltQilFactory.cs
- UIElementParaClient.cs
- FreezableCollection.cs
- SqlGatherConsumedAliases.cs
- PointCollectionConverter.cs
- PersistNameAttribute.cs
- ColorAnimationBase.cs
- ListViewGroupItemCollection.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- HWStack.cs
- NumericUpDownAccelerationCollection.cs
- TypeElementCollection.cs
- ItemAutomationPeer.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- _IPv6Address.cs
- ColorPalette.cs
- StylusPlugin.cs
- ReachUIElementCollectionSerializer.cs
- ExpressionVisitorHelpers.cs
- ValidationErrorCollection.cs
- EncodingNLS.cs
- HierarchicalDataTemplate.cs
- RectConverter.cs
- ClientSideProviderDescription.cs
- InteropEnvironment.cs
- WasEndpointConfigContainer.cs
- WebBrowserContainer.cs
- ComplexLine.cs
- InheritablePropertyChangeInfo.cs
- LineServicesCallbacks.cs
- Span.cs
- Set.cs
- fixedPageContentExtractor.cs
- EpmCustomContentDeSerializer.cs
- Int64KeyFrameCollection.cs
- NetworkStream.cs
- CharAnimationUsingKeyFrames.cs
- TextSelectionHighlightLayer.cs
- CodeGotoStatement.cs