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
- LoadRetryAsyncResult.cs
- PropertyTabAttribute.cs
- HtmlHead.cs
- ProvidersHelper.cs
- SatelliteContractVersionAttribute.cs
- DbParameterCollectionHelper.cs
- AnnotationResourceCollection.cs
- BackStopAuthenticationModule.cs
- BitmapScalingModeValidation.cs
- WorkflowTransactionOptions.cs
- ConfigXmlComment.cs
- Rfc2898DeriveBytes.cs
- UnionExpr.cs
- PageParserFilter.cs
- AdornerHitTestResult.cs
- GeometryValueSerializer.cs
- _ChunkParse.cs
- ListViewDeletedEventArgs.cs
- OutputChannel.cs
- CfgArc.cs
- PointCollectionValueSerializer.cs
- TrackingServices.cs
- TransformGroup.cs
- LocalValueEnumerator.cs
- SQLInt64.cs
- VoiceObjectToken.cs
- DesignerAutoFormatCollection.cs
- ByteStreamMessage.cs
- ToolStripDropTargetManager.cs
- ClientConvert.cs
- ConfigurationCollectionAttribute.cs
- RunClient.cs
- DomainLiteralReader.cs
- SafeReversePInvokeHandle.cs
- CompositeControl.cs
- SQLInt32Storage.cs
- VisualBasic.cs
- SemanticAnalyzer.cs
- ResolveCriteriaCD1.cs
- HeaderedContentControl.cs
- GlyphRunDrawing.cs
- LinearQuaternionKeyFrame.cs
- QualifierSet.cs
- XamlReaderHelper.cs
- Attributes.cs
- Page.cs
- FormParameter.cs
- StatusBarPanel.cs
- StatusBarPanelClickEvent.cs
- relpropertyhelper.cs
- XmlSchemaInclude.cs
- Propagator.ExtentPlaceholderCreator.cs
- exports.cs
- QilFunction.cs
- StrongNamePublicKeyBlob.cs
- AuthStoreRoleProvider.cs
- PackageRelationshipCollection.cs
- ComponentChangedEvent.cs
- NegotiationTokenAuthenticatorStateCache.cs
- LinqToSqlWrapper.cs
- LinearGradientBrush.cs
- SessionState.cs
- ServiceContractGenerationContext.cs
- ValidationPropertyAttribute.cs
- DetailsViewUpdateEventArgs.cs
- RenderingEventArgs.cs
- ReflectEventDescriptor.cs
- ellipse.cs
- DataGridTextBox.cs
- MethodExpression.cs
- PageRouteHandler.cs
- EndpointDiscoveryBehavior.cs
- Int16AnimationUsingKeyFrames.cs
- NumberSubstitution.cs
- LocalFileSettingsProvider.cs
- Figure.cs
- Condition.cs
- PolyBezierSegment.cs
- PrePrepareMethodAttribute.cs
- VirtualPathUtility.cs
- RoleExceptions.cs
- ColorContextHelper.cs
- MissingFieldException.cs
- ByteStreamMessage.cs
- DesignerCategoryAttribute.cs
- TemplateBindingExtension.cs
- DecimalAnimationBase.cs
- _ProxyRegBlob.cs
- SkinIDTypeConverter.cs
- TextFormatterHost.cs
- SHA384Managed.cs
- DataRecord.cs
- LateBoundBitmapDecoder.cs
- CompositeScriptReferenceEventArgs.cs
- StatusBarItem.cs
- entityreference_tresulttype.cs
- PhysicalOps.cs
- CancellationState.cs
- BufferedGraphicsManager.cs
- figurelengthconverter.cs