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
- DocumentOrderQuery.cs
- WindowsTokenRoleProvider.cs
- DataRelationPropertyDescriptor.cs
- sortedlist.cs
- SafeProcessHandle.cs
- webclient.cs
- GlobalAllocSafeHandle.cs
- TimeoutStream.cs
- DataMemberConverter.cs
- PropertyStore.cs
- XmlSchemaRedefine.cs
- ObjectHelper.cs
- ProfilePropertyMetadata.cs
- TemplateXamlParser.cs
- NativeMethodsOther.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- DbTransaction.cs
- HttpContext.cs
- AdornerDecorator.cs
- InvalidDocumentContentsException.cs
- SignatureGenerator.cs
- IdnMapping.cs
- PropertyPathConverter.cs
- DiffuseMaterial.cs
- ComplexTypeEmitter.cs
- EntityDesignerDataSourceView.cs
- ServerType.cs
- TraceRecord.cs
- DetailsViewInsertedEventArgs.cs
- DataGridViewHitTestInfo.cs
- Configuration.cs
- MbpInfo.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- HeaderUtility.cs
- FieldNameLookup.cs
- FixedSOMElement.cs
- DataListItemCollection.cs
- SimplePropertyEntry.cs
- ObjectManager.cs
- HandlerFactoryCache.cs
- TCEAdapterGenerator.cs
- ChangeNode.cs
- LineVisual.cs
- SrgsRuleRef.cs
- DetailsViewDeleteEventArgs.cs
- ClientConvert.cs
- DbCommandTree.cs
- HtmlForm.cs
- LabelEditEvent.cs
- BoundField.cs
- IApplicationTrustManager.cs
- IOException.cs
- SqlTriggerContext.cs
- RectAnimationUsingKeyFrames.cs
- FileDialog.cs
- TabControlToolboxItem.cs
- ToolStripScrollButton.cs
- EmbeddedMailObject.cs
- HtmlHead.cs
- ObjectListFieldsPage.cs
- GeometryHitTestParameters.cs
- HandleExceptionArgs.cs
- MachineKeyConverter.cs
- HttpRequestWrapper.cs
- ExecutorLocksHeldException.cs
- ColorPalette.cs
- WebPartDisplayModeEventArgs.cs
- ColumnReorderedEventArgs.cs
- TdsParserSafeHandles.cs
- PrimitiveType.cs
- DataContractSerializerSection.cs
- HeaderCollection.cs
- WebPartDescriptionCollection.cs
- FocusManager.cs
- RelationshipEnd.cs
- StylusOverProperty.cs
- DispatchOperation.cs
- RTTrackingProfile.cs
- LineBreakRecord.cs
- UrlMappingsModule.cs
- CloseCollectionAsyncResult.cs
- SpeechSeg.cs
- MemoryStream.cs
- SecurityUtils.cs
- COSERVERINFO.cs
- UserControlParser.cs
- Itemizer.cs
- ContextProperty.cs
- HwndMouseInputProvider.cs
- TextModifier.cs
- EventMappingSettingsCollection.cs
- UpdateCommand.cs
- CacheMode.cs
- DesignerLoader.cs
- DataGridViewIntLinkedList.cs
- DynamicField.cs
- DesignerView.cs
- XPathAncestorIterator.cs
- CultureInfoConverter.cs
- HwndSource.cs