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
- DataChangedEventManager.cs
- TextServicesHost.cs
- SimpleLine.cs
- Effect.cs
- InvalidDocumentContentsException.cs
- MenuAutoFormat.cs
- RightsDocument.cs
- XPSSignatureDefinition.cs
- CoTaskMemHandle.cs
- ParameterBuilder.cs
- DataGridViewAutoSizeModeEventArgs.cs
- AvTraceDetails.cs
- DataRowChangeEvent.cs
- TypeConverter.cs
- SqlRowUpdatedEvent.cs
- OleDbPermission.cs
- DiscoveryServiceExtension.cs
- VisualStyleInformation.cs
- Material.cs
- GPPOINTF.cs
- MemoryPressure.cs
- SqlAggregateChecker.cs
- EmissiveMaterial.cs
- HtmlInputImage.cs
- SerialErrors.cs
- ExpressionEditorAttribute.cs
- OdbcParameter.cs
- PackWebRequest.cs
- QueryOptionExpression.cs
- MenuItemBindingCollection.cs
- TraceContextEventArgs.cs
- ICspAsymmetricAlgorithm.cs
- ToolStripItemTextRenderEventArgs.cs
- QuerySubExprEliminator.cs
- unsafenativemethodsother.cs
- ValidationRuleCollection.cs
- XmlQueryRuntime.cs
- DataTablePropertyDescriptor.cs
- ComboBox.cs
- SystemIcmpV4Statistics.cs
- _UncName.cs
- ClonableStack.cs
- TimeSpan.cs
- FileInfo.cs
- HuffmanTree.cs
- DbConnectionStringCommon.cs
- BevelBitmapEffect.cs
- ToolStripLabel.cs
- ThreadExceptionDialog.cs
- Scalars.cs
- ButtonAutomationPeer.cs
- EntityStoreSchemaGenerator.cs
- DesignerAutoFormat.cs
- TrackingProfileSerializer.cs
- DataGridViewAccessibleObject.cs
- DbConnectionPoolOptions.cs
- WebBrowser.cs
- StructuredTypeEmitter.cs
- NamespaceCollection.cs
- SizeAnimationBase.cs
- SequenceNumber.cs
- PropertyState.cs
- AspNetSynchronizationContext.cs
- HandledMouseEvent.cs
- XmlCharCheckingReader.cs
- DocumentViewerHelper.cs
- DataGridItemCollection.cs
- WindowsListViewItemStartMenu.cs
- ViewSimplifier.cs
- wgx_exports.cs
- VisualStyleElement.cs
- CodeCommentStatementCollection.cs
- Socket.cs
- CompilerInfo.cs
- FamilyMap.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- TracePayload.cs
- XmlCharacterData.cs
- XLinq.cs
- WriterOutput.cs
- MultiBindingExpression.cs
- ListBindingConverter.cs
- PersonalizationStateQuery.cs
- ListViewTableCell.cs
- ObjectView.cs
- Collection.cs
- AttributeQuery.cs
- Debug.cs
- FastEncoderWindow.cs
- TCPListener.cs
- RequestCacheValidator.cs
- EntityCollection.cs
- listitem.cs
- EventlogProvider.cs
- DbConnectionStringCommon.cs
- MultipleViewPattern.cs
- BindingNavigator.cs
- SymbolMethod.cs
- GridViewRowEventArgs.cs
- InvalidFilterCriteriaException.cs