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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SecurityTokenSerializer.cs
- StrokeNode.cs
- newitemfactory.cs
- EncryptedData.cs
- CodeVariableDeclarationStatement.cs
- TagNameToTypeMapper.cs
- ContainerUIElement3D.cs
- ApplicationInfo.cs
- TemplateBamlRecordReader.cs
- PageThemeParser.cs
- DynamicFilter.cs
- LexicalChunk.cs
- Point3DAnimationUsingKeyFrames.cs
- Rotation3DAnimation.cs
- ExpressionTextBox.xaml.cs
- ValidatingReaderNodeData.cs
- Membership.cs
- ExceptionUtil.cs
- Viewport3DVisual.cs
- SiteOfOriginContainer.cs
- CheckedPointers.cs
- Color.cs
- CssStyleCollection.cs
- MessageSmuggler.cs
- HtmlFormAdapter.cs
- CollectionsUtil.cs
- Style.cs
- PrintPreviewControl.cs
- DataGridViewColumnCollectionDialog.cs
- BinaryObjectReader.cs
- WeakReferenceList.cs
- MailAddress.cs
- LayoutUtils.cs
- SoapCommonClasses.cs
- DelegatedStream.cs
- WebPartDescription.cs
- HostedHttpRequestAsyncResult.cs
- Int16Converter.cs
- TraceContextRecord.cs
- DataControlLinkButton.cs
- WsdlBuildProvider.cs
- DES.cs
- Comparer.cs
- QuaternionConverter.cs
- DecoratedNameAttribute.cs
- DbDataRecord.cs
- GacUtil.cs
- ServiceOperationDetailViewControl.cs
- PointLightBase.cs
- WorkflowApplicationAbortedEventArgs.cs
- HtmlInputRadioButton.cs
- ContextStack.cs
- LineGeometry.cs
- ExpandableObjectConverter.cs
- DetailsViewUpdatedEventArgs.cs
- NavigationProperty.cs
- DropDownList.cs
- RelationshipManager.cs
- WeakHashtable.cs
- ExpressionDumper.cs
- VectorAnimation.cs
- AvtEvent.cs
- SettingsSavedEventArgs.cs
- CodeIndexerExpression.cs
- SortFieldComparer.cs
- SoapAttributeAttribute.cs
- DocComment.cs
- ToolStripGrip.cs
- WindowAutomationPeer.cs
- XamlBrushSerializer.cs
- oledbmetadatacolumnnames.cs
- ToolStripRenderer.cs
- SecurityException.cs
- UrlAuthFailedErrorFormatter.cs
- WebPartConnectionsConfigureVerb.cs
- SqlFormatter.cs
- Typography.cs
- ECDiffieHellmanCngPublicKey.cs
- Point3DCollectionValueSerializer.cs
- XPathMessageFilterElement.cs
- LabelTarget.cs
- SelectionList.cs
- XmlSortKey.cs
- FaultPropagationRecord.cs
- SystemIPGlobalStatistics.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- FieldAccessException.cs
- StrongNameMembershipCondition.cs
- DiagnosticsConfiguration.cs
- Substitution.cs
- ApplicationException.cs
- Graphics.cs
- SqlProfileProvider.cs
- ProcessInfo.cs
- TextCharacters.cs
- UriTemplateMatchException.cs
- XmlNamespaceManager.cs
- _AcceptOverlappedAsyncResult.cs
- TimeoutConverter.cs
- EditCommandColumn.cs