Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / UInt16Converter.cs / 1 / 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
- RC2CryptoServiceProvider.cs
- CacheForPrimitiveTypes.cs
- NavigationCommands.cs
- TypeGeneratedEventArgs.cs
- PasswordTextContainer.cs
- InvalidFilterCriteriaException.cs
- Int16.cs
- NotifyParentPropertyAttribute.cs
- SymbolMethod.cs
- Stream.cs
- InputLanguage.cs
- TextStore.cs
- jithelpers.cs
- FastEncoder.cs
- IHttpResponseInternal.cs
- SQLGuidStorage.cs
- WinHttpWebProxyFinder.cs
- LocalBuilder.cs
- FileChangesMonitor.cs
- FormsAuthenticationUserCollection.cs
- AttachInfo.cs
- AdCreatedEventArgs.cs
- FigureParaClient.cs
- Soap.cs
- ZipIOModeEnforcingStream.cs
- wgx_sdk_version.cs
- Menu.cs
- MessageBox.cs
- ApplicationManager.cs
- GraphicsContainer.cs
- PageBuildProvider.cs
- HandledEventArgs.cs
- XPathNavigatorReader.cs
- AtomServiceDocumentSerializer.cs
- ButtonField.cs
- InlineCollection.cs
- DataGrid.cs
- AutomationElementCollection.cs
- Compiler.cs
- SystemDiagnosticsSection.cs
- Token.cs
- PathTooLongException.cs
- DbException.cs
- UrlMapping.cs
- DbModificationClause.cs
- InnerItemCollectionView.cs
- Int32Animation.cs
- ServiceMemoryGates.cs
- DPCustomTypeDescriptor.cs
- RuntimeArgumentHandle.cs
- FormsAuthenticationUser.cs
- TextOptionsInternal.cs
- RuleSettingsCollection.cs
- CopyOnWriteList.cs
- HeaderedItemsControl.cs
- TextDecorations.cs
- UriParserTemplates.cs
- Int16AnimationUsingKeyFrames.cs
- CssTextWriter.cs
- HtmlLink.cs
- Action.cs
- WebPartAuthorizationEventArgs.cs
- ReadWriteControlDesigner.cs
- SystemColors.cs
- PtsCache.cs
- AccessText.cs
- DefaultAsyncDataDispatcher.cs
- ContextMenuAutomationPeer.cs
- autovalidator.cs
- OpCellTreeNode.cs
- HandlerBase.cs
- PenContext.cs
- CacheForPrimitiveTypes.cs
- DataSourceSelectArguments.cs
- OrderByQueryOptionExpression.cs
- XmlTypeAttribute.cs
- WebPartsSection.cs
- TransactionInformation.cs
- Context.cs
- XmlAttributeCollection.cs
- CookieProtection.cs
- ParenthesizePropertyNameAttribute.cs
- LambdaCompiler.Logical.cs
- WindowsGraphics2.cs
- Wrapper.cs
- BindingMemberInfo.cs
- Group.cs
- ActivityInstanceReference.cs
- CacheDependency.cs
- _SecureChannel.cs
- SqlCachedBuffer.cs
- UnauthorizedAccessException.cs
- TextMetrics.cs
- ControlCollection.cs
- OdbcDataAdapter.cs
- TypeInitializationException.cs
- CallbackHandler.cs
- CorrelationActionMessageFilter.cs
- SafeFileMappingHandle.cs
- StdValidatorsAndConverters.cs