Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / SByteConverter.cs / 1 / SByteConverter.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 8-bit unsigned
/// integer objects to and from various other representations.
///
[HostProtection(SharedState = true)]
public class SByteConverter : BaseNumberConverter
{
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(SByte);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToSByte(value, radix);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return SByte.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 SByte.Parse(value, culture);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((SByte)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 8-bit unsigned
/// integer objects to and from various other representations.
///
[HostProtection(SharedState = true)]
public class SByteConverter : BaseNumberConverter
{
///
/// The Type this converter is targeting (e.g. Int16, UInt32, etc.)
///
internal override Type TargetType {
get {
return typeof(SByte);
}
}
///
/// Convert the given value to a string using the given radix
///
internal override object FromString(string value, int radix) {
return Convert.ToSByte(value, radix);
}
///
/// Convert the given value to a string using the given formatInfo
///
internal override object FromString(string value, NumberFormatInfo formatInfo) {
return SByte.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 SByte.Parse(value, culture);
}
///
/// Convert the given value from a string using the given formatInfo
///
internal override string ToString(object value, NumberFormatInfo formatInfo) {
return ((SByte)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
- GlobalizationAssembly.cs
- DnsEndPoint.cs
- AnnotationMap.cs
- HttpCacheVary.cs
- DataGridViewBindingCompleteEventArgs.cs
- CacheMemory.cs
- DataListItemEventArgs.cs
- invalidudtexception.cs
- RedistVersionInfo.cs
- StylusEditingBehavior.cs
- SqlFactory.cs
- MenuItem.cs
- DataGridViewButtonColumn.cs
- XmlAttributeAttribute.cs
- PreDigestedSignedInfo.cs
- RegexRunner.cs
- DoubleCollectionConverter.cs
- BaseDataListDesigner.cs
- GenericsNotImplementedException.cs
- WebPartConnectionsCancelVerb.cs
- HttpWebRequest.cs
- ValidatingReaderNodeData.cs
- MaskedTextProvider.cs
- MenuAdapter.cs
- NativeMethods.cs
- FormViewUpdatedEventArgs.cs
- StorageAssociationSetMapping.cs
- CodeNamespace.cs
- IgnoreDeviceFilterElement.cs
- NetTcpSecurityElement.cs
- WorkItem.cs
- ShutDownListener.cs
- Message.cs
- UIEndRequest.cs
- DataGridTextBoxColumn.cs
- Environment.cs
- SqlUtil.cs
- XPathDocumentBuilder.cs
- SoapInteropTypes.cs
- ToolStripPanelRow.cs
- XamlSerializerUtil.cs
- HostVisual.cs
- ObjectKeyFrameCollection.cs
- ByteAnimationBase.cs
- HwndSourceKeyboardInputSite.cs
- PrinterSettings.cs
- ObjectRef.cs
- Button.cs
- ListViewCancelEventArgs.cs
- GroupPartitionExpr.cs
- PnrpPermission.cs
- BlobPersonalizationState.cs
- Geometry.cs
- ColumnBinding.cs
- TemplateControlBuildProvider.cs
- SqlCommand.cs
- OdbcConnectionOpen.cs
- WorkflowMessageEventHandler.cs
- StrokeDescriptor.cs
- SourceFileInfo.cs
- SpellerStatusTable.cs
- Utilities.cs
- QuerySettings.cs
- WebPartConnectionsConnectVerb.cs
- EnumValAlphaComparer.cs
- DataGridViewCellCancelEventArgs.cs
- SqlInternalConnectionTds.cs
- SettingsSection.cs
- RequestBringIntoViewEventArgs.cs
- DispatcherObject.cs
- OLEDB_Util.cs
- CapabilitiesRule.cs
- DragEvent.cs
- SlotInfo.cs
- ObjectNotFoundException.cs
- XmlEnumAttribute.cs
- NavigatorOutput.cs
- TimelineGroup.cs
- SystemIPGlobalStatistics.cs
- StreamInfo.cs
- DataGridViewRowPostPaintEventArgs.cs
- Ipv6Element.cs
- DllNotFoundException.cs
- MarshalByRefObject.cs
- CredentialManagerDialog.cs
- Win32Native.cs
- ExpressionBuilderCollection.cs
- CompleteWizardStep.cs
- Vector3D.cs
- EventLogPermissionEntry.cs
- PaginationProgressEventArgs.cs
- Vector3D.cs
- SpecularMaterial.cs
- SocketElement.cs
- TypedDataSourceCodeGenerator.cs
- XmlCustomFormatter.cs
- SHA1CryptoServiceProvider.cs
- OuterGlowBitmapEffect.cs
- EntityViewGenerator.cs
- ContainerVisual.cs