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
- CollectionContainer.cs
- SingleTagSectionHandler.cs
- PresentationSource.cs
- CompilerState.cs
- MediaContextNotificationWindow.cs
- SoapInteropTypes.cs
- ToolStripDropDownButton.cs
- ParameterCollection.cs
- StrongNameUtility.cs
- RepeaterCommandEventArgs.cs
- TransformedBitmap.cs
- DataGridViewCellEventArgs.cs
- UIAgentAsyncBeginRequest.cs
- EntitySetDataBindingList.cs
- ToolStripSeparatorRenderEventArgs.cs
- OracleLob.cs
- PerspectiveCamera.cs
- GridViewActionList.cs
- HttpConfigurationSystem.cs
- ExtensionWindowResizeGrip.cs
- DeflateInput.cs
- ServiceObjectContainer.cs
- XPathMultyIterator.cs
- ImageListImage.cs
- EntityProviderFactory.cs
- BooleanAnimationUsingKeyFrames.cs
- BindingContext.cs
- SqlConnectionPoolProviderInfo.cs
- ButtonPopupAdapter.cs
- DataGridColumn.cs
- TemplateBamlTreeBuilder.cs
- TreeBuilder.cs
- ProgressBarBrushConverter.cs
- DataGridSortCommandEventArgs.cs
- HTMLTextWriter.cs
- CleanUpVirtualizedItemEventArgs.cs
- DictionaryBase.cs
- NativeMethods.cs
- EdmComplexTypeAttribute.cs
- FileDialogCustomPlacesCollection.cs
- IsolatedStorage.cs
- OleCmdHelper.cs
- ControlValuePropertyAttribute.cs
- TableCell.cs
- EditCommandColumn.cs
- TextRunProperties.cs
- UserPersonalizationStateInfo.cs
- ArithmeticLiteral.cs
- BitConverter.cs
- HtmlInputHidden.cs
- LinqDataSourceEditData.cs
- ProjectionQueryOptionExpression.cs
- FillErrorEventArgs.cs
- Mappings.cs
- EnumMemberAttribute.cs
- DynamicPhysicalDiscoSearcher.cs
- Scheduler.cs
- SecurityState.cs
- WindowsListViewGroup.cs
- WebBrowser.cs
- BoundingRectTracker.cs
- EndOfStreamException.cs
- CategoryEditor.cs
- EndpointNotFoundException.cs
- InputLanguageSource.cs
- ComponentEditorPage.cs
- FileSecurity.cs
- AccessText.cs
- DbSetClause.cs
- MyContact.cs
- MessageProtectionOrder.cs
- TextEditorCopyPaste.cs
- PreApplicationStartMethodAttribute.cs
- Vector3D.cs
- BitmapEffectInput.cs
- MetadataArtifactLoaderCompositeResource.cs
- FilterQueryOptionExpression.cs
- XmlBindingWorker.cs
- TextPointerBase.cs
- RoutedEventHandlerInfo.cs
- TypeDependencyAttribute.cs
- _DigestClient.cs
- AutomationPeer.cs
- MethodSet.cs
- DataSourceXmlSerializer.cs
- ByValueEqualityComparer.cs
- StylusEditingBehavior.cs
- RepeaterItem.cs
- ExpressionPrefixAttribute.cs
- ping.cs
- AttributeProviderAttribute.cs
- HtmlLink.cs
- XmlSchemaImport.cs
- ConfigsHelper.cs
- Fault.cs
- RepeatBehaviorConverter.cs
- Tile.cs
- X500Name.cs
- UpdateManifestForBrowserApplication.cs
- GraphicsContext.cs