Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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
- shaperfactoryquerycachekey.cs
- Directory.cs
- GuidTagList.cs
- RoleService.cs
- StorageComplexTypeMapping.cs
- MarshalByRefObject.cs
- RbTree.cs
- QilList.cs
- validationstate.cs
- CompilationRelaxations.cs
- WindowsTooltip.cs
- MachineSettingsSection.cs
- HttpProfileGroupBase.cs
- HWStack.cs
- SpeechDetectedEventArgs.cs
- HttpCookiesSection.cs
- SymbolEqualComparer.cs
- GeneralTransform3DGroup.cs
- PolicyUnit.cs
- KeyValueSerializer.cs
- ByteConverter.cs
- wgx_render.cs
- HtmlControlPersistable.cs
- MailAddressParser.cs
- StateItem.cs
- ProfileServiceManager.cs
- Listen.cs
- EntryIndex.cs
- ReliabilityContractAttribute.cs
- TextDecorationCollectionConverter.cs
- ToolStripMenuItemDesigner.cs
- BitmapEffectInputData.cs
- FileDialog_Vista.cs
- TrackingExtract.cs
- SqlUtils.cs
- GridViewEditEventArgs.cs
- ObjectPersistData.cs
- SmiEventSink_DeferedProcessing.cs
- HyperLink.cs
- DesignerVerbCollection.cs
- QilDataSource.cs
- HttpEncoder.cs
- VirtualizedCellInfoCollection.cs
- DetailsViewInsertEventArgs.cs
- ConfigXmlCDataSection.cs
- TemplateControlCodeDomTreeGenerator.cs
- BackgroundFormatInfo.cs
- WsdlExporter.cs
- DelegatingHeader.cs
- XmlNamespaceMapping.cs
- PointCollection.cs
- EditorPartDesigner.cs
- CheckBoxBaseAdapter.cs
- NetPipeSection.cs
- SoapAttributeOverrides.cs
- DragEvent.cs
- CodeNamespace.cs
- Console.cs
- StringComparer.cs
- DtrList.cs
- Tablet.cs
- FieldToken.cs
- HtmlInputPassword.cs
- XmlSchemaChoice.cs
- SqlProvider.cs
- XmlSchemaResource.cs
- ListViewGroup.cs
- EventBuilder.cs
- Rss20FeedFormatter.cs
- SizeAnimationBase.cs
- basenumberconverter.cs
- RadioButtonStandardAdapter.cs
- DataPagerFieldCommandEventArgs.cs
- SessionStateContainer.cs
- IgnoreFileBuildProvider.cs
- RoutedEvent.cs
- StoreConnection.cs
- ResXResourceSet.cs
- PersistenceTypeAttribute.cs
- ListDictionaryInternal.cs
- KeySplineConverter.cs
- ExecutionProperties.cs
- ObjectDataSourceView.cs
- StandardBindingElementCollection.cs
- ScriptReferenceBase.cs
- SamlNameIdentifierClaimResource.cs
- ExtensibleClassFactory.cs
- RegexGroup.cs
- DataErrorValidationRule.cs
- Trace.cs
- SQLInt64Storage.cs
- ReflectionTypeLoadException.cs
- SafeArchiveContext.cs
- TreeNodeCollectionEditor.cs
- BackgroundFormatInfo.cs
- ColumnWidthChangingEvent.cs
- FolderBrowserDialog.cs
- TargetException.cs
- DataGridTextBoxColumn.cs
- EventBuilder.cs