Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / Int64Converter.cs / 1 / Int64Converter.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;
///
/// Provides a type converter to convert 64-bit signed integer objects to and
/// from various other representations.
///
[HostProtection(SharedState = true)]
public class Int64Converter : BaseNumberConverter {
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(Int64);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToInt64(value, radix);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return Int64.Parse(value, NumberStyles.Integer, formatInfo);
}
///
/// Convert the given value to a string using the given CultureInfo
///
internal override object FromString(string value, CultureInfo culture){
return Int64.Parse(value, culture);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((Int64)value).ToString("G", 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;
///
/// Provides a type converter to convert 64-bit signed integer objects to and
/// from various other representations.
///
[HostProtection(SharedState = true)]
public class Int64Converter : BaseNumberConverter {
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(Int64);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToInt64(value, radix);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return Int64.Parse(value, NumberStyles.Integer, formatInfo);
}
///
/// Convert the given value to a string using the given CultureInfo
///
internal override object FromString(string value, CultureInfo culture){
return Int64.Parse(value, culture);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((Int64)value).ToString("G", 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
- ObjectListDataBindEventArgs.cs
- HttpContextBase.cs
- ObjectStateEntryDbDataRecord.cs
- CqlLexerHelpers.cs
- Base64Decoder.cs
- WizardPanelChangingEventArgs.cs
- BrowserCapabilitiesFactory.cs
- TextContainerHelper.cs
- TableFieldsEditor.cs
- ArraySegment.cs
- XmlWriterSettings.cs
- CallSiteOps.cs
- OutputCacheEntry.cs
- Variable.cs
- ReachDocumentPageSerializerAsync.cs
- ZipIOModeEnforcingStream.cs
- BaseCollection.cs
- UIElementParaClient.cs
- SwitchAttribute.cs
- CqlLexerHelpers.cs
- MemberRelationshipService.cs
- Profiler.cs
- WSHttpBindingCollectionElement.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- LinearKeyFrames.cs
- DeploymentSectionCache.cs
- webclient.cs
- PageAsyncTaskManager.cs
- CodeExpressionCollection.cs
- localization.cs
- WebPartConnectionsDisconnectVerb.cs
- CompositionAdorner.cs
- ActivityExecutionWorkItem.cs
- EntityDataSourceReferenceGroup.cs
- NetworkInformationPermission.cs
- DecimalAnimationBase.cs
- WebRequest.cs
- HttpPostClientProtocol.cs
- PolygonHotSpot.cs
- ListenerAdapterBase.cs
- ReaderOutput.cs
- PageRanges.cs
- DocumentSequenceHighlightLayer.cs
- InstanceCreationEditor.cs
- BuildManager.cs
- StreamSecurityUpgradeAcceptor.cs
- securitycriticaldataClass.cs
- MetadataSerializer.cs
- XPathSelfQuery.cs
- ActivityTrace.cs
- TemplateKeyConverter.cs
- XmlTextReaderImpl.cs
- WebConfigurationHost.cs
- ConnectionManagementElementCollection.cs
- EventLogQuery.cs
- CookieHandler.cs
- DataGridViewButtonCell.cs
- FilterQuery.cs
- UrlMappingsSection.cs
- Transactions.cs
- SafeRightsManagementQueryHandle.cs
- WindowsListViewItemCheckBox.cs
- TextShapeableCharacters.cs
- XmlReflectionMember.cs
- RankException.cs
- EventProvider.cs
- ModifyActivitiesPropertyDescriptor.cs
- NonBatchDirectoryCompiler.cs
- RadioButtonRenderer.cs
- PoisonMessageException.cs
- Substitution.cs
- ToolStripDropDownItemDesigner.cs
- ValidationResult.cs
- DocumentViewerBase.cs
- UpdatePanel.cs
- SqlConnectionString.cs
- MetadataCollection.cs
- DataSourceSelectArguments.cs
- System.Data.OracleClient_BID.cs
- SqlFormatter.cs
- FormViewModeEventArgs.cs
- GeneralTransform2DTo3D.cs
- XmlSchemaSimpleContentExtension.cs
- DataGridViewRowPrePaintEventArgs.cs
- Blend.cs
- IsolatedStorageFileStream.cs
- FieldCollectionEditor.cs
- ParagraphVisual.cs
- QueryException.cs
- Rectangle.cs
- LineServices.cs
- CacheDependency.cs
- ElementHost.cs
- MatrixCamera.cs
- PolicyManager.cs
- ParserExtension.cs
- DNS.cs
- WindowsEditBoxRange.cs
- DockPatternIdentifiers.cs
- ContextMarshalException.cs