Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / DoubleConverter.cs / 1 / DoubleConverter.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 DoubleConverter : BaseNumberConverter { ///Provides a type /// converter to convert double-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(Double); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToDouble(value, CultureInfo.CurrentCulture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Double.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 Double.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Double)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 DoubleConverter : BaseNumberConverter { ///Provides a type /// converter to convert double-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(Double); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToDouble(value, CultureInfo.CurrentCulture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Double.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 Double.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Double)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
- EditorPartChrome.cs
- SmiMetaDataProperty.cs
- FormClosedEvent.cs
- ChangePassword.cs
- DataRelationPropertyDescriptor.cs
- EndPoint.cs
- ObjectDataSourceMethodEventArgs.cs
- SqlServer2KCompatibilityAnnotation.cs
- NavigationCommands.cs
- CodeThrowExceptionStatement.cs
- BindMarkupExtensionSerializer.cs
- TrackingProfile.cs
- ObjectRef.cs
- DataControlFieldCollection.cs
- Validator.cs
- GridViewSelectEventArgs.cs
- MimeMapping.cs
- InternalBase.cs
- DataBindingExpressionBuilder.cs
- BrowsableAttribute.cs
- Int16.cs
- HtmlGenericControl.cs
- ScrollChangedEventArgs.cs
- SafeFileMapViewHandle.cs
- Stacktrace.cs
- FixedDocumentSequencePaginator.cs
- FieldNameLookup.cs
- LowerCaseStringConverter.cs
- WebPartVerbsEventArgs.cs
- XmlSchemaExporter.cs
- ToolStripRenderer.cs
- FontWeightConverter.cs
- BoundingRectTracker.cs
- VectorCollectionConverter.cs
- WebPartConnectionsConnectVerb.cs
- NamespaceDisplay.xaml.cs
- Application.cs
- FormsAuthenticationUserCollection.cs
- TemplateBaseAction.cs
- Lease.cs
- GenerateTemporaryAssemblyTask.cs
- SizeChangedEventArgs.cs
- XmlCDATASection.cs
- AspCompat.cs
- PageSetupDialog.cs
- TargetConverter.cs
- DataGridColumnReorderingEventArgs.cs
- EntityKey.cs
- ComplexPropertyEntry.cs
- MergeFilterQuery.cs
- CheckBoxAutomationPeer.cs
- SqlProfileProvider.cs
- OdbcError.cs
- ObjectTokenCategory.cs
- GeneratedView.cs
- ViewLoader.cs
- SoapSchemaExporter.cs
- Clause.cs
- SecurityContext.cs
- InputLanguage.cs
- ConsumerConnectionPointCollection.cs
- AmbiguousMatchException.cs
- ConfigurationException.cs
- CheckBox.cs
- EnumBuilder.cs
- BaseParser.cs
- GridSplitter.cs
- TriggerBase.cs
- InitializeCorrelation.cs
- MissingFieldException.cs
- OdbcInfoMessageEvent.cs
- InheritanceContextHelper.cs
- TableNameAttribute.cs
- M3DUtil.cs
- manifestimages.cs
- WpfPayload.cs
- Accessors.cs
- ModelEditingScope.cs
- SQLInt64Storage.cs
- Soap.cs
- Rotation3DKeyFrameCollection.cs
- SqlClientWrapperSmiStream.cs
- DocumentViewerHelper.cs
- QilFactory.cs
- WebPartsPersonalizationAuthorization.cs
- Point4DValueSerializer.cs
- UIElementCollection.cs
- XmlDataCollection.cs
- EventLogConfiguration.cs
- SoapClientMessage.cs
- StatusBarAutomationPeer.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SecurityKeyUsage.cs
- CustomBinding.cs
- ZipIOBlockManager.cs
- ChildrenQuery.cs
- TextDecorationUnitValidation.cs
- AttributeCollection.cs
- CryptoApi.cs
- EpmCustomContentWriterNodeData.cs