Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ClientTargetSection.cs
- ClipboardProcessor.cs
- MultilineStringConverter.cs
- TableStyle.cs
- FontFaceLayoutInfo.cs
- Int32CollectionValueSerializer.cs
- TableColumn.cs
- SrgsElement.cs
- XPathAncestorIterator.cs
- QuaternionAnimation.cs
- DecoderNLS.cs
- LinqDataSourceValidationException.cs
- UserInitiatedNavigationPermission.cs
- PeerPresenceInfo.cs
- ApplicationDirectoryMembershipCondition.cs
- SoapException.cs
- InvalidateEvent.cs
- ProcessStartInfo.cs
- DictionaryEditChange.cs
- XhtmlBasicLiteralTextAdapter.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ModelItemCollection.cs
- RemotingException.cs
- StreamGeometry.cs
- PropertyCollection.cs
- RedirectionProxy.cs
- InternalsVisibleToAttribute.cs
- TransactionTraceIdentifier.cs
- BasicBrowserDialog.cs
- CodeAttachEventStatement.cs
- BuildProviderAppliesToAttribute.cs
- RequestCachePolicy.cs
- DropShadowBitmapEffect.cs
- InfoCardRequestException.cs
- safelinkcollection.cs
- FontUnit.cs
- SrgsElementFactoryCompiler.cs
- AccessDataSource.cs
- DynamicRendererThreadManager.cs
- DataSourceXmlTextReader.cs
- WindowsScroll.cs
- OperationAbortedException.cs
- Label.cs
- GridViewCancelEditEventArgs.cs
- CLRBindingWorker.cs
- TemplateFactory.cs
- DummyDataSource.cs
- WebPartDescription.cs
- RowType.cs
- MaxSessionCountExceededException.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- BeginEvent.cs
- TcpClientChannel.cs
- GiveFeedbackEventArgs.cs
- EntityDescriptor.cs
- DoubleLink.cs
- DataControlField.cs
- CfgParser.cs
- RotateTransform.cs
- TextDecorationUnitValidation.cs
- MethodBody.cs
- InkPresenter.cs
- SectionRecord.cs
- FileLogRecordEnumerator.cs
- DataGridRowDetailsEventArgs.cs
- Propagator.Evaluator.cs
- WSMessageEncoding.cs
- SolidColorBrush.cs
- DateTimeParse.cs
- ListSortDescriptionCollection.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- PointAnimationUsingKeyFrames.cs
- ParserStreamGeometryContext.cs
- ToolTip.cs
- ColorConverter.cs
- VScrollProperties.cs
- MessageQueueConverter.cs
- EntityClassGenerator.cs
- Timeline.cs
- ManualResetEvent.cs
- XmlAnyElementAttributes.cs
- LocatorPartList.cs
- IsolatedStorageFile.cs
- CardSpacePolicyElement.cs
- XsltSettings.cs
- Utils.cs
- BlurEffect.cs
- EntityDataSourceStatementEditor.cs
- InkCanvasAutomationPeer.cs
- AuthenticateEventArgs.cs
- HScrollProperties.cs
- SchemaTableColumn.cs
- PointKeyFrameCollection.cs
- DiagnosticTrace.cs
- HijriCalendar.cs
- InputChannelAcceptor.cs
- XmlUtil.cs
- AliasedSlot.cs
- IgnoreSectionHandler.cs
- translator.cs