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
- SqlCacheDependency.cs
- PropertyStore.cs
- SqlCacheDependency.cs
- ToolStripItemTextRenderEventArgs.cs
- ClosureBinding.cs
- DataStreams.cs
- HashAlgorithm.cs
- UpdateException.cs
- OutputBuffer.cs
- infer.cs
- Validator.cs
- Part.cs
- ZoneIdentityPermission.cs
- WindowsEditBoxRange.cs
- SQLInt32.cs
- NativeBuffer.cs
- RoutedEventValueSerializer.cs
- DocumentApplication.cs
- WindowsToolbarItemAsMenuItem.cs
- SqlUserDefinedAggregateAttribute.cs
- XamlToRtfWriter.cs
- HtmlControlPersistable.cs
- ApplicationProxyInternal.cs
- RuntimeWrappedException.cs
- FigureParagraph.cs
- FlowDocumentReader.cs
- OpCellTreeNode.cs
- SqlBuffer.cs
- AssociativeAggregationOperator.cs
- PrintingPermissionAttribute.cs
- ZipIOExtraFieldZip64Element.cs
- EventNotify.cs
- RuleInfoComparer.cs
- WebConfigurationHost.cs
- BindingUtils.cs
- CodeIdentifier.cs
- MediaPlayer.cs
- XmlEntityReference.cs
- ZoneButton.cs
- ZoneMembershipCondition.cs
- DataKeyCollection.cs
- ListBoxItemAutomationPeer.cs
- DrawingContextWalker.cs
- base64Transforms.cs
- SchemaMapping.cs
- TagPrefixAttribute.cs
- SharedDp.cs
- HWStack.cs
- LineVisual.cs
- XmlEncodedRawTextWriter.cs
- RangeExpression.cs
- EntryWrittenEventArgs.cs
- LookupNode.cs
- SrgsRule.cs
- HttpListener.cs
- AuthenticateEventArgs.cs
- CodeTypeDelegate.cs
- TemplatePropertyEntry.cs
- ProviderUtil.cs
- CalendarDay.cs
- PointHitTestResult.cs
- XmlEncoding.cs
- TextElementEditingBehaviorAttribute.cs
- VScrollProperties.cs
- Buffer.cs
- KerberosReceiverSecurityToken.cs
- EventNotify.cs
- MimeBasePart.cs
- TextFormatter.cs
- LinqDataSource.cs
- ToolStripStatusLabel.cs
- WebCategoryAttribute.cs
- Validator.cs
- IConvertible.cs
- OleDbParameterCollection.cs
- UIAgentRequest.cs
- OledbConnectionStringbuilder.cs
- TextChange.cs
- StylusPointProperties.cs
- FileAuthorizationModule.cs
- HtmlMeta.cs
- SqlConnectionStringBuilder.cs
- ProjectionPathBuilder.cs
- WebPartConnectionsDisconnectVerb.cs
- DataGridViewCellStyleChangedEventArgs.cs
- StdRegProviderWrapper.cs
- SocketElement.cs
- WindowsAltTab.cs
- VariantWrapper.cs
- ControlPersister.cs
- RSACryptoServiceProvider.cs
- TrustSection.cs
- SecurityTokenReferenceStyle.cs
- FixedPageStructure.cs
- TreeViewBindingsEditor.cs
- ServiceAppDomainAssociationProvider.cs
- AuthorizationRuleCollection.cs
- Knowncolors.cs
- WinFormsComponentEditor.cs
- DBConnectionString.cs