Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- WindowsPrincipal.cs
- TokenCreationException.cs
- MetadataSerializer.cs
- TextTreeInsertUndoUnit.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- TextWriterTraceListener.cs
- UIElementParagraph.cs
- CustomLineCap.cs
- CharacterBufferReference.cs
- ParentQuery.cs
- XmlExpressionDumper.cs
- DiscardableAttribute.cs
- Int32AnimationUsingKeyFrames.cs
- DocumentViewer.cs
- smtppermission.cs
- ConnectionsZone.cs
- HttpModuleCollection.cs
- StandardTransformFactory.cs
- CalendarData.cs
- AuthenticatingEventArgs.cs
- SchemaExporter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- UseLicense.cs
- documentation.cs
- DataGridViewCheckBoxCell.cs
- DocumentPageHost.cs
- RuleElement.cs
- CodeTypeDelegate.cs
- ResizingMessageFilter.cs
- InvalidateEvent.cs
- ListViewInsertedEventArgs.cs
- ComplexBindingPropertiesAttribute.cs
- UnmanagedMemoryAccessor.cs
- XmlWhitespace.cs
- IdnMapping.cs
- ThreadAbortException.cs
- MDIControlStrip.cs
- ModuleBuilder.cs
- InheritanceAttribute.cs
- ReadOnlyCollection.cs
- Wrapper.cs
- StyleBamlRecordReader.cs
- DragDropHelper.cs
- XmlSchemaSimpleContent.cs
- DataGridTable.cs
- RequestBringIntoViewEventArgs.cs
- MatchingStyle.cs
- SmtpMail.cs
- ProgressChangedEventArgs.cs
- ScriptingJsonSerializationSection.cs
- VirtualizingStackPanel.cs
- Int32CollectionConverter.cs
- EventLogHandle.cs
- FormViewUpdateEventArgs.cs
- EntitySqlQueryState.cs
- AutomationTextAttribute.cs
- TextEndOfSegment.cs
- MetadataArtifactLoaderCompositeResource.cs
- DragEventArgs.cs
- ListBoxAutomationPeer.cs
- ColorTransformHelper.cs
- _SslSessionsCache.cs
- UseLicense.cs
- TrackingLocation.cs
- SharedPerformanceCounter.cs
- ResourceDictionaryCollection.cs
- EntityTypeBase.cs
- NullableBoolConverter.cs
- DependencyPropertyValueSerializer.cs
- TypeConverter.cs
- Translator.cs
- BamlRecords.cs
- ListViewDeletedEventArgs.cs
- RadioButtonPopupAdapter.cs
- ParameterToken.cs
- TextViewBase.cs
- DataPointer.cs
- ListMarkerSourceInfo.cs
- InternalControlCollection.cs
- EventLogPermissionEntryCollection.cs
- SafeNativeMethods.cs
- ImageMapEventArgs.cs
- CallId.cs
- WebBrowserNavigatingEventHandler.cs
- ControlParameter.cs
- HitTestDrawingContextWalker.cs
- SessionParameter.cs
- ConsoleCancelEventArgs.cs
- StorageAssociationTypeMapping.cs
- HttpServerUtilityWrapper.cs
- OdbcUtils.cs
- ScrollContentPresenter.cs
- DataGridHelper.cs
- CompiledQueryCacheEntry.cs
- SecurityContextCookieSerializer.cs
- RadioButtonFlatAdapter.cs
- GridViewAutoFormat.cs
- XPathCompileException.cs
- ConnectionAcceptor.cs
- ExpressionCopier.cs