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
- BrushConverter.cs
- InvalidEnumArgumentException.cs
- SchemaElement.cs
- ResourceReferenceExpression.cs
- MultiAsyncResult.cs
- ProfileSection.cs
- IndexingContentUnit.cs
- ReachFixedDocumentSerializerAsync.cs
- AssemblyInfo.cs
- ExtensionWindow.cs
- WindowsSysHeader.cs
- BitmapCodecInfo.cs
- ControlPersister.cs
- PrintDialog.cs
- JsonReaderDelegator.cs
- Light.cs
- mediaeventargs.cs
- TokenBasedSet.cs
- SqlBuilder.cs
- UnauthorizedWebPart.cs
- ControlAdapter.cs
- UTF8Encoding.cs
- StreamUpdate.cs
- TransportManager.cs
- FrameworkTemplate.cs
- XmlUnspecifiedAttribute.cs
- FileDialogCustomPlace.cs
- TargetException.cs
- SqlProcedureAttribute.cs
- Inflater.cs
- X509ChainPolicy.cs
- CfgParser.cs
- HtmlAnchor.cs
- PackageRelationshipSelector.cs
- HttpContextWrapper.cs
- SafeBitVector32.cs
- ConfigurationSectionGroup.cs
- PropertyMappingExceptionEventArgs.cs
- ExtensionQuery.cs
- XmlBinaryReader.cs
- HideDisabledControlAdapter.cs
- oledbconnectionstring.cs
- _CookieModule.cs
- ZipIOLocalFileDataDescriptor.cs
- Blend.cs
- TextInfo.cs
- X509Certificate2Collection.cs
- GraphicsPathIterator.cs
- ObjectToIdCache.cs
- SecurityTokenAuthenticator.cs
- BigIntegerStorage.cs
- ButtonBase.cs
- XsltContext.cs
- ModelItemCollection.cs
- Activity.cs
- LoadWorkflowByKeyAsyncResult.cs
- Page.cs
- IISMapPath.cs
- BuildProviderAppliesToAttribute.cs
- safelink.cs
- Message.cs
- PermissionSetEnumerator.cs
- GlyphCollection.cs
- CodeDomConfigurationHandler.cs
- GrammarBuilderBase.cs
- CollaborationHelperFunctions.cs
- BoolExpr.cs
- XmlCharType.cs
- StateDesigner.TransitionInfo.cs
- EditorZoneDesigner.cs
- DesignerRegion.cs
- MimeWriter.cs
- ParenthesizePropertyNameAttribute.cs
- SimpleExpression.cs
- Vector3dCollection.cs
- Int32Collection.cs
- XmlAnyAttributeAttribute.cs
- ItemCheckEvent.cs
- MetafileHeaderEmf.cs
- AuthStoreRoleProvider.cs
- ButtonPopupAdapter.cs
- Transform3D.cs
- XamlDesignerSerializationManager.cs
- SQLDateTimeStorage.cs
- ExpressionValueEditor.cs
- ValidationError.cs
- ConfigurationErrorsException.cs
- GlobalDataBindingHandler.cs
- GridToolTip.cs
- CannotUnloadAppDomainException.cs
- Pen.cs
- _IPv6Address.cs
- BufferAllocator.cs
- DropShadowEffect.cs
- SmtpFailedRecipientsException.cs
- TextEditorCharacters.cs
- RubberbandSelector.cs
- ChannelCredentials.cs
- RemoteWebConfigurationHostStream.cs
- DataGridViewRowStateChangedEventArgs.cs