Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / ByteConverter.cs / 1305376 / ByteConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.ComponentModel; 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 ByteConverter : BaseNumberConverter { ///Provides a /// type converter to convert 8-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(Byte); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToByte(value, radix); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Byte.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 Byte.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Byte)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.ComponentModel; 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 ByteConverter : BaseNumberConverter { ///Provides a /// type converter to convert 8-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(Byte); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToByte(value, radix); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Byte.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 Byte.Parse(value, culture); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Byte)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
- SearchForVirtualItemEventArgs.cs
- IssuanceLicense.cs
- CodeTypeReferenceCollection.cs
- SchemaConstraints.cs
- ClientBuildManager.cs
- CommonXSendMessage.cs
- ColorBlend.cs
- TrackingProfileCache.cs
- filewebresponse.cs
- SelectedDatesCollection.cs
- Viewport2DVisual3D.cs
- OraclePermissionAttribute.cs
- DoubleLinkListEnumerator.cs
- ContextStack.cs
- OverlappedAsyncResult.cs
- OverrideMode.cs
- DocumentPaginator.cs
- DiscardableAttribute.cs
- SystemBrushes.cs
- JoinCqlBlock.cs
- DependencyObjectPropertyDescriptor.cs
- ButtonChrome.cs
- WebSysDescriptionAttribute.cs
- WebPartUtil.cs
- ProcessHost.cs
- Reference.cs
- Events.cs
- RequestStatusBarUpdateEventArgs.cs
- Normalization.cs
- DataGridViewAdvancedBorderStyle.cs
- RadialGradientBrush.cs
- ResourceSetExpression.cs
- TranslateTransform.cs
- SqlTrackingService.cs
- BuildTopDownAttribute.cs
- UIElement.cs
- XmlNodeComparer.cs
- ExtractCollection.cs
- GridViewRow.cs
- Command.cs
- PanelStyle.cs
- TerminatorSinks.cs
- ToggleButtonAutomationPeer.cs
- ImageList.cs
- XmlSchemaSimpleContent.cs
- httpserverutility.cs
- XPathSelectionIterator.cs
- UndirectedGraph.cs
- xml.cs
- ToolStripPanelDesigner.cs
- SqlTriggerAttribute.cs
- GB18030Encoding.cs
- CodeObjectCreateExpression.cs
- EntityDataReader.cs
- EventWaitHandle.cs
- RawAppCommandInputReport.cs
- ErrorStyle.cs
- HttpCacheVary.cs
- PagePropertiesChangingEventArgs.cs
- PriorityQueue.cs
- AuthenticationModulesSection.cs
- DataSetMappper.cs
- UiaCoreApi.cs
- HierarchicalDataBoundControlAdapter.cs
- CryptoApi.cs
- SubclassTypeValidator.cs
- DnsPermission.cs
- RichTextBoxContextMenu.cs
- _SslState.cs
- AuthorizationRuleCollection.cs
- CmsInterop.cs
- Debugger.cs
- Stacktrace.cs
- FixedSOMPage.cs
- WindowsFormsSynchronizationContext.cs
- ToggleButtonAutomationPeer.cs
- NativeMethods.cs
- ACL.cs
- TextProperties.cs
- _HelperAsyncResults.cs
- PartialList.cs
- FieldAccessException.cs
- EncryptedHeader.cs
- SiteIdentityPermission.cs
- PageAdapter.cs
- CodeDirectoryCompiler.cs
- SmiEventStream.cs
- Int32Storage.cs
- GeometryCollection.cs
- Camera.cs
- __Error.cs
- FrameworkContentElementAutomationPeer.cs
- StrongNameHelpers.cs
- BaseValidator.cs
- InheritanceContextHelper.cs
- ZipIOLocalFileHeader.cs
- arabicshape.cs
- FrameworkElementFactoryMarkupObject.cs
- ProtocolsConfigurationHandler.cs
- RoutedEvent.cs