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 / 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
- GroupStyle.cs
- RijndaelManagedTransform.cs
- CryptoHandle.cs
- SafeViewOfFileHandle.cs
- CrossAppDomainChannel.cs
- WindowsScrollBar.cs
- HtmlInputControl.cs
- IndentTextWriter.cs
- TemplateControlParser.cs
- KeyFrames.cs
- RTTrackingProfile.cs
- BindingContext.cs
- NetTcpSecurityElement.cs
- UInt32.cs
- CollectionViewGroupInternal.cs
- Matrix.cs
- ImageCodecInfoPrivate.cs
- TraceSection.cs
- StorageEndPropertyMapping.cs
- WSFederationHttpSecurity.cs
- XmlLinkedNode.cs
- ValidatingPropertiesEventArgs.cs
- ResourcePart.cs
- MetadataFile.cs
- AVElementHelper.cs
- DefaultHttpHandler.cs
- ActivityExecutor.cs
- ConfigurationFileMap.cs
- WsdlBuildProvider.cs
- EditingCoordinator.cs
- KeySpline.cs
- CharacterBuffer.cs
- ThreadPoolTaskScheduler.cs
- SolidColorBrush.cs
- ProgressBarHighlightConverter.cs
- ModifiableIteratorCollection.cs
- LiteralDesigner.cs
- NotifyInputEventArgs.cs
- ToolConsole.cs
- Thumb.cs
- TreeNodeBindingCollection.cs
- ObjectDataSourceSelectingEventArgs.cs
- XmlStreamedByteStreamReader.cs
- BuildDependencySet.cs
- CheckPair.cs
- UpdatePanelTrigger.cs
- CodeLinePragma.cs
- SynchronousReceiveBehavior.cs
- DataDesignUtil.cs
- SuppressMessageAttribute.cs
- XmlCustomFormatter.cs
- SpecialFolderEnumConverter.cs
- GlobalAllocSafeHandle.cs
- PreviewKeyDownEventArgs.cs
- PackUriHelper.cs
- SizeIndependentAnimationStorage.cs
- SmiMetaDataProperty.cs
- FileClassifier.cs
- SelectionWordBreaker.cs
- MSHTMLHost.cs
- ImageList.cs
- ToolStripItemTextRenderEventArgs.cs
- OleDbParameterCollection.cs
- RunClient.cs
- InvokeFunc.cs
- QilStrConcatenator.cs
- ListenerPerfCounters.cs
- WebPartZoneBase.cs
- DurationConverter.cs
- Rotation3D.cs
- Statements.cs
- GridViewAutoFormat.cs
- DataFieldConverter.cs
- FieldToken.cs
- ChangeBlockUndoRecord.cs
- CodeObjectCreateExpression.cs
- DataGridViewBand.cs
- PageWrapper.cs
- BinaryEditor.cs
- ControlBindingsCollection.cs
- TypeConverterAttribute.cs
- CalendarButtonAutomationPeer.cs
- TextRangeEdit.cs
- Help.cs
- StateMachineWorkflowDesigner.cs
- WebPartConnectionsConnectVerb.cs
- BamlLocalizationDictionary.cs
- TransformDescriptor.cs
- FillBehavior.cs
- RegexCharClass.cs
- _TimerThread.cs
- OlePropertyStructs.cs
- XmlTextAttribute.cs
- PropertyRecord.cs
- NativeRecognizer.cs
- OleDbRowUpdatedEvent.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- ToolStripTextBox.cs
- GenericTextProperties.cs
- SamlDelegatingWriter.cs