Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / WebSysDefaultValueAttribute.cs / 1 / WebSysDefaultValueAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web { using System; using System.ComponentModel; [AttributeUsage(AttributeTargets.All)] internal sealed class WebSysDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _localized; internal WebSysDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal WebSysDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_localized) { _localized = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = SR.GetString(baseValue); if (_type != null) { try { value = TypeDescriptor.GetConverter(_type).ConvertFromInvariantString((string) value); } catch (NotSupportedException) { value = null; } } base.SetValue(value); } } return base.Value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web { using System; using System.ComponentModel; [AttributeUsage(AttributeTargets.All)] internal sealed class WebSysDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _localized; internal WebSysDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal WebSysDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_localized) { _localized = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = SR.GetString(baseValue); if (_type != null) { try { value = TypeDescriptor.GetConverter(_type).ConvertFromInvariantString((string) value); } catch (NotSupportedException) { value = null; } } base.SetValue(value); } } return base.Value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HyperlinkAutomationPeer.cs
- GenericWebPart.cs
- SerialPinChanges.cs
- DataObjectEventArgs.cs
- CharacterMetrics.cs
- HtmlElementErrorEventArgs.cs
- CryptoConfig.cs
- MobileControlsSectionHandler.cs
- PersonalizationState.cs
- QueryContext.cs
- Point3DAnimation.cs
- TextRangeEditTables.cs
- WindowPatternIdentifiers.cs
- RuntimeHelpers.cs
- TransformerTypeCollection.cs
- ResolveNameEventArgs.cs
- MILUtilities.cs
- WindowsContainer.cs
- HttpException.cs
- TextContainerChangeEventArgs.cs
- Switch.cs
- PhonemeConverter.cs
- ItemCheckedEvent.cs
- UIElement3DAutomationPeer.cs
- RemoteX509AsymmetricSecurityKey.cs
- WebPartConnectionsCancelVerb.cs
- PolicyException.cs
- Geometry3D.cs
- XmlBinaryWriter.cs
- BamlBinaryReader.cs
- AssemblyUtil.cs
- StickyNoteAnnotations.cs
- CurrencyWrapper.cs
- CodeCommentStatementCollection.cs
- BrushConverter.cs
- DATA_BLOB.cs
- TagMapInfo.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- GridViewItemAutomationPeer.cs
- DataGridViewSelectedCellCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- SelectedGridItemChangedEvent.cs
- XPathAncestorQuery.cs
- DataSourceProvider.cs
- IpcPort.cs
- SafeNativeMethods.cs
- ViewStateChangedEventArgs.cs
- XpsFixedPageReaderWriter.cs
- ProviderMetadata.cs
- ContractNamespaceAttribute.cs
- SafeCancelMibChangeNotify.cs
- PartBasedPackageProperties.cs
- IFlowDocumentViewer.cs
- HttpStreamFormatter.cs
- OlePropertyStructs.cs
- PerformanceCountersElement.cs
- SqlTransaction.cs
- SelectedCellsCollection.cs
- InterleavedZipPartStream.cs
- MeasureData.cs
- MasterPageCodeDomTreeGenerator.cs
- DragCompletedEventArgs.cs
- MetadataItemEmitter.cs
- TextOutput.cs
- GlobalizationAssembly.cs
- SectionInformation.cs
- FontCacheUtil.cs
- MissingManifestResourceException.cs
- ValidationPropertyAttribute.cs
- ElasticEase.cs
- HttpVersion.cs
- NameValuePair.cs
- Int16Animation.cs
- ByteKeyFrameCollection.cs
- Condition.cs
- ClientApiGenerator.cs
- NativeMethods.cs
- DataSourceExpression.cs
- Emitter.cs
- Walker.cs
- DesignBindingConverter.cs
- ObjectSecurity.cs
- DataServiceQuery.cs
- SoundPlayer.cs
- SoapSchemaExporter.cs
- ParserContext.cs
- TextChangedEventArgs.cs
- ScriptReference.cs
- KeyNotFoundException.cs
- UTF7Encoding.cs
- FlowLayout.cs
- WindowsTokenRoleProvider.cs
- CheckoutException.cs
- ReplyChannelAcceptor.cs
- RSAPKCS1SignatureDeformatter.cs
- XmlToDatasetMap.cs
- RijndaelManagedTransform.cs
- Model3DGroup.cs
- TargetControlTypeCache.cs
- NativeMethods.cs