Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DataGridState.cs
- InvokeProviderWrapper.cs
- UnsafeNativeMethods.cs
- MatrixCamera.cs
- SoapEnumAttribute.cs
- BackgroundWorker.cs
- DesignerContextDescriptor.cs
- ScriptComponentDescriptor.cs
- ExceptionList.cs
- BaseServiceProvider.cs
- LocalFileSettingsProvider.cs
- PackagingUtilities.cs
- XmlAttributeCollection.cs
- ClientUtils.cs
- IndentedTextWriter.cs
- __ConsoleStream.cs
- DataGridAddNewRow.cs
- EntityDataSourceWizardForm.cs
- FollowerQueueCreator.cs
- DBConcurrencyException.cs
- ClonableStack.cs
- BuilderInfo.cs
- ThicknessAnimation.cs
- Encoder.cs
- ListViewAutomationPeer.cs
- KnowledgeBase.cs
- MultipleViewPattern.cs
- GorillaCodec.cs
- SocketAddress.cs
- FontFamilyValueSerializer.cs
- DataControlField.cs
- CompoundFileDeflateTransform.cs
- RoutedEventHandlerInfo.cs
- AnimationException.cs
- UIElement.cs
- TextDecorationLocationValidation.cs
- HealthMonitoringSection.cs
- SettingsBindableAttribute.cs
- Camera.cs
- UpdatePanelControlTrigger.cs
- FocusWithinProperty.cs
- SupportingTokenAuthenticatorSpecification.cs
- TCPListener.cs
- ApplyTemplatesAction.cs
- RegistrySecurity.cs
- ActivityExecutionContextCollection.cs
- InheritedPropertyDescriptor.cs
- TreeViewImageKeyConverter.cs
- XmlSerializableServices.cs
- LogEntryHeaderv1Deserializer.cs
- TableAutomationPeer.cs
- InvalidWMPVersionException.cs
- XmlNodeReader.cs
- LayoutUtils.cs
- Binding.cs
- ToolStripItemCollection.cs
- ViewDesigner.cs
- TextElementEnumerator.cs
- EdmError.cs
- ActivityTrace.cs
- Int64AnimationUsingKeyFrames.cs
- ProxyGenerator.cs
- precedingquery.cs
- Int64KeyFrameCollection.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CodeSnippetTypeMember.cs
- TransactionFlowProperty.cs
- RadialGradientBrush.cs
- HtmlTableRowCollection.cs
- WCFServiceClientProxyGenerator.cs
- HandledEventArgs.cs
- RefreshInfo.cs
- SimpleTextLine.cs
- MenuItem.cs
- StorageSetMapping.cs
- TagPrefixCollection.cs
- LoadWorkflowByInstanceKeyCommand.cs
- AffineTransform3D.cs
- TextTreeNode.cs
- PageOutputColor.cs
- ListViewHitTestInfo.cs
- DataControlButton.cs
- ItemsPresenter.cs
- BulletChrome.cs
- UserMapPath.cs
- ErrorLog.cs
- DataContractSet.cs
- HandlerFactoryWrapper.cs
- EntityContainerRelationshipSetEnd.cs
- HitTestParameters3D.cs
- OracleConnection.cs
- RuleSetReference.cs
- CopyAttributesAction.cs
- XmlSchemaObjectTable.cs
- DesignerExtenders.cs
- LazyTextWriterCreator.cs
- ClientUtils.cs
- SqlColumnizer.cs
- ConfigurationSectionGroup.cs
- TemplateParser.cs