Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / UInt16Converter.cs / 1305376 / UInt16Converter.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 UInt16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit unsigned 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(UInt16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToUInt16(value, radix); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return UInt16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return UInt16.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((UInt16)value).ToString("G", formatInfo); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// 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 UInt16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit unsigned 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(UInt16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToUInt16(value, radix); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return UInt16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return UInt16.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((UInt16)value).ToString("G", formatInfo); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BevelBitmapEffect.cs
- FilteredXmlReader.cs
- MemoryMappedView.cs
- JsonStringDataContract.cs
- Transactions.cs
- Size3DValueSerializer.cs
- _DigestClient.cs
- AppDomainResourcePerfCounters.cs
- QuaternionIndependentAnimationStorage.cs
- ZoneLinkButton.cs
- PeerResolverElement.cs
- AppSettingsExpressionBuilder.cs
- PermissionAttributes.cs
- BindingMemberInfo.cs
- MasterPageCodeDomTreeGenerator.cs
- hresults.cs
- PropertyGridDesigner.cs
- xmlglyphRunInfo.cs
- CustomErrorsSectionWrapper.cs
- BamlResourceContent.cs
- SecureConversationDriver.cs
- BufferManager.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- Registration.cs
- SecurityTokenAuthenticator.cs
- Visual3DCollection.cs
- TimeSpanConverter.cs
- DataSourceControl.cs
- RealProxy.cs
- MD5.cs
- ViewStateModeByIdAttribute.cs
- WinEventTracker.cs
- RewritingSimplifier.cs
- IDReferencePropertyAttribute.cs
- basecomparevalidator.cs
- WindowsBrush.cs
- HttpRuntime.cs
- MultiDataTrigger.cs
- RecognitionResult.cs
- NavigateEvent.cs
- OciLobLocator.cs
- ValidationErrorEventArgs.cs
- Operand.cs
- ConfigurationFileMap.cs
- BuildProvider.cs
- SqlUserDefinedAggregateAttribute.cs
- Overlapped.cs
- PartManifestEntry.cs
- XmlSchemaExternal.cs
- Multiply.cs
- EntryPointNotFoundException.cs
- Rfc2898DeriveBytes.cs
- RawStylusActions.cs
- Speller.cs
- VectorConverter.cs
- CurrentChangedEventManager.cs
- DataListItemCollection.cs
- Listen.cs
- ListParagraph.cs
- OpacityConverter.cs
- HierarchicalDataSourceConverter.cs
- CoreSwitches.cs
- Stackframe.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Transform3DGroup.cs
- RelationshipConverter.cs
- Select.cs
- StrongName.cs
- NotificationContext.cs
- BaseCollection.cs
- FontStyle.cs
- xmlsaver.cs
- XmlSchemaSimpleTypeRestriction.cs
- FontSourceCollection.cs
- UInt32Storage.cs
- PointAnimationBase.cs
- ListenerPerfCounters.cs
- AssemblyCache.cs
- DbProviderFactories.cs
- TakeOrSkipQueryOperator.cs
- DllNotFoundException.cs
- PerformanceCounterPermission.cs
- Timer.cs
- XmlStreamStore.cs
- DataGridBoundColumn.cs
- CodeCastExpression.cs
- TargetPerspective.cs
- ProcessInputEventArgs.cs
- TimeIntervalCollection.cs
- EventSinkHelperWriter.cs
- OleDbConnection.cs
- ChannelServices.cs
- TableCellCollection.cs
- WebPageTraceListener.cs
- StringFreezingAttribute.cs
- HGlobalSafeHandle.cs
- FrameworkContentElementAutomationPeer.cs
- ParameterCollection.cs
- ToolboxComponentsCreatedEventArgs.cs
- Random.cs