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
- DependencyObjectType.cs
- keycontainerpermission.cs
- XmlSchemaGroup.cs
- DesignerCapabilities.cs
- XNameConverter.cs
- DatePickerAutomationPeer.cs
- ToolBar.cs
- X509IssuerSerialKeyIdentifierClause.cs
- DataGridViewCellStyleConverter.cs
- ParentUndoUnit.cs
- DataGridViewCellStyleChangedEventArgs.cs
- _Semaphore.cs
- COM2PictureConverter.cs
- AutomationEventArgs.cs
- XmlTextReader.cs
- MemoryMappedViewAccessor.cs
- TreeNodeBinding.cs
- RequestCacheEntry.cs
- ParallelEnumerable.cs
- TimeSpan.cs
- DateTimeFormat.cs
- OdbcException.cs
- ToolboxService.cs
- TextEncodedRawTextWriter.cs
- BitmapCodecInfoInternal.cs
- MembershipPasswordException.cs
- WebReferencesBuildProvider.cs
- Module.cs
- WindowsSecurityToken.cs
- Int64.cs
- BitmapEffectCollection.cs
- Trigger.cs
- StringSorter.cs
- WindowsFormsHost.cs
- DefaultObjectSerializer.cs
- TextDpi.cs
- JsonServiceDocumentSerializer.cs
- glyphs.cs
- WindowsImpersonationContext.cs
- ProfessionalColorTable.cs
- GetRecipientListRequest.cs
- SQLByte.cs
- SimpleMailWebEventProvider.cs
- AutoCompleteStringCollection.cs
- WindowsSidIdentity.cs
- HttpConfigurationContext.cs
- HttpCapabilitiesBase.cs
- HtmlControlPersistable.cs
- MethodResolver.cs
- CheckoutException.cs
- ScriptingAuthenticationServiceSection.cs
- ConfigXmlElement.cs
- BoundField.cs
- AssociationProvider.cs
- XmlQueryRuntime.cs
- WaveHeader.cs
- XmlAtomErrorReader.cs
- ArraySubsetEnumerator.cs
- ProxyHwnd.cs
- _NtlmClient.cs
- TextTreeRootTextBlock.cs
- HttpModulesSection.cs
- StateItem.cs
- ModulesEntry.cs
- XmlSerializerFactory.cs
- GAC.cs
- CustomValidator.cs
- ToolboxCategory.cs
- AddInSegmentDirectoryNotFoundException.cs
- ToolStripContainer.cs
- TextRangeBase.cs
- MimeObjectFactory.cs
- UniqueSet.cs
- DBDataPermissionAttribute.cs
- ChannelServices.cs
- ConfigXmlCDataSection.cs
- CellTreeNodeVisitors.cs
- HtmlGenericControl.cs
- SafeEventLogWriteHandle.cs
- MessagingActivityHelper.cs
- ProtocolElement.cs
- TextAction.cs
- SerializerProvider.cs
- RadioButtonPopupAdapter.cs
- ProtocolsConfigurationHandler.cs
- SizeConverter.cs
- PersistencePipeline.cs
- TextDecorationCollection.cs
- ExpandableObjectConverter.cs
- WebPartEventArgs.cs
- InlinedAggregationOperator.cs
- ViewCellSlot.cs
- ObjectStateFormatter.cs
- SafeNativeMethodsCLR.cs
- ExtensionFile.cs
- BinaryConverter.cs
- SQLBoolean.cs
- SerialPort.cs
- CalendarDay.cs
- WindowsToolbarItemAsMenuItem.cs