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
- XamlToRtfParser.cs
- PageThemeCodeDomTreeGenerator.cs
- UpdateManifestForBrowserApplication.cs
- StyleCollectionEditor.cs
- BamlLocalizer.cs
- TextParagraphCache.cs
- WaitHandleCannotBeOpenedException.cs
- GetReadStreamResult.cs
- FormattedText.cs
- RichTextBox.cs
- DataGridViewColumnEventArgs.cs
- DataGridViewCellStyleEditor.cs
- TrackingAnnotationCollection.cs
- ActivationServices.cs
- WorkflowMessageEventArgs.cs
- ViewStateModeByIdAttribute.cs
- DataGridViewColumnStateChangedEventArgs.cs
- UnknownBitmapDecoder.cs
- Pointer.cs
- EditorAttributeInfo.cs
- ArrayWithOffset.cs
- TypeValidationEventArgs.cs
- ComponentResourceKey.cs
- X509UI.cs
- TabItemWrapperAutomationPeer.cs
- TempFiles.cs
- BuilderInfo.cs
- MimeParameters.cs
- MachineKeyConverter.cs
- GridViewHeaderRowPresenter.cs
- Identifier.cs
- FamilyMap.cs
- ProcessProtocolHandler.cs
- IconConverter.cs
- SourceElementsCollection.cs
- PrimaryKeyTypeConverter.cs
- sortedlist.cs
- CloudCollection.cs
- PageAsyncTask.cs
- TableColumn.cs
- AbandonedMutexException.cs
- DataGridViewCheckBoxColumn.cs
- DateTimeValueSerializer.cs
- RuleRef.cs
- XPathArrayIterator.cs
- ClassHandlersStore.cs
- LexicalChunk.cs
- MethodBuilderInstantiation.cs
- HScrollProperties.cs
- HostingPreferredMapPath.cs
- ControlBuilder.cs
- RightNameExpirationInfoPair.cs
- InputElement.cs
- UserMapPath.cs
- MembershipUser.cs
- GeneralTransform3DTo2DTo3D.cs
- MergeFailedEvent.cs
- KeyValueConfigurationCollection.cs
- SqlDataSourceQueryEditor.cs
- SystemIPInterfaceStatistics.cs
- SecurityKeyIdentifierClause.cs
- Emitter.cs
- _NestedSingleAsyncResult.cs
- Size.cs
- SkipStoryboardToFill.cs
- Pointer.cs
- ParallelTimeline.cs
- XhtmlBasicTextViewAdapter.cs
- BuilderPropertyEntry.cs
- Literal.cs
- ISAPIWorkerRequest.cs
- SamlAuthorityBinding.cs
- ListViewAutomationPeer.cs
- StackBuilderSink.cs
- DisposableCollectionWrapper.cs
- AssertHelper.cs
- ReceiveActivityDesignerTheme.cs
- WebRequestModuleElementCollection.cs
- Oci.cs
- CommandManager.cs
- CodeGenerationManager.cs
- GridViewRow.cs
- ResolvedKeyFrameEntry.cs
- FactoryMaker.cs
- DrawingCollection.cs
- LineServicesCallbacks.cs
- CodeDirectionExpression.cs
- RoutedCommand.cs
- _NTAuthentication.cs
- NumberFormatter.cs
- ListItemCollection.cs
- UnsafeNativeMethods.cs
- DataServiceClientException.cs
- hresults.cs
- HtmlElementErrorEventArgs.cs
- TextAnchor.cs
- XmlSortKey.cs
- CharacterString.cs
- CodeExpressionStatement.cs
- CommandBindingCollection.cs