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; ////// [HostProtection(SharedState = true)] public class SByteConverter : BaseNumberConverter { ///Provides a /// type converter to convert 8-bit unsigned /// integer objects to and from various other representations. ////// 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; ////// [HostProtection(SharedState = true)] public class SByteConverter : BaseNumberConverter { ///Provides a /// type converter to convert 8-bit unsigned /// integer objects to and from various other representations. ////// 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
- CounterNameConverter.cs
- TdsParameterSetter.cs
- SmtpCommands.cs
- WebConfigurationFileMap.cs
- NumberFunctions.cs
- UrlPath.cs
- RowUpdatedEventArgs.cs
- WebEventCodes.cs
- ServicePointManagerElement.cs
- DataSet.cs
- Behavior.cs
- CountdownEvent.cs
- TemplateControl.cs
- ToolStripItemEventArgs.cs
- CalculatedColumn.cs
- FormatterServices.cs
- PropertyValueChangedEvent.cs
- DataGridViewElement.cs
- CaseCqlBlock.cs
- ProxyElement.cs
- XmlWrappingReader.cs
- OracleBFile.cs
- CopyCodeAction.cs
- TextBox.cs
- NameValuePermission.cs
- TypeUsageBuilder.cs
- Operators.cs
- EntityViewGenerationConstants.cs
- PrtCap_Reader.cs
- HttpHandlerAction.cs
- BufferedReadStream.cs
- AttachedPropertyBrowsableAttribute.cs
- PopupEventArgs.cs
- AdPostCacheSubstitution.cs
- HtmlForm.cs
- JournalEntryStack.cs
- SelectionProviderWrapper.cs
- ShaderEffect.cs
- MenuStrip.cs
- TypeUtils.cs
- ToolboxItemCollection.cs
- WrappedReader.cs
- BinHexDecoder.cs
- ACE.cs
- MaskedTextBox.cs
- PathGradientBrush.cs
- XamlSerializationHelper.cs
- XmlAnyElementAttribute.cs
- Brushes.cs
- Pair.cs
- FragmentQueryProcessor.cs
- TaiwanCalendar.cs
- XmlDataImplementation.cs
- DeriveBytes.cs
- TiffBitmapEncoder.cs
- CngKey.cs
- InitializationEventAttribute.cs
- TreeViewHitTestInfo.cs
- GradientBrush.cs
- JsonQNameDataContract.cs
- RepeaterItemCollection.cs
- SortedDictionary.cs
- HttpGetServerProtocol.cs
- ForeignKeyConstraint.cs
- Event.cs
- UpdatePanelControlTrigger.cs
- PersonalizationDictionary.cs
- ResourcePool.cs
- XomlCompilerHelpers.cs
- GraphicsContainer.cs
- ReflectionHelper.cs
- HtmlTableRow.cs
- RegexStringValidator.cs
- TreeViewItem.cs
- TypeResolvingOptions.cs
- StringDictionaryCodeDomSerializer.cs
- GuidelineCollection.cs
- FreezableOperations.cs
- RegexFCD.cs
- SimplePropertyEntry.cs
- XhtmlBasicTextViewAdapter.cs
- ChangeConflicts.cs
- ProcessManager.cs
- TrackingConditionCollection.cs
- RoutedEventArgs.cs
- Thumb.cs
- RtfToXamlLexer.cs
- XmlBindingWorker.cs
- PropertyBuilder.cs
- UnknownBitmapEncoder.cs
- DiagnosticsConfigurationHandler.cs
- _WebProxyDataBuilder.cs
- MetadataException.cs
- TokenizerHelper.cs
- SqlProviderServices.cs
- AudioSignalProblemOccurredEventArgs.cs
- MappingSource.cs
- X509CertificateValidationMode.cs
- DataTableTypeConverter.cs
- EntityViewGenerationAttribute.cs