Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / ui / ResourceDefaultValueAttribute.cs / 1 / ResourceDefaultValueAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Reflection; using System.Web.Resources; [AttributeUsage(AttributeTargets.All)] internal sealed class ResourceDefaultValueAttribute : DefaultValueAttribute { private Type _type; private bool _resourceLoaded; internal ResourceDefaultValueAttribute(Type type, string value) : base(value) { _type = type; } internal ResourceDefaultValueAttribute(string value) : base(value) { } public override object TypeId { get { return typeof(DefaultValueAttribute); } } public override object Value { get { if (!_resourceLoaded) { _resourceLoaded = true; string baseValue = (string)base.Value; if (!String.IsNullOrEmpty(baseValue)) { object value = AtlasWeb.ResourceManager.GetString(baseValue, AtlasWeb.Culture); 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
- ServiceInstanceProvider.cs
- DependencyPropertyConverter.cs
- SequentialUshortCollection.cs
- BamlMapTable.cs
- ListViewUpdatedEventArgs.cs
- DataGridViewSortCompareEventArgs.cs
- TypeNameConverter.cs
- XmlBinaryReader.cs
- AssemblyCollection.cs
- HtmlTextArea.cs
- SafeArrayTypeMismatchException.cs
- RegexCompilationInfo.cs
- ContentPlaceHolder.cs
- StyleConverter.cs
- AutomationPropertyInfo.cs
- CompilationLock.cs
- ViewLoader.cs
- ListCollectionView.cs
- Journaling.cs
- ListSortDescription.cs
- TrustLevelCollection.cs
- PageBreakRecord.cs
- EventDescriptorCollection.cs
- SoapExtension.cs
- ImportCatalogPart.cs
- BaseComponentEditor.cs
- BinaryObjectReader.cs
- SurrogateEncoder.cs
- CompensatableTransactionScopeActivity.cs
- Panel.cs
- URL.cs
- Point3DConverter.cs
- xmlglyphRunInfo.cs
- TagPrefixInfo.cs
- RelatedImageListAttribute.cs
- Bidi.cs
- ResourceContainer.cs
- DispatcherTimer.cs
- CodeDomSerializationProvider.cs
- MediaTimeline.cs
- LicenseContext.cs
- Unit.cs
- WsdlHelpGeneratorElement.cs
- ArgumentOutOfRangeException.cs
- AutoGeneratedField.cs
- EntityContainerEntitySet.cs
- XsdBuildProvider.cs
- WpfKnownMember.cs
- BindingWorker.cs
- TextServicesPropertyRanges.cs
- MarshalDirectiveException.cs
- RegexInterpreter.cs
- CacheEntry.cs
- PackageRelationship.cs
- RbTree.cs
- LineServicesCallbacks.cs
- StringComparer.cs
- XPathDocument.cs
- PageVisual.cs
- PkcsUtils.cs
- ComplexPropertyEntry.cs
- SqlRetyper.cs
- Exception.cs
- DBSchemaRow.cs
- TypeUtil.cs
- SmiEventSink_DeferedProcessing.cs
- PropertyInfo.cs
- RewritingValidator.cs
- WindowVisualStateTracker.cs
- CommonDialog.cs
- safex509handles.cs
- ExternalDataExchangeService.cs
- IndexExpression.cs
- RepeatInfo.cs
- VerificationException.cs
- UTF32Encoding.cs
- GridViewCellAutomationPeer.cs
- XmlRawWriterWrapper.cs
- CompiledRegexRunner.cs
- CodeExpressionStatement.cs
- DataGridViewCellValueEventArgs.cs
- DatePickerTextBox.cs
- SessionState.cs
- UniformGrid.cs
- Zone.cs
- ConstantExpression.cs
- PointAnimationBase.cs
- DependsOnAttribute.cs
- LockRenewalTask.cs
- WeakReferenceEnumerator.cs
- Attributes.cs
- ConfigurationManagerHelperFactory.cs
- _Events.cs
- LineServicesCallbacks.cs
- StringHandle.cs
- SqlNodeAnnotation.cs
- Rect3D.cs
- HostVisual.cs
- SiteMapPath.cs
- ImageInfo.cs