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
- Renderer.cs
- ConfigurationException.cs
- SystemIcmpV6Statistics.cs
- ConnectionPoint.cs
- XmlQueryTypeFactory.cs
- ProcessInfo.cs
- ExceptionRoutedEventArgs.cs
- ContextBase.cs
- TextControlDesigner.cs
- ConstraintManager.cs
- WebPartVerb.cs
- _AutoWebProxyScriptEngine.cs
- XmlMembersMapping.cs
- Screen.cs
- SchemaCollectionPreprocessor.cs
- SplitterCancelEvent.cs
- DeploymentSection.cs
- XmlElementCollection.cs
- Primitive.cs
- SqlFormatter.cs
- Point.cs
- FunctionParameter.cs
- TemplateContentLoader.cs
- HttpChannelBindingToken.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- ResourceManagerWrapper.cs
- SapiRecognizer.cs
- InvalidCommandTreeException.cs
- Line.cs
- Gdiplus.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- XslUrlEditor.cs
- CodeActivity.cs
- EdmConstants.cs
- WebServiceParameterData.cs
- PriorityQueue.cs
- XmlIgnoreAttribute.cs
- TdsEnums.cs
- HttpRequestContext.cs
- TextLineBreak.cs
- GeneralTransform3D.cs
- TimelineClockCollection.cs
- Funcletizer.cs
- ExitEventArgs.cs
- ExitEventArgs.cs
- BookmarkWorkItem.cs
- GeneratedContractType.cs
- TextMarkerSource.cs
- XmlSchemaException.cs
- NamedElement.cs
- CodeStatementCollection.cs
- DomNameTable.cs
- TypeInitializationException.cs
- Mutex.cs
- AsmxEndpointPickerExtension.cs
- ListViewInsertEventArgs.cs
- Activity.cs
- BamlLocalizer.cs
- QilXmlWriter.cs
- IBuiltInEvidence.cs
- httpserverutility.cs
- EntityProxyTypeInfo.cs
- InvalidPipelineStoreException.cs
- CustomErrorsSectionWrapper.cs
- ModuleConfigurationInfo.cs
- HtmlForm.cs
- SqlWriter.cs
- DictionaryGlobals.cs
- WindowsFormsSynchronizationContext.cs
- TimeoutTimer.cs
- BehaviorEditorPart.cs
- HttpInputStream.cs
- ExecutedRoutedEventArgs.cs
- SqlUtil.cs
- KeyBinding.cs
- EventLogPermissionEntry.cs
- ToolboxDataAttribute.cs
- LocalIdKeyIdentifierClause.cs
- MediaScriptCommandRoutedEventArgs.cs
- XmlSchemaImport.cs
- ExpressionsCollectionEditor.cs
- InfoCardServiceInstallComponent.cs
- SQLMoney.cs
- DeferredReference.cs
- EntityRecordInfo.cs
- ACL.cs
- Clock.cs
- ScanQueryOperator.cs
- DataGridViewRowHeaderCell.cs
- Point3DCollection.cs
- ListSurrogate.cs
- EventData.cs
- EmptyEnumerator.cs
- EventMappingSettings.cs
- Update.cs
- CacheDict.cs
- SqlFunctionAttribute.cs
- SwitchAttribute.cs
- AssemblyNameEqualityComparer.cs
- WorkflowElementDialog.cs