Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- X509InitiatorCertificateClientElement.cs
- MetaChildrenColumn.cs
- OperandQuery.cs
- ErrorInfoXmlDocument.cs
- BaseConfigurationRecord.cs
- SerializationSectionGroup.cs
- TimeSpanSecondsConverter.cs
- DateTimeFormat.cs
- WpfPayload.cs
- Cursor.cs
- CfgParser.cs
- RangeValuePatternIdentifiers.cs
- SmiEventSink_DeferedProcessing.cs
- ContextMenuStripGroupCollection.cs
- VarRemapper.cs
- WSHttpTransportSecurityElement.cs
- Int32CAMarshaler.cs
- PenThread.cs
- Int32Rect.cs
- SequenceDesignerAccessibleObject.cs
- MultiDataTrigger.cs
- ConstraintEnumerator.cs
- TextComposition.cs
- ResourceReferenceKeyNotFoundException.cs
- DispatcherHookEventArgs.cs
- TextParentUndoUnit.cs
- WorkflowRuntimeSection.cs
- ReferentialConstraintRoleElement.cs
- MSAANativeProvider.cs
- BamlRecordWriter.cs
- LabelAutomationPeer.cs
- DataControlImageButton.cs
- SkewTransform.cs
- ReaderOutput.cs
- ManagedWndProcTracker.cs
- ProfessionalColors.cs
- CounterSample.cs
- SQLInt32Storage.cs
- DesignTimeDataBinding.cs
- CommentEmitter.cs
- ReverseInheritProperty.cs
- NetCodeGroup.cs
- Repeater.cs
- OleDbEnumerator.cs
- TreeNodeMouseHoverEvent.cs
- EventLog.cs
- DataGridState.cs
- mda.cs
- TextEvent.cs
- WorkflowInstanceTerminatedRecord.cs
- EnvelopedPkcs7.cs
- FaultDesigner.cs
- CookieHandler.cs
- SafeReversePInvokeHandle.cs
- SingleTagSectionHandler.cs
- DecoderNLS.cs
- FormsAuthenticationTicket.cs
- TransformPatternIdentifiers.cs
- AccessDataSourceWizardForm.cs
- AnnouncementService.cs
- FillRuleValidation.cs
- PropertyInformation.cs
- DecimalConverter.cs
- ClientSettingsSection.cs
- XamlInt32CollectionSerializer.cs
- MSHTMLHost.cs
- ApplicationId.cs
- ToolStripContentPanelDesigner.cs
- StringTraceRecord.cs
- PartialCachingControl.cs
- SettingsPropertyIsReadOnlyException.cs
- InstanceHandleConflictException.cs
- SortKey.cs
- ResourceSetExpression.cs
- GridViewRowCollection.cs
- GatewayDefinition.cs
- ManifestResourceInfo.cs
- cryptoapiTransform.cs
- OleStrCAMarshaler.cs
- SimpleWebHandlerParser.cs
- AsyncCompletedEventArgs.cs
- TraceHwndHost.cs
- Compiler.cs
- DrawingCollection.cs
- ToolStripScrollButton.cs
- FontUnitConverter.cs
- RegexParser.cs
- SessionState.cs
- Condition.cs
- SmiMetaData.cs
- DocumentSchemaValidator.cs
- TreeChangeInfo.cs
- FloaterBaseParaClient.cs
- WindowsListViewGroupHelper.cs
- SafeRegistryHandle.cs
- SqlNode.cs
- FormParameter.cs
- TextRunCache.cs
- OptimisticConcurrencyException.cs
- IdnElement.cs