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
- sqlinternaltransaction.cs
- NodeInfo.cs
- XmlSchemaCompilationSettings.cs
- MetadataCache.cs
- EntityParameter.cs
- Internal.cs
- _StreamFramer.cs
- FontResourceCache.cs
- VariableModifiersHelper.cs
- EditingCoordinator.cs
- ListViewCancelEventArgs.cs
- PatternMatchRules.cs
- SafeSecurityHandles.cs
- Propagator.ExtentPlaceholderCreator.cs
- Region.cs
- ObservableDictionary.cs
- RuntimeConfigLKG.cs
- NCryptNative.cs
- OleDbException.cs
- DataSourceHelper.cs
- InvalidOleVariantTypeException.cs
- CodeArrayCreateExpression.cs
- BooleanSwitch.cs
- FocusTracker.cs
- NeutralResourcesLanguageAttribute.cs
- EntityDataSourceMemberPath.cs
- ControllableStoryboardAction.cs
- HttpListenerContext.cs
- CompareInfo.cs
- TableColumnCollectionInternal.cs
- WebUtil.cs
- GB18030Encoding.cs
- HitTestWithGeometryDrawingContextWalker.cs
- FixedPageProcessor.cs
- RtfControls.cs
- ImageAttributes.cs
- adornercollection.cs
- PointF.cs
- DelegateHelpers.cs
- TextShapeableCharacters.cs
- OverlappedContext.cs
- FontUnitConverter.cs
- FileSecurity.cs
- RegexReplacement.cs
- ThumbAutomationPeer.cs
- ResolvedKeyFrameEntry.cs
- ClientRolePrincipal.cs
- Boolean.cs
- LoginCancelEventArgs.cs
- WebPartCatalogAddVerb.cs
- SafeNativeMethods.cs
- MarkupWriter.cs
- ItemDragEvent.cs
- FontDifferentiator.cs
- TextContainerChangeEventArgs.cs
- TextSpanModifier.cs
- Themes.cs
- ReversePositionQuery.cs
- CodeAssignStatement.cs
- SiteMapNodeCollection.cs
- PasswordBoxAutomationPeer.cs
- KerberosSecurityTokenProvider.cs
- DbFunctionCommandTree.cs
- CryptoHelper.cs
- DoubleMinMaxAggregationOperator.cs
- ResourcePermissionBase.cs
- InputScopeManager.cs
- Helper.cs
- ConfigXmlComment.cs
- TypeLoadException.cs
- Pkcs7Signer.cs
- WindowsTreeView.cs
- WrappedReader.cs
- DocumentViewerConstants.cs
- TabControlEvent.cs
- SoundPlayerAction.cs
- TextElementEditingBehaviorAttribute.cs
- XmlSchemaAppInfo.cs
- HtmlElementCollection.cs
- TargetException.cs
- EditorPart.cs
- NameValuePermission.cs
- MdiWindowListStrip.cs
- Assembly.cs
- TouchesCapturedWithinProperty.cs
- PolyBezierSegment.cs
- CancellationState.cs
- PermissionSetTriple.cs
- ToolStripKeyboardHandlingService.cs
- FlowDocumentReader.cs
- HttpDigestClientElement.cs
- XmlTextEncoder.cs
- DbCommandDefinition.cs
- SQLMoney.cs
- XPathScanner.cs
- ServiceInstanceProvider.cs
- OptimalBreakSession.cs
- SqlDataSource.cs
- DispatcherTimer.cs
- EnumCodeDomSerializer.cs