Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- KnownBoxes.cs
- NameObjectCollectionBase.cs
- SelectedGridItemChangedEvent.cs
- EnumerableRowCollectionExtensions.cs
- ChannelProtectionRequirements.cs
- ConfigXmlText.cs
- XmlnsCache.cs
- ExpressionVisitor.cs
- MetadataItemEmitter.cs
- BooleanSwitch.cs
- ControlType.cs
- BaseServiceProvider.cs
- FormViewPageEventArgs.cs
- WebCategoryAttribute.cs
- MsmqIntegrationChannelListener.cs
- HttpWebResponse.cs
- SingleObjectCollection.cs
- UmAlQuraCalendar.cs
- CellTreeNodeVisitors.cs
- ControlsConfig.cs
- RenderDataDrawingContext.cs
- DesignerAutoFormatCollection.cs
- TripleDES.cs
- ClientSettingsSection.cs
- MaterialGroup.cs
- InsufficientMemoryException.cs
- InfoCardCryptoHelper.cs
- SolidColorBrush.cs
- TrustDriver.cs
- BitmapEffectDrawing.cs
- ContentDefinition.cs
- UnsafeNativeMethods.cs
- FontSizeConverter.cs
- DateTimePicker.cs
- ZipIOBlockManager.cs
- ButtonRenderer.cs
- AssemblyAssociatedContentFileAttribute.cs
- _BasicClient.cs
- DelegateOutArgument.cs
- AmbiguousMatchException.cs
- ArgumentFixer.cs
- AbandonedMutexException.cs
- SerializationFieldInfo.cs
- SwitchElementsCollection.cs
- DataGridColumnHeaderAutomationPeer.cs
- InvalidFilterCriteriaException.cs
- DataListCommandEventArgs.cs
- ConfigurationLockCollection.cs
- ReturnType.cs
- Int32CAMarshaler.cs
- QualifiedCellIdBoolean.cs
- Button.cs
- CriticalFinalizerObject.cs
- Viewport3DAutomationPeer.cs
- OleDbConnection.cs
- Window.cs
- ControlTemplate.cs
- WebUtil.cs
- TableLayoutStyle.cs
- DataGridViewSortCompareEventArgs.cs
- HttpListener.cs
- Error.cs
- PropertySegmentSerializer.cs
- Version.cs
- BatchParser.cs
- CorruptingExceptionCommon.cs
- DetailsViewDeletedEventArgs.cs
- PreviewPageInfo.cs
- Rotation3DAnimation.cs
- StateDesigner.Helpers.cs
- CTreeGenerator.cs
- WebDescriptionAttribute.cs
- FamilyMap.cs
- SubMenuStyleCollection.cs
- UpdatePanelTrigger.cs
- Logging.cs
- ContextItemManager.cs
- TimeEnumHelper.cs
- TemplateAction.cs
- ZipIOCentralDirectoryBlock.cs
- ToolBarButtonClickEvent.cs
- WorkflowDefinitionDispenser.cs
- LogicalChannelCollection.cs
- MDIControlStrip.cs
- ResourceCodeDomSerializer.cs
- ApplicationContext.cs
- Triplet.cs
- StatusBarDrawItemEvent.cs
- ContainerVisual.cs
- SystemUnicastIPAddressInformation.cs
- Function.cs
- ExtentCqlBlock.cs
- ClientScriptManager.cs
- SortedList.cs
- TableLayoutRowStyleCollection.cs
- WeakReferenceEnumerator.cs
- SessionStateItemCollection.cs
- UnsafeNativeMethods.cs
- DataSetViewSchema.cs
- ImmutablePropertyDescriptorGridEntry.cs