Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / ComponentModel / Int16Converter.cs / 1 / Int16Converter.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 Int16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit signed 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(Int16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToInt16(value, radix); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return Int16.Parse(value, culture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Int16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Int16)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 Int16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit signed 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(Int16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToInt16(value, radix); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return Int16.Parse(value, culture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Int16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Int16)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
- SHA384Managed.cs
- SecurityDocument.cs
- LogicalCallContext.cs
- ConvertersCollection.cs
- ElementsClipboardData.cs
- ReadOnlyNameValueCollection.cs
- PartitionResolver.cs
- ValueConversionAttribute.cs
- ToolstripProfessionalRenderer.cs
- TypeConvertions.cs
- ListViewDataItem.cs
- CreateUserErrorEventArgs.cs
- Label.cs
- SuspendDesigner.cs
- ReflectEventDescriptor.cs
- CommonDialog.cs
- ItemContainerGenerator.cs
- ConsumerConnectionPoint.cs
- RadioButton.cs
- FontUnit.cs
- PropertiesTab.cs
- TraceUtility.cs
- PkcsUtils.cs
- QueryStoreStatusRequest.cs
- InstalledFontCollection.cs
- PropertyEntry.cs
- MultiTrigger.cs
- CalendarDataBindingHandler.cs
- SystemResources.cs
- RequiredAttributeAttribute.cs
- WindowsScroll.cs
- TransactedReceiveScope.cs
- WebControlAdapter.cs
- ActivityScheduledRecord.cs
- FileUtil.cs
- EncoderNLS.cs
- XmlSerializerNamespaces.cs
- ChangePasswordDesigner.cs
- InputBinding.cs
- GeometryHitTestResult.cs
- ResourceSetExpression.cs
- ListenerConstants.cs
- DynamicUpdateCommand.cs
- ExecutionScope.cs
- RawStylusSystemGestureInputReport.cs
- FontNameEditor.cs
- ScriptReference.cs
- EventRouteFactory.cs
- SafeCertificateContext.cs
- TranslateTransform.cs
- BinHexEncoder.cs
- CategoryGridEntry.cs
- Span.cs
- DuplicateMessageDetector.cs
- XmlQualifiedNameTest.cs
- TrimSurroundingWhitespaceAttribute.cs
- WebDescriptionAttribute.cs
- SamlAuthorityBinding.cs
- basenumberconverter.cs
- CodeBlockBuilder.cs
- ReadWriteSpinLock.cs
- Executor.cs
- XmlTypeAttribute.cs
- AssociatedControlConverter.cs
- ThrowOnMultipleAssignment.cs
- ListViewHitTestInfo.cs
- WebScriptMetadataMessage.cs
- SynchronizedCollection.cs
- RepeaterItem.cs
- XmlDomTextWriter.cs
- XmlElementAttribute.cs
- ConfigXmlReader.cs
- XmlNamespaceMapping.cs
- EntityContainerEmitter.cs
- DefaultAsyncDataDispatcher.cs
- Message.cs
- TypedDataSetSchemaImporterExtension.cs
- HttpInputStream.cs
- PathStreamGeometryContext.cs
- DataSourceHelper.cs
- DrawingState.cs
- ListViewContainer.cs
- PKCS1MaskGenerationMethod.cs
- NativeMethods.cs
- DummyDataSource.cs
- DefaultPrintController.cs
- HttpClientCertificate.cs
- AssemblyAttributes.cs
- BevelBitmapEffect.cs
- TemplateBamlTreeBuilder.cs
- ColorPalette.cs
- CodeConditionStatement.cs
- PlatformCulture.cs
- querybuilder.cs
- EraserBehavior.cs
- ResourceReader.cs
- WindowsListViewItem.cs
- WebConvert.cs
- IImplicitResourceProvider.cs
- ELinqQueryState.cs