Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- DocumentOrderComparer.cs
- TextEditorMouse.cs
- XmlElement.cs
- GenericEnumerator.cs
- Part.cs
- AttributeCollection.cs
- ExtentCqlBlock.cs
- StringBuilder.cs
- OdbcRowUpdatingEvent.cs
- EntityViewContainer.cs
- LinkLabel.cs
- AnnotationDocumentPaginator.cs
- _OverlappedAsyncResult.cs
- RealProxy.cs
- ConstraintConverter.cs
- SimpleHandlerFactory.cs
- ValidationEventArgs.cs
- Block.cs
- PngBitmapEncoder.cs
- ImageClickEventArgs.cs
- SafeFileHandle.cs
- DialogDivider.cs
- AffineTransform3D.cs
- UnsafeNativeMethods.cs
- SliderAutomationPeer.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- DateTimeUtil.cs
- XmlQuerySequence.cs
- PropertyOrder.cs
- PolicyException.cs
- mactripleDES.cs
- LifetimeServices.cs
- SchemaDeclBase.cs
- DataServiceQuery.cs
- TcpDuplicateContext.cs
- UIElement3D.cs
- CodeNamespace.cs
- HtmlInputFile.cs
- TextBoxRenderer.cs
- TreeNodeStyle.cs
- TriState.cs
- ThrowHelper.cs
- EmptyStringExpandableObjectConverter.cs
- WebEvents.cs
- RectAnimationClockResource.cs
- sitestring.cs
- RoutedEvent.cs
- CapabilitiesPattern.cs
- ButtonStandardAdapter.cs
- TableItemProviderWrapper.cs
- TopClause.cs
- WindowShowOrOpenTracker.cs
- _ContextAwareResult.cs
- WorkflowInstanceExtensionCollection.cs
- XmlStringTable.cs
- OutputCacheModule.cs
- AmbiguousMatchException.cs
- SystemFonts.cs
- MetadataItemEmitter.cs
- WebPartCloseVerb.cs
- AdornerDecorator.cs
- ListViewSelectEventArgs.cs
- SpecularMaterial.cs
- OracleConnectionFactory.cs
- base64Transforms.cs
- XmlSchemaGroupRef.cs
- AttributeUsageAttribute.cs
- SqlProfileProvider.cs
- TreeChangeInfo.cs
- DataControlFieldsEditor.cs
- ExchangeUtilities.cs
- DayRenderEvent.cs
- QueryConverter.cs
- MarkedHighlightComponent.cs
- DeclarativeCatalogPart.cs
- LineSegment.cs
- Stylesheet.cs
- RawStylusInputCustomData.cs
- SafeMemoryMappedViewHandle.cs
- DragEventArgs.cs
- ComponentRenameEvent.cs
- SchemaCompiler.cs
- PeerDuplexChannelListener.cs
- RemotingServices.cs
- MatrixCamera.cs
- TraceShell.cs
- RoleManagerModule.cs
- HtmlTextViewAdapter.cs
- Cloud.cs
- WpfKnownMember.cs
- XmlAttribute.cs
- CollaborationHelperFunctions.cs
- COAUTHINFO.cs
- AsyncPostBackTrigger.cs
- DataGridViewTextBoxColumn.cs
- StringSource.cs
- ErrorItem.cs
- XmlAutoDetectWriter.cs
- UpdatePanelControlTrigger.cs
- Query.cs