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
- ProviderConnectionPoint.cs
- AssemblyUtil.cs
- XMLSyntaxException.cs
- _ChunkParse.cs
- ConditionalAttribute.cs
- VirtualDirectoryMapping.cs
- TypeLoadException.cs
- CaseStatementSlot.cs
- TemplateBindingExtensionConverter.cs
- NotCondition.cs
- __Error.cs
- PenLineCapValidation.cs
- DtdParser.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- HtmlInputReset.cs
- WinCategoryAttribute.cs
- XmlValidatingReaderImpl.cs
- PerfService.cs
- CustomErrorCollection.cs
- CaseExpr.cs
- TransportBindingElement.cs
- Selection.cs
- CharacterBufferReference.cs
- ProfileGroupSettingsCollection.cs
- Keywords.cs
- XmlReader.cs
- AutomationTextAttribute.cs
- HtmlInputRadioButton.cs
- HelpEvent.cs
- WebBrowser.cs
- ObjectPropertyMapping.cs
- HtmlMeta.cs
- SQLInt32Storage.cs
- HealthMonitoringSectionHelper.cs
- DynamicUpdateCommand.cs
- AuthenticationService.cs
- Int32Rect.cs
- ProfileWorkflowElement.cs
- TdsEnums.cs
- mediaeventshelper.cs
- ScriptBehaviorDescriptor.cs
- ObjectStateFormatter.cs
- SubstitutionResponseElement.cs
- CompilationUtil.cs
- RuleSetReference.cs
- EntityDataSourceChangingEventArgs.cs
- MD5.cs
- Size3D.cs
- CallbackValidatorAttribute.cs
- DataTemplateKey.cs
- Cursors.cs
- SimpleBitVector32.cs
- SystemWebSectionGroup.cs
- DocumentsTrace.cs
- CodeTypeMemberCollection.cs
- SafeHandles.cs
- RuleDefinitions.cs
- _Connection.cs
- X500Name.cs
- AssertHelper.cs
- RegistrySecurity.cs
- ColumnHeaderConverter.cs
- EditorReuseAttribute.cs
- PolicyValidationException.cs
- FrameworkElementFactoryMarkupObject.cs
- XmlAttributeCache.cs
- ElementUtil.cs
- InternalDispatchObject.cs
- XmlQueryOutput.cs
- Facet.cs
- DtdParser.cs
- SerialReceived.cs
- TrustSection.cs
- Perspective.cs
- Pkcs7Recipient.cs
- Encoder.cs
- UserMapPath.cs
- WorkflowPersistenceService.cs
- DataSourceXmlTextReader.cs
- CategoryState.cs
- HtmlEmptyTagControlBuilder.cs
- WebServiceData.cs
- HtmlSelect.cs
- MoveSizeWinEventHandler.cs
- OperationParameterInfo.cs
- UidPropertyAttribute.cs
- ImageCollectionEditor.cs
- DocumentGridContextMenu.cs
- TextParagraphProperties.cs
- TextRangeSerialization.cs
- TemplatedControlDesigner.cs
- ConnectionManager.cs
- SqlDataSourceSummaryPanel.cs
- TreeViewItem.cs
- Attachment.cs
- DbProviderManifest.cs
- OdbcDataAdapter.cs
- Compiler.cs
- Convert.cs
- Ref.cs