Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / ResourceDefaultValueAttribute.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AncestorChangedEventArgs.cs
- SiteMapProvider.cs
- bidPrivateBase.cs
- DataControlFieldsEditor.cs
- ObjectListItem.cs
- DbProviderManifest.cs
- AutomationProperties.cs
- PackageDigitalSignature.cs
- RsaSecurityTokenAuthenticator.cs
- ConfigurationProperty.cs
- ContainerUIElement3D.cs
- InlinedAggregationOperatorEnumerator.cs
- TextBoxAutoCompleteSourceConverter.cs
- SpellerInterop.cs
- ConditionCollection.cs
- Stream.cs
- SecurityKeyIdentifier.cs
- WindowsSlider.cs
- StringPropertyBuilder.cs
- Keywords.cs
- ContentType.cs
- DataGridViewRowsAddedEventArgs.cs
- SmiXetterAccessMap.cs
- Ray3DHitTestResult.cs
- PackageDigitalSignatureManager.cs
- Control.cs
- __ComObject.cs
- CodeNamespaceImportCollection.cs
- XmlSerializableServices.cs
- Stroke.cs
- SizeF.cs
- Int32Rect.cs
- SqlConnectionStringBuilder.cs
- GridViewRowCollection.cs
- ProfileSettingsCollection.cs
- DescriptionAttribute.cs
- RPIdentityRequirement.cs
- BamlStream.cs
- VirtualPathUtility.cs
- OracleBoolean.cs
- XmlKeywords.cs
- SettingsPropertyValueCollection.cs
- _AcceptOverlappedAsyncResult.cs
- ContainerFilterService.cs
- ResourceReader.cs
- ExpressionParser.cs
- StandardCommandToolStripMenuItem.cs
- LookupBindingPropertiesAttribute.cs
- HtmlContainerControl.cs
- DSGeneratorProblem.cs
- DeclarativeCatalogPart.cs
- PrefixQName.cs
- CultureSpecificCharacterBufferRange.cs
- ExternalCalls.cs
- Stroke.cs
- CompositeFontParser.cs
- GridLengthConverter.cs
- RowUpdatedEventArgs.cs
- ProfilePropertyMetadata.cs
- StopStoryboard.cs
- ExpressionBuilderContext.cs
- MethodCallTranslator.cs
- ControlBindingsConverter.cs
- DLinqDataModelProvider.cs
- TrustSection.cs
- ObjRef.cs
- SelectorAutomationPeer.cs
- InputReferenceExpression.cs
- LookupBindingPropertiesAttribute.cs
- ServiceNameElement.cs
- WebPartConnectionsCancelVerb.cs
- CacheEntry.cs
- EnumerableCollectionView.cs
- PluralizationServiceUtil.cs
- BmpBitmapDecoder.cs
- HtmlControlDesigner.cs
- UrlRoutingHandler.cs
- XmlSchemaExporter.cs
- OutOfProcStateClientManager.cs
- Cell.cs
- DataContractSet.cs
- DayRenderEvent.cs
- BuildProvider.cs
- ReferentialConstraint.cs
- ByteAnimationBase.cs
- EntityDataSourceWrapperCollection.cs
- ResourceManagerWrapper.cs
- ChildrenQuery.cs
- XmlChoiceIdentifierAttribute.cs
- FontDialog.cs
- XmlSignatureProperties.cs
- ToolStripPanelCell.cs
- DelayedRegex.cs
- CallbackHandler.cs
- HMACSHA256.cs
- XmlSchemaInfo.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- Stroke.cs
- DayRenderEvent.cs
- WebPartDescription.cs