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
- IssuanceTokenProviderBase.cs
- ComAdminInterfaces.cs
- SafeViewOfFileHandle.cs
- StylusPointCollection.cs
- KeyManager.cs
- XmlComment.cs
- DependencySource.cs
- ColumnMapVisitor.cs
- XmlHelper.cs
- Polyline.cs
- BinaryReader.cs
- BeginStoryboard.cs
- PartitionerQueryOperator.cs
- WebServiceErrorEvent.cs
- ValidationHelper.cs
- AttributeTable.cs
- Behavior.cs
- ExpressionBuilder.cs
- EtwTrace.cs
- ObjectSelectorEditor.cs
- FrameworkElement.cs
- DeadCharTextComposition.cs
- DataTablePropertyDescriptor.cs
- DataGridSortCommandEventArgs.cs
- TabControlEvent.cs
- ExternalException.cs
- KeyFrames.cs
- _FtpDataStream.cs
- XmlSchemaProviderAttribute.cs
- SQLMoneyStorage.cs
- FormsAuthenticationUserCollection.cs
- FeatureSupport.cs
- DataGridViewTextBoxCell.cs
- ConnectionsZoneAutoFormat.cs
- RegistryPermission.cs
- XmlHierarchicalEnumerable.cs
- Panel.cs
- UnsafePeerToPeerMethods.cs
- Vector3DCollectionConverter.cs
- SystemIPv4InterfaceProperties.cs
- OlePropertyStructs.cs
- XappLauncher.cs
- ConvertersCollection.cs
- XmlAttributeProperties.cs
- DataViewManager.cs
- SqlMultiplexer.cs
- OdbcFactory.cs
- indexingfiltermarshaler.cs
- InteropBitmapSource.cs
- TargetInvocationException.cs
- TextBox.cs
- XhtmlStyleClass.cs
- DataGrid.cs
- HtmlTableRow.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- MergeFilterQuery.cs
- CssClassPropertyAttribute.cs
- Attributes.cs
- EventLogEntryCollection.cs
- HttpClientCertificate.cs
- EllipseGeometry.cs
- InternalPermissions.cs
- SqlParameterCollection.cs
- OdbcEnvironment.cs
- DataGridCellClipboardEventArgs.cs
- TraceListener.cs
- UTF32Encoding.cs
- PngBitmapDecoder.cs
- CombinedGeometry.cs
- XmlSchemaDatatype.cs
- PropertyPath.cs
- PerformanceCounterPermissionEntryCollection.cs
- TypeConverterValueSerializer.cs
- _RegBlobWebProxyDataBuilder.cs
- ThreadStateException.cs
- WebBrowserHelper.cs
- SupportingTokenAuthenticatorSpecification.cs
- SQLResource.cs
- DesignerActionUIStateChangeEventArgs.cs
- FlowDocumentView.cs
- DesignerValidatorAdapter.cs
- Vector3DKeyFrameCollection.cs
- DataGridViewCellStyleBuilderDialog.cs
- ExpressionLexer.cs
- DataSourceView.cs
- ComponentManagerBroker.cs
- UriTemplateCompoundPathSegment.cs
- QilFactory.cs
- PathSegment.cs
- SupportsEventValidationAttribute.cs
- PageClientProxyGenerator.cs
- FormClosedEvent.cs
- NameNode.cs
- XamlClipboardData.cs
- LeaseManager.cs
- SQlBooleanStorage.cs
- SqlCommand.cs
- DuplicateWaitObjectException.cs
- GridItemCollection.cs
- BrowserDefinitionCollection.cs