Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ConfigXmlCDataSection.cs
- SecureUICommand.cs
- DataMemberFieldConverter.cs
- TableSectionStyle.cs
- UniqueEventHelper.cs
- DataView.cs
- precedingquery.cs
- CatalogPartChrome.cs
- HtmlSelectionListAdapter.cs
- DataObject.cs
- RTLAwareMessageBox.cs
- ControlTemplate.cs
- PrinterResolution.cs
- PartialCachingControl.cs
- WorkflowInlining.cs
- InsufficientMemoryException.cs
- LogicalExpressionEditor.cs
- SqlFunctions.cs
- AssemblyBuilderData.cs
- GlyphRunDrawing.cs
- recordstatefactory.cs
- MultiTrigger.cs
- TextEffectCollection.cs
- sqlpipe.cs
- AnnotationComponentManager.cs
- CoTaskMemHandle.cs
- ObjectStateFormatter.cs
- BackStopAuthenticationModule.cs
- FragmentQueryKB.cs
- AudioBase.cs
- DbMetaDataColumnNames.cs
- WeakHashtable.cs
- MergablePropertyAttribute.cs
- XamlRtfConverter.cs
- BufferModeSettings.cs
- Timer.cs
- SimpleParser.cs
- ListControl.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- RecognizedPhrase.cs
- ListViewEditEventArgs.cs
- RadioButton.cs
- WebBrowserBase.cs
- PageThemeParser.cs
- MailWriter.cs
- EmptyStringExpandableObjectConverter.cs
- ConvertersCollection.cs
- IWorkflowDebuggerService.cs
- X509Certificate2.cs
- DataGridCell.cs
- OutputWindow.cs
- QilStrConcat.cs
- SqlDataSourceCommandEventArgs.cs
- XdrBuilder.cs
- DataListItem.cs
- DoWhileDesigner.xaml.cs
- DataControlButton.cs
- Accessible.cs
- MaskedTextBoxDesignerActionList.cs
- HitTestParameters3D.cs
- _TLSstream.cs
- DataGridItemCollection.cs
- OlePropertyStructs.cs
- Model3DCollection.cs
- PlanCompilerUtil.cs
- JournalEntryListConverter.cs
- TrustLevelCollection.cs
- TCEAdapterGenerator.cs
- TargetConverter.cs
- SizeAnimation.cs
- ToolStripPanel.cs
- DescendentsWalker.cs
- CaseStatement.cs
- WeakReferenceList.cs
- OleDbRowUpdatedEvent.cs
- SecurityCriticalDataForSet.cs
- PolicyStatement.cs
- DataColumn.cs
- StdValidatorsAndConverters.cs
- EntityModelSchemaGenerator.cs
- XmlNullResolver.cs
- BinaryMethodMessage.cs
- XmlCDATASection.cs
- InProcStateClientManager.cs
- GeneralTransformGroup.cs
- EmissiveMaterial.cs
- ClrPerspective.cs
- DataGridViewButtonColumn.cs
- ParameterReplacerVisitor.cs
- StringComparer.cs
- CuspData.cs
- SelectionRange.cs
- PlaceHolder.cs
- ReferencedType.cs
- PointHitTestResult.cs
- MetricEntry.cs
- TranslateTransform3D.cs
- OleDbRowUpdatedEvent.cs
- TagPrefixCollection.cs
- MessageQueueAccessControlEntry.cs