Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / ComponentModel / ByteConverter.cs / 1 / 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
- ControlPropertyNameConverter.cs
- HyperlinkAutomationPeer.cs
- RuleAttributes.cs
- FixedPage.cs
- SettingsPropertyValue.cs
- ConstraintStruct.cs
- HttpPostProtocolReflector.cs
- MultiPageTextView.cs
- ProcessThread.cs
- CacheChildrenQuery.cs
- TextElement.cs
- PerformanceCounterPermissionEntryCollection.cs
- PointUtil.cs
- MasterPageBuildProvider.cs
- Array.cs
- LabelEditEvent.cs
- CompiledELinqQueryState.cs
- DotExpr.cs
- ListViewItem.cs
- RegionData.cs
- AggregateNode.cs
- AssemblyName.cs
- QilExpression.cs
- ApplicationException.cs
- NativeMethods.cs
- DataGridViewImageColumn.cs
- GraphicsContext.cs
- NetworkInformationException.cs
- CodeMemberProperty.cs
- StorageAssociationSetMapping.cs
- DocumentPageView.cs
- NamedObject.cs
- ExpressionBindingCollection.cs
- _NestedSingleAsyncResult.cs
- PropertyEmitter.cs
- Point3DCollectionValueSerializer.cs
- SudsCommon.cs
- HttpWriter.cs
- SendMailErrorEventArgs.cs
- entitydatasourceentitysetnameconverter.cs
- FixedSOMContainer.cs
- SqlUtil.cs
- TextAction.cs
- CharacterBufferReference.cs
- Query.cs
- SQLDateTime.cs
- control.ime.cs
- FontSourceCollection.cs
- AudioFormatConverter.cs
- ProcessManager.cs
- EntityDataSourceDesignerHelper.cs
- ServiceProviders.cs
- SafeUserTokenHandle.cs
- SafeEventHandle.cs
- OracleInternalConnection.cs
- backend.cs
- Assembly.cs
- ProcessModelSection.cs
- HttpProtocolImporter.cs
- PackageProperties.cs
- SqlInfoMessageEvent.cs
- Asn1Utilities.cs
- AuthenticationManager.cs
- ListSourceHelper.cs
- PrivateFontCollection.cs
- DocumentCollection.cs
- HttpCapabilitiesBase.cs
- _ContextAwareResult.cs
- XamlParser.cs
- ClientBuildManagerCallback.cs
- HtmlToClrEventProxy.cs
- GeneralTransform3DTo2D.cs
- Attribute.cs
- NavigationWindow.cs
- TextDecorationUnitValidation.cs
- ImageMapEventArgs.cs
- RightsManagementErrorHandler.cs
- ToolStripArrowRenderEventArgs.cs
- _ConnectOverlappedAsyncResult.cs
- Scene3D.cs
- DataBoundControlHelper.cs
- MenuItem.cs
- ContentFilePart.cs
- SHA1Managed.cs
- StaticSiteMapProvider.cs
- Internal.cs
- loginstatus.cs
- PerfCounterSection.cs
- wmiutil.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SystemIcmpV4Statistics.cs
- Splitter.cs
- AllMembershipCondition.cs
- DataControlImageButton.cs
- TransactionFlowBindingElementImporter.cs
- BroadcastEventHelper.cs
- Process.cs
- DoubleConverter.cs
- ContextActivityUtils.cs
- FilterException.cs