Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GreenMethods.cs
- DecoderExceptionFallback.cs
- ConnectionStringsExpressionBuilder.cs
- XsltConvert.cs
- App.cs
- CompositionAdorner.cs
- Screen.cs
- ThemeDirectoryCompiler.cs
- InertiaRotationBehavior.cs
- TemplatingOptionsDialog.cs
- HttpListener.cs
- DrawingGroup.cs
- _FtpControlStream.cs
- TypeSystem.cs
- ProjectionAnalyzer.cs
- EmptyElement.cs
- SafeRegistryKey.cs
- DispatcherEventArgs.cs
- GridView.cs
- DataIdProcessor.cs
- DBDataPermission.cs
- WpfXamlMember.cs
- CacheAxisQuery.cs
- CopyNamespacesAction.cs
- XamlStyleSerializer.cs
- SafeProcessHandle.cs
- SafeCryptoHandles.cs
- ChangeProcessor.cs
- SqlWriter.cs
- SiteOfOriginPart.cs
- XmlWriterSettings.cs
- DataRowCollection.cs
- TypedDataSourceCodeGenerator.cs
- DataGrid.cs
- PageCatalogPart.cs
- CodeTypeDeclarationCollection.cs
- Merger.cs
- VersionedStream.cs
- NamedObject.cs
- SQLInt64Storage.cs
- SQLBoolean.cs
- CodeChecksumPragma.cs
- NullableIntSumAggregationOperator.cs
- TraceListener.cs
- XamlSerializationHelper.cs
- PerformanceCounterPermissionAttribute.cs
- SiteMapNodeItem.cs
- Evidence.cs
- Activity.cs
- ButtonAutomationPeer.cs
- VisualStateChangedEventArgs.cs
- ContainerSelectorBehavior.cs
- NameSpaceExtractor.cs
- MemberProjectionIndex.cs
- Soap12ProtocolImporter.cs
- DataStorage.cs
- Latin1Encoding.cs
- RoutedEventArgs.cs
- Rect3D.cs
- NativeMethods.cs
- XPathException.cs
- WindowsGraphics.cs
- ConfigXmlComment.cs
- VirtualPathUtility.cs
- Propagator.JoinPropagator.cs
- LocalizedNameDescriptionPair.cs
- VirtualPathUtility.cs
- WebPartConnectionsCloseVerb.cs
- SortQuery.cs
- Point.cs
- ToolStripRenderEventArgs.cs
- CSharpCodeProvider.cs
- Pens.cs
- FacetChecker.cs
- RectConverter.cs
- PlatformCulture.cs
- CompiledRegexRunner.cs
- HtmlGenericControl.cs
- TagPrefixAttribute.cs
- CodeRegionDirective.cs
- DbgUtil.cs
- ItemsControlAutomationPeer.cs
- SafeSecurityHelper.cs
- processwaithandle.cs
- ProfileBuildProvider.cs
- MembershipValidatePasswordEventArgs.cs
- WindowsIPAddress.cs
- Validator.cs
- LocatorGroup.cs
- SchemaNotation.cs
- Unit.cs
- Attributes.cs
- DesignerValidatorAdapter.cs
- ProgressChangedEventArgs.cs
- EntityDataSourceQueryBuilder.cs
- DispatcherObject.cs
- Propagator.cs
- LicenseProviderAttribute.cs
- OleDbCommand.cs
- ScriptComponentDescriptor.cs