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
- FileSecurity.cs
- SystemWebSectionGroup.cs
- UnionCodeGroup.cs
- InvariantComparer.cs
- Win32Exception.cs
- VirtualPathProvider.cs
- X509Chain.cs
- CanonicalFormWriter.cs
- PropertyToken.cs
- ServicePoint.cs
- TempFiles.cs
- FormViewUpdatedEventArgs.cs
- SharedPerformanceCounter.cs
- ElapsedEventArgs.cs
- MinMaxParagraphWidth.cs
- ResizingMessageFilter.cs
- HtmlLink.cs
- OptimalBreakSession.cs
- TTSEngineProxy.cs
- ScalarRestriction.cs
- DataGridHelper.cs
- ConfigurationSectionGroup.cs
- securestring.cs
- SspiHelper.cs
- SchemaImporter.cs
- KernelTypeValidation.cs
- OdbcRowUpdatingEvent.cs
- UnmanagedMemoryStreamWrapper.cs
- TableHeaderCell.cs
- ResourceType.cs
- WebPartZone.cs
- ExpressionParser.cs
- XsdBuildProvider.cs
- ManifestResourceInfo.cs
- RealProxy.cs
- CachedTypeface.cs
- DataGridViewRowCollection.cs
- ContentWrapperAttribute.cs
- BooleanFunctions.cs
- ContextProperty.cs
- InheritanceAttribute.cs
- DesignerVerbCollection.cs
- GrammarBuilderPhrase.cs
- ContextMarshalException.cs
- X509CertificateCollection.cs
- VoiceChangeEventArgs.cs
- StylusPointPropertyInfo.cs
- State.cs
- DataGridViewRowCancelEventArgs.cs
- SearchExpression.cs
- PageThemeParser.cs
- BypassElement.cs
- DataGridHeaderBorder.cs
- DeclaredTypeValidator.cs
- SocketSettings.cs
- TagPrefixCollection.cs
- WindowsRebar.cs
- Lease.cs
- RSAOAEPKeyExchangeFormatter.cs
- HttpHandlerAction.cs
- ExpressionConverter.cs
- WebPartZoneCollection.cs
- CodeVariableDeclarationStatement.cs
- Int16KeyFrameCollection.cs
- XmlDataSource.cs
- ActiveXSite.cs
- RawKeyboardInputReport.cs
- UserControlBuildProvider.cs
- SqlCachedBuffer.cs
- UInt16.cs
- HelpEvent.cs
- ZipIOLocalFileBlock.cs
- TableAdapterManagerNameHandler.cs
- SpotLight.cs
- BufferedGraphicsContext.cs
- XmlDesigner.cs
- SafeNativeMethodsOther.cs
- HttpPostedFile.cs
- DynamicValidatorEventArgs.cs
- CalendarDesigner.cs
- XmlSiteMapProvider.cs
- PrivateFontCollection.cs
- RoutedEventArgs.cs
- PeerTransportBindingElement.cs
- Currency.cs
- InvariantComparer.cs
- QueueTransferProtocol.cs
- XmlUtf8RawTextWriter.cs
- InfoCardHelper.cs
- sqlpipe.cs
- SegmentInfo.cs
- ConstNode.cs
- datacache.cs
- ISAPIWorkerRequest.cs
- SqlProviderManifest.cs
- ProcessModelSection.cs
- CultureInfoConverter.cs
- EdmComplexPropertyAttribute.cs
- EntityType.cs
- BufferedGraphicsManager.cs