Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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. // //----------------------------------------------------------------------------- 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
- Timer.cs
- ForAllOperator.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- ExeConfigurationFileMap.cs
- SerialErrors.cs
- PKCS1MaskGenerationMethod.cs
- Size3D.cs
- DataBoundControl.cs
- OracleDateTime.cs
- EditingMode.cs
- ToolboxItemCollection.cs
- TdsParserStaticMethods.cs
- SystemNetHelpers.cs
- FileDataSourceCache.cs
- DelegateSerializationHolder.cs
- DesignerProperties.cs
- _ConnectOverlappedAsyncResult.cs
- LiteralText.cs
- WebUtil.cs
- FilterElement.cs
- PackWebRequest.cs
- RuntimeIdentifierPropertyAttribute.cs
- EntityDataSourceDataSelection.cs
- SizeFConverter.cs
- UntrustedRecipientException.cs
- HtmlCommandAdapter.cs
- Directory.cs
- SecureEnvironment.cs
- clipboard.cs
- CallbackValidator.cs
- RotateTransform3D.cs
- Parser.cs
- httpapplicationstate.cs
- ComplexLine.cs
- UnmanagedMarshal.cs
- WasAdminWrapper.cs
- RadioButtonBaseAdapter.cs
- RichTextBoxConstants.cs
- Preprocessor.cs
- ConditionedDesigner.cs
- PropertiesTab.cs
- ObjectTokenCategory.cs
- SqlExpander.cs
- AutoScrollExpandMessageFilter.cs
- _LocalDataStore.cs
- NoClickablePointException.cs
- LogManagementAsyncResult.cs
- SchemaElementDecl.cs
- LocatorPartList.cs
- Activity.cs
- securitycriticaldata.cs
- PublisherMembershipCondition.cs
- CmsUtils.cs
- ToolStripLocationCancelEventArgs.cs
- NotFiniteNumberException.cs
- RawStylusInputCustomDataList.cs
- FrameworkTemplate.cs
- CheckedPointers.cs
- EditorReuseAttribute.cs
- RelatedEnd.cs
- TextureBrush.cs
- SlipBehavior.cs
- ScrollViewer.cs
- TimeSpanConverter.cs
- DataServiceProviderMethods.cs
- PrintPreviewControl.cs
- TypeResolver.cs
- VarRefManager.cs
- PolicyManager.cs
- ObjectReferenceStack.cs
- TokenBasedSetEnumerator.cs
- ColumnBinding.cs
- PerformanceCounterPermissionEntry.cs
- BigInt.cs
- DataGridViewRowPostPaintEventArgs.cs
- RadioButtonFlatAdapter.cs
- WebProxyScriptElement.cs
- GridViewPageEventArgs.cs
- Simplifier.cs
- ApplicationSecurityManager.cs
- RuleProcessor.cs
- PropertyMapper.cs
- EnumerableRowCollectionExtensions.cs
- EmbeddedMailObject.cs
- HttpContext.cs
- StdValidatorsAndConverters.cs
- ellipse.cs
- XmlTextWriter.cs
- WhitespaceRuleLookup.cs
- RsaSecurityTokenAuthenticator.cs
- ListMarkerLine.cs
- ClassHandlersStore.cs
- RewritingProcessor.cs
- ToolStripRendererSwitcher.cs
- ZipPackage.cs
- StylusSystemGestureEventArgs.cs
- DefinitionUpdate.cs
- CommonObjectSecurity.cs
- GraphicsState.cs
- Path.cs