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
- StorageMappingItemLoader.cs
- Accessible.cs
- FileDialogCustomPlacesCollection.cs
- TimersDescriptionAttribute.cs
- BuildManager.cs
- DesignTimeParseData.cs
- DeviceContexts.cs
- ForeignConstraint.cs
- ProviderCommandInfoUtils.cs
- SerializationSectionGroup.cs
- ImagingCache.cs
- ReadOnlyDictionary.cs
- DependencyPropertyChangedEventArgs.cs
- safemediahandle.cs
- AddInDeploymentState.cs
- BookmarkEventArgs.cs
- Query.cs
- TextOutput.cs
- RelativeSource.cs
- EntityTypeBase.cs
- TemplateGroupCollection.cs
- OptimisticConcurrencyException.cs
- Setter.cs
- PropertyValueUIItem.cs
- EDesignUtil.cs
- ProxyWebPart.cs
- ExistsInCollection.cs
- ProviderMetadataCachedInformation.cs
- DPTypeDescriptorContext.cs
- SQLInt32Storage.cs
- RijndaelManagedTransform.cs
- RTTypeWrapper.cs
- FormCollection.cs
- XMLSyntaxException.cs
- TreeViewAutomationPeer.cs
- ResourceReader.cs
- RegexNode.cs
- RequestCacheEntry.cs
- PolyLineSegment.cs
- ServicePointManager.cs
- AssemblyInfo.cs
- QueueSurrogate.cs
- DSGeneratorProblem.cs
- CanonicalXml.cs
- HtmlShim.cs
- GlyphRun.cs
- SignatureHelper.cs
- ContactManager.cs
- BeginStoryboard.cs
- DataTableReaderListener.cs
- EntitySqlQueryCacheKey.cs
- SafeMILHandle.cs
- SqlBuilder.cs
- XhtmlBasicPageAdapter.cs
- CodeObjectCreateExpression.cs
- SymbolEqualComparer.cs
- DoubleAnimationClockResource.cs
- BitmapFrameEncode.cs
- ExtensionsSection.cs
- OrderablePartitioner.cs
- DataGridViewRowEventArgs.cs
- Literal.cs
- SymLanguageVendor.cs
- X509Extension.cs
- Transform3DGroup.cs
- DataGridViewSelectedCellCollection.cs
- StylusPointCollection.cs
- ProviderSettings.cs
- filewebresponse.cs
- NativeWindow.cs
- ProfileSection.cs
- SerializationObjectManager.cs
- NetworkInterface.cs
- CompilerScope.Storage.cs
- DBConnection.cs
- InkCanvasSelectionAdorner.cs
- MouseActionConverter.cs
- TreeBuilderBamlTranslator.cs
- TypeSource.cs
- BindingExpression.cs
- SynchronizedDispatch.cs
- SQLUtility.cs
- CodeDelegateCreateExpression.cs
- PasswordRecoveryAutoFormat.cs
- SectionXmlInfo.cs
- DataBoundControlDesigner.cs
- cookie.cs
- DataBinder.cs
- ValidationSummary.cs
- HttpRuntimeSection.cs
- IntellisenseTextBox.cs
- ImageFormat.cs
- ThreadAttributes.cs
- Rfc2898DeriveBytes.cs
- HttpDebugHandler.cs
- GetPageCompletedEventArgs.cs
- SeparatorAutomationPeer.cs
- HttpCapabilitiesBase.cs
- HyperLinkStyle.cs
- CreateUserWizard.cs