Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- ListDataBindEventArgs.cs
- TextEffect.cs
- basecomparevalidator.cs
- XmlWrappingReader.cs
- InheritanceContextChangedEventManager.cs
- RC2.cs
- SqlDataSourceFilteringEventArgs.cs
- UIPropertyMetadata.cs
- BStrWrapper.cs
- EncryptedKeyIdentifierClause.cs
- WebPartConnectionsDisconnectVerb.cs
- ContentType.cs
- StorageFunctionMapping.cs
- BasicCommandTreeVisitor.cs
- PathSegmentCollection.cs
- PropertyEntry.cs
- DynamicQueryableWrapper.cs
- ProxyWebPartConnectionCollection.cs
- PointHitTestParameters.cs
- BamlResourceDeserializer.cs
- ApplicationSecurityInfo.cs
- CookielessHelper.cs
- Camera.cs
- cryptoapiTransform.cs
- OutputWindow.cs
- StreamResourceInfo.cs
- Rule.cs
- WebConfigurationHost.cs
- SerializerDescriptor.cs
- RenderData.cs
- Misc.cs
- StreamGeometry.cs
- Module.cs
- UnsafeNativeMethods.cs
- SimpleTextLine.cs
- XsltArgumentList.cs
- Byte.cs
- MD5.cs
- CFStream.cs
- SqlCrossApplyToCrossJoin.cs
- regiisutil.cs
- StringStorage.cs
- SoapCodeExporter.cs
- RemoteWebConfigurationHost.cs
- X509Extension.cs
- XmlSchemaCompilationSettings.cs
- BaseCodeDomTreeGenerator.cs
- WebPartDeleteVerb.cs
- TokenizerHelper.cs
- SerialPort.cs
- HuffmanTree.cs
- HelpProvider.cs
- QuadraticBezierSegment.cs
- Site.cs
- LicFileLicenseProvider.cs
- ConfigXmlText.cs
- EntityDataSourceWizardForm.cs
- RegexGroupCollection.cs
- SerializationTrace.cs
- SqlTrackingQuery.cs
- PrintingPermission.cs
- ValidatorCollection.cs
- ValuePattern.cs
- ProtocolElementCollection.cs
- ImageAutomationPeer.cs
- ErrorHandler.cs
- GetWinFXPath.cs
- ConvertTextFrag.cs
- VisualStyleTypesAndProperties.cs
- Stackframe.cs
- ModuleConfigurationInfo.cs
- WmpBitmapEncoder.cs
- _KerberosClient.cs
- DesignerLoader.cs
- KerberosSecurityTokenProvider.cs
- Constants.cs
- SectionInformation.cs
- ExitEventArgs.cs
- DataListItemCollection.cs
- FontStyleConverter.cs
- RowParagraph.cs
- DbParameterHelper.cs
- UpdateExpressionVisitor.cs
- NavigationWindow.cs
- MdImport.cs
- QilTargetType.cs
- PageTheme.cs
- DoubleLinkList.cs
- OrderedDictionary.cs
- BitmapEffectGeneralTransform.cs
- SettingsPropertyIsReadOnlyException.cs
- ImageListUtils.cs
- WebPartConnectionsCloseVerb.cs
- SetterBaseCollection.cs
- LoginCancelEventArgs.cs
- RoleGroupCollection.cs
- BitmapData.cs
- PageSettings.cs
- CustomLineCap.cs
- UICuesEvent.cs