Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / SingleConverter.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RotateTransform3D.cs
- TriggerAction.cs
- WhitespaceRuleLookup.cs
- Int32Collection.cs
- ConfigurationSchemaErrors.cs
- SqlConnectionString.cs
- SmiXetterAccessMap.cs
- HttpAsyncResult.cs
- BitmapEffectInputConnector.cs
- MobileComponentEditorPage.cs
- IntPtr.cs
- ObservableDictionary.cs
- ApplicationException.cs
- FileSecurity.cs
- xdrvalidator.cs
- BufferedGraphics.cs
- WorkflowServiceHost.cs
- ManipulationStartedEventArgs.cs
- ProtocolException.cs
- HttpApplication.cs
- InheritanceService.cs
- ContentFileHelper.cs
- SapiGrammar.cs
- DeadCharTextComposition.cs
- FixedStringLookup.cs
- FileInfo.cs
- ParallelActivityDesigner.cs
- DataControlField.cs
- GrammarBuilderDictation.cs
- RoutedEvent.cs
- LinkGrep.cs
- CmsInterop.cs
- XmlFormatWriterGenerator.cs
- ComponentConverter.cs
- EncoderReplacementFallback.cs
- TableCell.cs
- FontSource.cs
- CqlQuery.cs
- Gdiplus.cs
- ExpressionCopier.cs
- Constraint.cs
- SByteStorage.cs
- NameTable.cs
- ExpressionBindingCollection.cs
- StateDesigner.cs
- TimersDescriptionAttribute.cs
- LogicalTreeHelper.cs
- SchemaSetCompiler.cs
- SRGSCompiler.cs
- Certificate.cs
- FixedTextSelectionProcessor.cs
- RuleInfoComparer.cs
- Margins.cs
- DefaultValueAttribute.cs
- RepeatButtonAutomationPeer.cs
- XmlSignificantWhitespace.cs
- HiddenField.cs
- DBDataPermission.cs
- EntityDataSourceDataSelectionPanel.cs
- CapabilitiesState.cs
- ShimAsPublicXamlType.cs
- Trace.cs
- Grid.cs
- HwndStylusInputProvider.cs
- CharAnimationUsingKeyFrames.cs
- SQLResource.cs
- FileInfo.cs
- Form.cs
- TreeNodeStyle.cs
- VisualBrush.cs
- Glyph.cs
- WebPartsSection.cs
- ObjectReferenceStack.cs
- KeyNotFoundException.cs
- TrackingStringDictionary.cs
- ProvidePropertyAttribute.cs
- VerificationException.cs
- LineSegment.cs
- Popup.cs
- dbdatarecord.cs
- CompilationUnit.cs
- SrgsGrammar.cs
- CodeParameterDeclarationExpression.cs
- InvokeProviderWrapper.cs
- DbParameterHelper.cs
- SwitchElementsCollection.cs
- CustomAttribute.cs
- FileDialog.cs
- ConstraintConverter.cs
- SafeThemeHandle.cs
- SectionInput.cs
- CompressedStack.cs
- ServicePointManager.cs
- ConstraintConverter.cs
- ProgramPublisher.cs
- Renderer.cs
- LinqDataSourceDisposeEventArgs.cs
- SmtpFailedRecipientException.cs
- InitializerFacet.cs
- SchemaCreator.cs