Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / Int16Converter.cs / 1305376 / Int16Converter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; 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 Int16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit signed 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(Int16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToInt16(value, radix); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return Int16.Parse(value, culture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Int16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Int16)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.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 Int16Converter : BaseNumberConverter { ///Provides a type converter to convert 16-bit signed 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(Int16); } } ////// Convert the given value to a string using the given radix /// internal override object FromString(string value, int radix) { return Convert.ToInt16(value, radix); } ////// Convert the given value to a string using the given CultureInfo /// internal override object FromString(string value, CultureInfo culture){ return Int16.Parse(value, culture); } ////// Convert the given value to a string using the given formatInfo /// internal override object FromString(string value, NumberFormatInfo formatInfo) { return Int16.Parse(value, NumberStyles.Integer, formatInfo); } ////// Convert the given value from a string using the given formatInfo /// internal override string ToString(object value, NumberFormatInfo formatInfo) { return ((Int16)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
- DataGridViewLinkColumn.cs
- ToolboxItem.cs
- WindowsFormsSynchronizationContext.cs
- HierarchicalDataTemplate.cs
- ClosableStream.cs
- TextRangeAdaptor.cs
- PackageRelationshipSelector.cs
- DataSet.cs
- InfoCardRSACryptoProvider.cs
- ValidatedControlConverter.cs
- EntityViewGenerationConstants.cs
- XmlSchemaAnyAttribute.cs
- Context.cs
- PrtCap_Reader.cs
- _OverlappedAsyncResult.cs
- ContainerUtilities.cs
- ResXBuildProvider.cs
- TailCallAnalyzer.cs
- RsaSecurityKey.cs
- ToolboxDataAttribute.cs
- ExpressionConverter.cs
- WorkItem.cs
- XmlBinaryReader.cs
- DBCommandBuilder.cs
- ServiceControllerDesigner.cs
- BinaryUtilClasses.cs
- BamlTreeUpdater.cs
- EventMetadata.cs
- NameValueConfigurationElement.cs
- WebPartMenu.cs
- MenuScrollingVisibilityConverter.cs
- HttpEncoderUtility.cs
- SemaphoreSlim.cs
- SmiEventSink.cs
- WebPartMovingEventArgs.cs
- AcceleratedTokenProviderState.cs
- XmlAtomicValue.cs
- remotingproxy.cs
- PeerCollaboration.cs
- PictureBox.cs
- RepeatInfo.cs
- TableHeaderCell.cs
- TextEditorCopyPaste.cs
- ISCIIEncoding.cs
- RankException.cs
- XAMLParseException.cs
- ErrorRuntimeConfig.cs
- SafeThreadHandle.cs
- SqlDependencyUtils.cs
- HatchBrush.cs
- DataObjectSettingDataEventArgs.cs
- MultiSelectRootGridEntry.cs
- WorkflowControlClient.cs
- SHA384Cng.cs
- SHA256Managed.cs
- EventsTab.cs
- BezierSegment.cs
- PrintPreviewGraphics.cs
- DesignerHierarchicalDataSourceView.cs
- SBCSCodePageEncoding.cs
- RoamingStoreFileUtility.cs
- WindowsRichEditRange.cs
- HttpCachePolicyBase.cs
- StrongNameMembershipCondition.cs
- PositiveTimeSpanValidator.cs
- TextParagraphView.cs
- OleServicesContext.cs
- CodeDOMUtility.cs
- RoleGroupCollection.cs
- DbParameterHelper.cs
- NativeMethods.cs
- ISCIIEncoding.cs
- NavigationEventArgs.cs
- Debug.cs
- TreeSet.cs
- TreeNodeStyle.cs
- TraceFilter.cs
- TextCompositionEventArgs.cs
- LineServicesCallbacks.cs
- EnumValidator.cs
- ProgressBar.cs
- _DigestClient.cs
- PeerNameResolver.cs
- SplayTreeNode.cs
- FragmentQueryKB.cs
- DocumentPageTextView.cs
- TreeViewImageKeyConverter.cs
- WhitespaceRuleLookup.cs
- IPeerNeighbor.cs
- DatePicker.cs
- XamlDesignerSerializationManager.cs
- OperationPickerDialog.cs
- InvokePatternIdentifiers.cs
- DbConnectionPoolGroupProviderInfo.cs
- RegexMatch.cs
- HeaderedContentControl.cs
- XpsSerializerWriter.cs
- GridViewColumnHeader.cs
- BamlMapTable.cs
- TimeZone.cs