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
- LineMetrics.cs
- AccessDataSourceWizardForm.cs
- Parser.cs
- PointConverter.cs
- FrameworkTextComposition.cs
- SqlInternalConnection.cs
- PageContentCollection.cs
- DockPanel.cs
- Visitor.cs
- SatelliteContractVersionAttribute.cs
- EventMappingSettingsCollection.cs
- ConditionCollection.cs
- MenuItemBindingCollection.cs
- CorrelationTokenInvalidatedHandler.cs
- TemplateXamlParser.cs
- DataBindingList.cs
- DirectoryNotFoundException.cs
- OrCondition.cs
- FamilyMap.cs
- RelationshipEndCollection.cs
- ScrollChrome.cs
- SemanticResultValue.cs
- BitArray.cs
- GridViewEditEventArgs.cs
- TokenBasedSet.cs
- HybridDictionary.cs
- SchemaNamespaceManager.cs
- Root.cs
- DynamicValidatorEventArgs.cs
- DataGridCellAutomationPeer.cs
- Error.cs
- BufferBuilder.cs
- CompilerParameters.cs
- ControlValuePropertyAttribute.cs
- PropertyNames.cs
- SHA1.cs
- SecurityUtils.cs
- ObjectDataSourceSelectingEventArgs.cs
- ChannelReliableSession.cs
- SqlDataSourceView.cs
- BitmapEffect.cs
- NotSupportedException.cs
- DbgUtil.cs
- ServiceOperationViewControl.cs
- IntegerValidatorAttribute.cs
- DataKey.cs
- PageThemeCodeDomTreeGenerator.cs
- UTF7Encoding.cs
- SmtpDigestAuthenticationModule.cs
- SqlColumnizer.cs
- KeyManager.cs
- TypeUtils.cs
- CanonicalizationDriver.cs
- WebZoneDesigner.cs
- BinaryCommonClasses.cs
- InertiaTranslationBehavior.cs
- BindingOperations.cs
- ToolboxItemFilterAttribute.cs
- XPathNode.cs
- HtmlControlPersistable.cs
- SqlUDTStorage.cs
- ControlPropertyNameConverter.cs
- MenuItemAutomationPeer.cs
- RepeatBehavior.cs
- DownloadProgressEventArgs.cs
- XmlDesigner.cs
- WebZoneDesigner.cs
- TransactionInformation.cs
- TraceSource.cs
- DataObjectSettingDataEventArgs.cs
- ToolStripPanel.cs
- HtmlForm.cs
- SliderAutomationPeer.cs
- QilFunction.cs
- TableCell.cs
- ContentPlaceHolder.cs
- StrongName.cs
- WSDualHttpSecurityMode.cs
- InfoCardSymmetricAlgorithm.cs
- SqlParameterCollection.cs
- SchemaNotation.cs
- AnnotationService.cs
- PermissionSetEnumerator.cs
- UriTemplateHelpers.cs
- StylusOverProperty.cs
- CodeDelegateCreateExpression.cs
- FieldBuilder.cs
- TouchesCapturedWithinProperty.cs
- FormatterServices.cs
- StatusBarDrawItemEvent.cs
- UnsafeCollabNativeMethods.cs
- RegexMatch.cs
- NonClientArea.cs
- SHA256.cs
- WindowsContainer.cs
- Point3DAnimationUsingKeyFrames.cs
- ComPersistableTypeElement.cs
- ExpandCollapsePattern.cs
- WinCategoryAttribute.cs
- SafeRightsManagementEnvironmentHandle.cs