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
- _SslState.cs
- ListControl.cs
- ColumnMapTranslator.cs
- TriState.cs
- TextBoxAutoCompleteSourceConverter.cs
- NameValueFileSectionHandler.cs
- ClientSession.cs
- ScriptManager.cs
- MetadataCache.cs
- future.cs
- CodeGotoStatement.cs
- ListArgumentProvider.cs
- DivideByZeroException.cs
- DataGridViewCellCancelEventArgs.cs
- ServiceMetadataContractBehavior.cs
- UIElementParagraph.cs
- Light.cs
- OrderPreservingPipeliningMergeHelper.cs
- ZipIOLocalFileDataDescriptor.cs
- TransformProviderWrapper.cs
- MultiPartWriter.cs
- TokenFactoryFactory.cs
- DataGridViewCheckBoxCell.cs
- Deflater.cs
- DataRecordInternal.cs
- TraceContextRecord.cs
- ViewLoader.cs
- SessionPageStateSection.cs
- SectionVisual.cs
- IgnoreFlushAndCloseStream.cs
- MD5Cng.cs
- ManagementPath.cs
- WebServiceResponse.cs
- TableLayoutPanelDesigner.cs
- ScrollItemProviderWrapper.cs
- RefreshPropertiesAttribute.cs
- DataGridItem.cs
- iisPickupDirectory.cs
- WebServiceParameterData.cs
- CSharpCodeProvider.cs
- XmlUrlResolver.cs
- WebPartTransformerAttribute.cs
- MaskedTextBoxDesignerActionList.cs
- SaveFileDialog.cs
- XMLDiffLoader.cs
- DrawingAttributeSerializer.cs
- validationstate.cs
- OracleException.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- SqlUtil.cs
- CreatingCookieEventArgs.cs
- SetStoryboardSpeedRatio.cs
- ScriptIgnoreAttribute.cs
- DrawingAttributes.cs
- OperationInfo.cs
- SqlDataSourceConnectionPanel.cs
- EntryIndex.cs
- MSHTMLHostUtil.cs
- SerializationAttributes.cs
- AssemblyName.cs
- RecognizerBase.cs
- KeyValueSerializer.cs
- DataColumn.cs
- AppDomainCompilerProxy.cs
- MarkupProperty.cs
- FileDetails.cs
- SynchronizedPool.cs
- cookie.cs
- DataGridViewHitTestInfo.cs
- RuleSettingsCollection.cs
- MessageQueueAccessControlEntry.cs
- StringDictionaryCodeDomSerializer.cs
- EncoderFallback.cs
- SecurityDescriptor.cs
- BitmapEffectDrawingContextState.cs
- StreamGeometryContext.cs
- AsyncWaitHandle.cs
- ImageMetadata.cs
- HttpInputStream.cs
- ResourceContainer.cs
- TraceHelpers.cs
- WindowCollection.cs
- _FtpControlStream.cs
- NumberAction.cs
- TdsParser.cs
- StandardCommands.cs
- BufferedWebEventProvider.cs
- SHA384.cs
- AttributeData.cs
- EdgeProfileValidation.cs
- TransportContext.cs
- UrlRoutingHandler.cs
- DataGridViewCellStyleEditor.cs
- ClientScriptManager.cs
- Script.cs
- SystemNetworkInterface.cs
- TypeKeyValue.cs
- AttachedPropertyInfo.cs
- ValueExpressions.cs
- AuthenticateEventArgs.cs