Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ImmutablePropertyDescriptorGridEntry.cs
- RNGCryptoServiceProvider.cs
- HttpCookie.cs
- DictionaryContent.cs
- DependencyObjectProvider.cs
- XmlSchema.cs
- TreeViewImageIndexConverter.cs
- HttpClientChannel.cs
- ExpressionBindingCollection.cs
- IfAction.cs
- PackUriHelper.cs
- ParagraphVisual.cs
- HttpApplication.cs
- XamlStream.cs
- WindowsTreeView.cs
- X509ThumbprintKeyIdentifierClause.cs
- PopOutPanel.cs
- BooleanAnimationUsingKeyFrames.cs
- _UriTypeConverter.cs
- AlphabeticalEnumConverter.cs
- XmlILAnnotation.cs
- LocalValueEnumerator.cs
- HttpResponse.cs
- Crc32.cs
- WebDescriptionAttribute.cs
- CompilerState.cs
- SortedDictionary.cs
- ImagingCache.cs
- DataError.cs
- EditorPartCollection.cs
- TemplatedMailWebEventProvider.cs
- SkipStoryboardToFill.cs
- DefaultAuthorizationContext.cs
- ForceCopyBuildProvider.cs
- StylusEditingBehavior.cs
- RowUpdatingEventArgs.cs
- Column.cs
- StateWorkerRequest.cs
- EntityCommandDefinition.cs
- HierarchicalDataSourceIDConverter.cs
- TokenBasedSet.cs
- MethodAccessException.cs
- WebPartDescription.cs
- IsolatedStorageFilePermission.cs
- CounterCreationDataCollection.cs
- ClientSettingsSection.cs
- CustomWebEventKey.cs
- BuilderElements.cs
- IsolatedStoragePermission.cs
- MaskedTextProvider.cs
- XmlWrappingReader.cs
- ExpressionBuilder.cs
- TextTreeUndo.cs
- ViewStateModeByIdAttribute.cs
- DesignBindingValueUIHandler.cs
- FaultHandlingFilter.cs
- DesignerLoader.cs
- TypeConverter.cs
- AdornerPresentationContext.cs
- ConnectionStringsExpressionBuilder.cs
- WSSecurityPolicy.cs
- TextEditorParagraphs.cs
- FlowLayoutPanel.cs
- CreateUserWizard.cs
- DecoderFallback.cs
- DataBoundControlAdapter.cs
- ValidationRuleCollection.cs
- ScriptControlManager.cs
- ExclusiveNamedPipeTransportManager.cs
- MainMenu.cs
- WebBrowserDesigner.cs
- KerberosTicketHashIdentifierClause.cs
- EventItfInfo.cs
- XmlConverter.cs
- XsdDateTime.cs
- QuaternionKeyFrameCollection.cs
- RangeValueProviderWrapper.cs
- TemplateControl.cs
- StrokeIntersection.cs
- InvalidComObjectException.cs
- Quaternion.cs
- WindowsListViewGroupHelper.cs
- XslException.cs
- XmlSerializerNamespaces.cs
- GenericTextProperties.cs
- ChineseLunisolarCalendar.cs
- StandardOleMarshalObject.cs
- XmlSerializableServices.cs
- PartialTrustValidationBehavior.cs
- Compiler.cs
- HealthMonitoringSectionHelper.cs
- BindingValueChangedEventArgs.cs
- NumberFunctions.cs
- OneToOneMappingSerializer.cs
- AppDomainUnloadedException.cs
- Emitter.cs
- ServiceBuildProvider.cs
- Style.cs
- DispatchWrapper.cs
- WindowsFormsSynchronizationContext.cs