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
- SafeNativeMethods.cs
- updateconfighost.cs
- ProfessionalColors.cs
- BStrWrapper.cs
- DesignerActionUI.cs
- IndexedString.cs
- RijndaelManagedTransform.cs
- RawAppCommandInputReport.cs
- MsmqPoisonMessageException.cs
- FontUnitConverter.cs
- StylusCaptureWithinProperty.cs
- PathStreamGeometryContext.cs
- XsltContext.cs
- XmlSerializationWriter.cs
- OleDbInfoMessageEvent.cs
- QilChoice.cs
- FullTextState.cs
- SendingRequestEventArgs.cs
- IsolatedStorageFileStream.cs
- PerformanceCounterCategory.cs
- ApplicationDirectory.cs
- BamlMapTable.cs
- ApplicationServiceManager.cs
- MenuTracker.cs
- DocumentSequence.cs
- MenuItemBindingCollection.cs
- PeerPresenceInfo.cs
- Hashtable.cs
- ColorMap.cs
- HtmlLink.cs
- FormParameter.cs
- AttributeConverter.cs
- DataGridRow.cs
- glyphs.cs
- ObjectAnimationBase.cs
- RegularExpressionValidator.cs
- WorkflowService.cs
- PropertyConverter.cs
- URIFormatException.cs
- ToolStripScrollButton.cs
- DifferencingCollection.cs
- UniqueEventHelper.cs
- BinaryObjectInfo.cs
- Parser.cs
- ChildDocumentBlock.cs
- EntityDataSourceColumn.cs
- PlaceHolder.cs
- PreProcessor.cs
- XmlImplementation.cs
- CompareInfo.cs
- OleDbCommand.cs
- UrlMappingsModule.cs
- ProxyWebPartManager.cs
- Variant.cs
- NavigationService.cs
- CharacterMetrics.cs
- SafeHandle.cs
- PackageDigitalSignatureManager.cs
- KnownTypes.cs
- GridViewCellAutomationPeer.cs
- SequenceQuery.cs
- DataRelationPropertyDescriptor.cs
- invalidudtexception.cs
- WebResourceAttribute.cs
- ItemChangedEventArgs.cs
- cache.cs
- ProfileInfo.cs
- InvalidFilterCriteriaException.cs
- XsdDuration.cs
- MethodCallConverter.cs
- TextServicesPropertyRanges.cs
- PriorityBindingExpression.cs
- TextureBrush.cs
- EditorPartChrome.cs
- WindowsFormsSynchronizationContext.cs
- DictionaryItemsCollection.cs
- UrlMappingsSection.cs
- DynamicMetaObjectBinder.cs
- MediaTimeline.cs
- TemplateInstanceAttribute.cs
- StringUtil.cs
- InfocardExtendedInformationEntry.cs
- StringValidatorAttribute.cs
- StylusCollection.cs
- ValidationHelper.cs
- DesignSurfaceServiceContainer.cs
- DBDataPermission.cs
- XmlSignificantWhitespace.cs
- EventLogPermissionAttribute.cs
- DataSourceSelectArguments.cs
- ConfigXmlText.cs
- CompositeDataBoundControl.cs
- DESCryptoServiceProvider.cs
- XmlnsDictionary.cs
- ReadOnlyHierarchicalDataSource.cs
- ActivityMetadata.cs
- SerialPinChanges.cs
- ToolStripRendererSwitcher.cs
- TypeLibConverter.cs
- DateRangeEvent.cs