Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CommunicationException.cs
- Converter.cs
- WeakReadOnlyCollection.cs
- IntersectQueryOperator.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- WindowsListBox.cs
- MenuDesigner.cs
- Certificate.cs
- NamedPipeConnectionPool.cs
- CompiledAction.cs
- XmlBoundElement.cs
- PeoplePickerWrapper.cs
- VectorConverter.cs
- QilGeneratorEnv.cs
- BindingNavigator.cs
- DesignerTransaction.cs
- Rules.cs
- TextServicesHost.cs
- ObjectAnimationUsingKeyFrames.cs
- HostingEnvironmentSection.cs
- GeneralTransformCollection.cs
- CodeExporter.cs
- MetadataArtifactLoaderComposite.cs
- SafeEventLogReadHandle.cs
- DataGridCommandEventArgs.cs
- TextEditorLists.cs
- CalendarButtonAutomationPeer.cs
- unsafeIndexingFilterStream.cs
- MobileControl.cs
- TextBoxBase.cs
- SecureConversationSecurityTokenParameters.cs
- DBSqlParserColumn.cs
- DataSvcMapFile.cs
- _emptywebproxy.cs
- ColumnMapVisitor.cs
- GridViewCommandEventArgs.cs
- XmlSubtreeReader.cs
- ActionFrame.cs
- ReliableChannelBinder.cs
- ACL.cs
- BatchParser.cs
- TransformValueSerializer.cs
- ListItem.cs
- Enum.cs
- InputEventArgs.cs
- ListBox.cs
- PropertyRef.cs
- CompoundFileStreamReference.cs
- HttpModuleActionCollection.cs
- odbcmetadatacollectionnames.cs
- SqlServices.cs
- COM2ExtendedBrowsingHandler.cs
- DragCompletedEventArgs.cs
- ValueSerializerAttribute.cs
- AssemblyCacheEntry.cs
- RecommendedAsConfigurableAttribute.cs
- SqlInternalConnectionTds.cs
- CheckBoxPopupAdapter.cs
- XPathAncestorIterator.cs
- DecimalStorage.cs
- SatelliteContractVersionAttribute.cs
- CounterSampleCalculator.cs
- RenderContext.cs
- SafeCryptContextHandle.cs
- PagerStyle.cs
- HierarchicalDataBoundControlAdapter.cs
- TemplateControlBuildProvider.cs
- ToolZone.cs
- EncryptedKeyIdentifierClause.cs
- MyContact.cs
- ProjectionAnalyzer.cs
- CompilationLock.cs
- RenderingEventArgs.cs
- CodeStatementCollection.cs
- StagingAreaInputItem.cs
- PersonalizableAttribute.cs
- ApplicationServicesHostFactory.cs
- EntityDataReader.cs
- CommandSet.cs
- Util.cs
- GridViewRowCollection.cs
- ComNativeDescriptor.cs
- MenuTracker.cs
- OperationSelectorBehavior.cs
- WebPartsPersonalization.cs
- ComponentSerializationService.cs
- DataSourceXmlSerializationAttribute.cs
- FormViewUpdateEventArgs.cs
- SystemResourceHost.cs
- DPCustomTypeDescriptor.cs
- Decoder.cs
- SourceChangedEventArgs.cs
- UnicastIPAddressInformationCollection.cs
- ItemCheckEvent.cs
- ThumbButtonInfo.cs
- CodeTypeReferenceCollection.cs
- ObjectDataSourceView.cs
- WorkflowViewStateService.cs
- GridToolTip.cs
- InputBindingCollection.cs