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
- NumberSubstitution.cs
- TextPenaltyModule.cs
- MetadataPropertyAttribute.cs
- ForeignKeyConstraint.cs
- NoClickablePointException.cs
- SafeEventLogReadHandle.cs
- ScriptServiceAttribute.cs
- ItemType.cs
- SiteMapSection.cs
- MediaScriptCommandRoutedEventArgs.cs
- RadioButton.cs
- AttributeXamlType.cs
- SrgsRulesCollection.cs
- PrintingPermission.cs
- EntityDataSourceContainerNameConverter.cs
- SingleResultAttribute.cs
- Crypto.cs
- EncoderParameter.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- SQLGuid.cs
- ConstructorBuilder.cs
- CompModSwitches.cs
- WebBrowsableAttribute.cs
- Switch.cs
- Margins.cs
- ObjectComplexPropertyMapping.cs
- ProjectionPathSegment.cs
- StylusPointProperty.cs
- SiteMapPath.cs
- WorkflowOwnershipException.cs
- UntrustedRecipientException.cs
- AttachedPropertyBrowsableAttribute.cs
- StylusOverProperty.cs
- TerminateSequenceResponse.cs
- EntityDataSourceEntitySetNameItem.cs
- Vector3DCollectionConverter.cs
- DataGridViewDataErrorEventArgs.cs
- SiteMapNodeItem.cs
- ExpandSegment.cs
- ChtmlTextWriter.cs
- CharacterMetrics.cs
- DataSourceIDConverter.cs
- DataContractJsonSerializerOperationBehavior.cs
- GenericTypeParameterBuilder.cs
- DataGridViewRowHeaderCell.cs
- InsufficientMemoryException.cs
- SynchronizationFilter.cs
- _ProxyRegBlob.cs
- BitArray.cs
- RelationshipEntry.cs
- ObjectComplexPropertyMapping.cs
- RoutedEventConverter.cs
- ExpressionBuilderContext.cs
- OracleNumber.cs
- TdsValueSetter.cs
- DbProviderFactories.cs
- InputLanguageManager.cs
- OrCondition.cs
- InternalConfigRoot.cs
- BufferAllocator.cs
- MenuStrip.cs
- SaveFileDialogDesigner.cs
- ResolveNameEventArgs.cs
- Queue.cs
- ProcessStartInfo.cs
- RenderingEventArgs.cs
- EnumValAlphaComparer.cs
- FormsAuthenticationUser.cs
- FixedDocumentPaginator.cs
- DataTableReaderListener.cs
- RadioButtonAutomationPeer.cs
- Page.cs
- HtmlControlDesigner.cs
- MsmqTransportBindingElement.cs
- UnsafeMethods.cs
- DesignerActionItem.cs
- CodeValidator.cs
- SpecialFolderEnumConverter.cs
- XmlDataLoader.cs
- RegexWorker.cs
- DataColumn.cs
- ItemChangedEventArgs.cs
- SafeHandle.cs
- PropertyFilterAttribute.cs
- SqlCommand.cs
- TextLineResult.cs
- EUCJPEncoding.cs
- BuildProviderAppliesToAttribute.cs
- DataControlFieldHeaderCell.cs
- MultilineStringConverter.cs
- NetTcpSection.cs
- SubtreeProcessor.cs
- HttpGetProtocolImporter.cs
- ZoneLinkButton.cs
- ExtensibleClassFactory.cs
- DirectoryInfo.cs
- StylusPlugin.cs
- XmlElementAttribute.cs
- FileDialog_Vista.cs
- XmlArrayItemAttribute.cs