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
- RelationshipNavigation.cs
- TagPrefixInfo.cs
- AccessDataSourceWizardForm.cs
- DriveNotFoundException.cs
- _NetworkingPerfCounters.cs
- CompilerGlobalScopeAttribute.cs
- InstanceLockQueryResult.cs
- Int64Converter.cs
- XmlEventCache.cs
- MenuItemStyleCollection.cs
- EventLogger.cs
- NumberEdit.cs
- TextEditorSelection.cs
- ActiveXHelper.cs
- MarkedHighlightComponent.cs
- RootBrowserWindow.cs
- Substitution.cs
- QuadraticBezierSegment.cs
- Empty.cs
- DataBoundLiteralControl.cs
- NetCodeGroup.cs
- VoiceSynthesis.cs
- WindowsGrip.cs
- UniformGrid.cs
- BindingManagerDataErrorEventArgs.cs
- DataFieldConverter.cs
- XmlElementCollection.cs
- Themes.cs
- OdbcConnectionString.cs
- ResourceContainerWrapper.cs
- TypeBuilderInstantiation.cs
- NotCondition.cs
- SimpleLine.cs
- CaseInsensitiveComparer.cs
- MessagePartProtectionMode.cs
- ToolStripItemRenderEventArgs.cs
- OletxTransactionManager.cs
- OneOfConst.cs
- Input.cs
- HebrewNumber.cs
- DiscreteKeyFrames.cs
- Point3DAnimationBase.cs
- XmlResolver.cs
- MouseGesture.cs
- Section.cs
- StoreAnnotationsMap.cs
- PiiTraceSource.cs
- NullableDoubleSumAggregationOperator.cs
- DefaultObjectMappingItemCollection.cs
- COM2ExtendedUITypeEditor.cs
- KnownTypesHelper.cs
- DigestTraceRecordHelper.cs
- IdentityNotMappedException.cs
- LicFileLicenseProvider.cs
- SettingsPropertyIsReadOnlyException.cs
- ValueProviderWrapper.cs
- PreviewPageInfo.cs
- BoundColumn.cs
- ClientUtils.cs
- CodeComment.cs
- ApplicationServiceManager.cs
- XhtmlConformanceSection.cs
- FixedSOMContainer.cs
- UTF32Encoding.cs
- RegexParser.cs
- UriParserTemplates.cs
- StateMachineSubscription.cs
- NullableLongMinMaxAggregationOperator.cs
- GridViewPageEventArgs.cs
- ValidationManager.cs
- EdmProperty.cs
- Util.cs
- EventLogPermission.cs
- Permission.cs
- XPathDocumentBuilder.cs
- OleDbDataAdapter.cs
- FlowDocumentReaderAutomationPeer.cs
- TransactionManager.cs
- xml.cs
- Translator.cs
- DataGridComboBoxColumn.cs
- MSAAEventDispatcher.cs
- BooleanKeyFrameCollection.cs
- SqlVersion.cs
- GuidelineSet.cs
- CultureInfo.cs
- PersistChildrenAttribute.cs
- QuotedStringFormatReader.cs
- PipelineComponent.cs
- WpfKnownType.cs
- ObjectRef.cs
- ScrollableControl.cs
- ComboBox.cs
- ClientEventManager.cs
- ObjectDataSourceWizardForm.cs
- Header.cs
- HttpAsyncResult.cs
- SqlDataSourceView.cs
- StandardToolWindows.cs
- HandledEventArgs.cs