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 / Int16Converter.cs / 1 / Int16Converter.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 16-bit signed integer objects to and
/// from various other representations.
///
[HostProtection(SharedState = true)]
public class Int16Converter : BaseNumberConverter {
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(Int16);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToInt16(value, radix);
}
///
/// Convert the given value to a string using the given CultureInfo
///
internal override object FromString(string value, CultureInfo culture){
return Int16.Parse(value, culture);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return Int16.Parse(value, NumberStyles.Integer, formatInfo);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((Int16)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 16-bit signed integer objects to and
/// from various other representations.
///
[HostProtection(SharedState = true)]
public class Int16Converter : BaseNumberConverter {
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(Int16);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToInt16(value, radix);
}
///
/// Convert the given value to a string using the given CultureInfo
///
internal override object FromString(string value, CultureInfo culture){
return Int16.Parse(value, culture);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return Int16.Parse(value, NumberStyles.Integer, formatInfo);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((Int16)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
- EventSetter.cs
- DesignerTransaction.cs
- MetabaseServerConfig.cs
- HttpCacheParams.cs
- LostFocusEventManager.cs
- ListViewItemMouseHoverEvent.cs
- basecomparevalidator.cs
- CompoundFileDeflateTransform.cs
- DoubleCollectionValueSerializer.cs
- RSACryptoServiceProvider.cs
- PeerName.cs
- BitmapEffect.cs
- IPGlobalProperties.cs
- XmlDataProvider.cs
- SystemIPGlobalStatistics.cs
- CodeCommentStatement.cs
- DefaultPrintController.cs
- ClientCultureInfo.cs
- OutOfMemoryException.cs
- TrackingExtract.cs
- ListViewDeleteEventArgs.cs
- GeometryModel3D.cs
- bindurihelper.cs
- WorkflowViewManager.cs
- SqlBuilder.cs
- ProtocolViolationException.cs
- XpsSerializationManager.cs
- SqlTriggerContext.cs
- OleDbWrapper.cs
- MemoryStream.cs
- HMACMD5.cs
- XsltQilFactory.cs
- WindowsRegion.cs
- DBDataPermissionAttribute.cs
- TokenBasedSet.cs
- ToolstripProfessionalRenderer.cs
- TdsParserHelperClasses.cs
- RegexBoyerMoore.cs
- BeginStoryboard.cs
- SkinBuilder.cs
- TextDecorationCollectionConverter.cs
- dataobject.cs
- RotateTransform3D.cs
- FormsAuthentication.cs
- MsmqBindingMonitor.cs
- GridViewSelectEventArgs.cs
- SessionSwitchEventArgs.cs
- SecurityException.cs
- Cursor.cs
- WebBrowserContainer.cs
- DataGridRow.cs
- VectorCollectionConverter.cs
- BitmapEffectRenderDataResource.cs
- WebPartConnectionsCancelEventArgs.cs
- PackWebResponse.cs
- HashSetEqualityComparer.cs
- SizeFConverter.cs
- MD5.cs
- mactripleDES.cs
- DetailsView.cs
- MsdtcClusterUtils.cs
- DesignerObject.cs
- Registry.cs
- DataGridViewRowHeaderCell.cs
- SqlDataSourceStatusEventArgs.cs
- Matrix.cs
- TriState.cs
- Char.cs
- AlgoModule.cs
- StateItem.cs
- Filter.cs
- PathSegmentCollection.cs
- MethodExpr.cs
- XmlMemberMapping.cs
- WizardStepBase.cs
- PageAsyncTask.cs
- DomainUpDown.cs
- WorkflowQueuingService.cs
- SendActivityValidator.cs
- Translator.cs
- TaskHelper.cs
- Error.cs
- WbmpConverter.cs
- SiteOfOriginPart.cs
- WebPartCancelEventArgs.cs
- WmiInstallComponent.cs
- XsdBuilder.cs
- HotSpot.cs
- userdatakeys.cs
- XPathSingletonIterator.cs
- BulletChrome.cs
- RuntimeWrappedException.cs
- Positioning.cs
- _SecureChannel.cs
- TypeExtension.cs
- LinkedList.cs
- ExternalCalls.cs
- StaticSiteMapProvider.cs
- UnsafeNativeMethods.cs
- DES.cs