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
- DeflateStream.cs
- DesigntimeLicenseContext.cs
- WpfKnownType.cs
- _DomainName.cs
- PageAsyncTask.cs
- FtpWebResponse.cs
- LexicalChunk.cs
- InheritanceAttribute.cs
- SqlDataSourceEnumerator.cs
- Exceptions.cs
- ReferentialConstraint.cs
- IncrementalHitTester.cs
- DataKey.cs
- CancellationToken.cs
- QueueAccessMode.cs
- CngKey.cs
- ConfigXmlCDataSection.cs
- HtmlEncodedRawTextWriter.cs
- PageBreakRecord.cs
- WorkflowNamespace.cs
- RuntimeHelpers.cs
- DropDownHolder.cs
- DependencyObjectProvider.cs
- DataSvcMapFile.cs
- Int16KeyFrameCollection.cs
- ValidationErrorEventArgs.cs
- ListControl.cs
- UIPermission.cs
- RawMouseInputReport.cs
- BindingListCollectionView.cs
- SecurityPermission.cs
- CompilerScopeManager.cs
- WaitHandle.cs
- UIPropertyMetadata.cs
- NavigationCommands.cs
- TextEditorSelection.cs
- UnsafeNativeMethods.cs
- oledbmetadatacolumnnames.cs
- SerializableAuthorizationContext.cs
- NetStream.cs
- OleDbEnumerator.cs
- ColorTransform.cs
- SoapReflectionImporter.cs
- SemanticResolver.cs
- QilPatternFactory.cs
- TokenBasedSetEnumerator.cs
- TextPatternIdentifiers.cs
- SQLInt32Storage.cs
- SystemGatewayIPAddressInformation.cs
- RegexCompilationInfo.cs
- StrokeFIndices.cs
- TdsValueSetter.cs
- GenericTypeParameterBuilder.cs
- CurrentTimeZone.cs
- CrossContextChannel.cs
- ToolBarOverflowPanel.cs
- Rect3DValueSerializer.cs
- FastPropertyAccessor.cs
- XslAst.cs
- ListViewInsertedEventArgs.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- RowUpdatedEventArgs.cs
- XmlConverter.cs
- Selection.cs
- DefaultTraceListener.cs
- JobCollate.cs
- LicenseManager.cs
- ObjectKeyFrameCollection.cs
- DispatcherObject.cs
- EntityDataSourceDataSelectionPanel.cs
- ButtonBaseAdapter.cs
- ViewStateModeByIdAttribute.cs
- Trace.cs
- GetPageNumberCompletedEventArgs.cs
- SchemaElement.cs
- SmiSettersStream.cs
- OutOfMemoryException.cs
- CodeGotoStatement.cs
- CompatibleIComparer.cs
- VariableBinder.cs
- AnalyzedTree.cs
- SapiRecognizer.cs
- BuildProviderAppliesToAttribute.cs
- Enum.cs
- CompilerGeneratedAttribute.cs
- MouseDevice.cs
- CounterSetInstanceCounterDataSet.cs
- FlowDocument.cs
- Interlocked.cs
- PropertyTabChangedEvent.cs
- HtmlInputButton.cs
- SimpleType.cs
- AsyncOperation.cs
- BuiltInPermissionSets.cs
- NaturalLanguageHyphenator.cs
- ListView.cs
- VisualStyleElement.cs
- CookieParameter.cs
- EnumerableRowCollection.cs
- DriveInfo.cs