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
- MessageBox.cs
- DictionaryBase.cs
- BrowserDefinitionCollection.cs
- Propagator.cs
- AuthenticationModuleElementCollection.cs
- DataFormats.cs
- FontUnitConverter.cs
- DiscoveryClientOutputChannel.cs
- Stacktrace.cs
- PermissionSetEnumerator.cs
- ContractNamespaceAttribute.cs
- XmlAnyAttributeAttribute.cs
- SmtpAuthenticationManager.cs
- HierarchicalDataBoundControlAdapter.cs
- Roles.cs
- TextServicesContext.cs
- XmlWellformedWriterHelpers.cs
- XmlSchema.cs
- PerformanceCounterScope.cs
- designeractionlistschangedeventargs.cs
- Int32Collection.cs
- Pkcs7Signer.cs
- WebPartZoneBase.cs
- XmlIlGenerator.cs
- DNS.cs
- EntitySetDataBindingList.cs
- TableItemPattern.cs
- InvalidDataException.cs
- Point3D.cs
- SecurityMessageProperty.cs
- EventEntry.cs
- GridViewCancelEditEventArgs.cs
- PolicyValidator.cs
- FollowerQueueCreator.cs
- COM2Enum.cs
- SqlServer2KCompatibilityCheck.cs
- MetadataPropertyAttribute.cs
- DataGridViewElement.cs
- DialogResultConverter.cs
- CompressionTransform.cs
- CorruptingExceptionCommon.cs
- ObjectDataSourceFilteringEventArgs.cs
- Socket.cs
- RadioButton.cs
- XmlUtil.cs
- TrustLevel.cs
- XmlSchemaAnyAttribute.cs
- ValueUtilsSmi.cs
- TextEndOfParagraph.cs
- VisualProxy.cs
- GlyphTypeface.cs
- HScrollProperties.cs
- DictionaryBase.cs
- ListSourceHelper.cs
- ExpandableObjectConverter.cs
- ManagementOperationWatcher.cs
- IntellisenseTextBox.cs
- AssemblyAttributesGoHere.cs
- TypographyProperties.cs
- SafeTokenHandle.cs
- AppDomainFactory.cs
- GridViewCommandEventArgs.cs
- EncodingInfo.cs
- DoubleCollectionConverter.cs
- WebPartExportVerb.cs
- messageonlyhwndwrapper.cs
- MenuStrip.cs
- TypeConverterMarkupExtension.cs
- XPathMultyIterator.cs
- xdrvalidator.cs
- Int16Animation.cs
- VersionedStreamOwner.cs
- URL.cs
- EventArgs.cs
- HwndSourceKeyboardInputSite.cs
- ApplicationServiceManager.cs
- XmlHierarchyData.cs
- ProviderException.cs
- SchemaCollectionCompiler.cs
- ToolStripPanelRow.cs
- Registry.cs
- DynamicDiscoSearcher.cs
- QilCloneVisitor.cs
- ValidatorCompatibilityHelper.cs
- TextProperties.cs
- ManagementNamedValueCollection.cs
- ListViewPagedDataSource.cs
- KoreanCalendar.cs
- StylusCollection.cs
- ByteStreamGeometryContext.cs
- DesignerSerializationManager.cs
- StatusBarItem.cs
- WorkflowTraceTransfer.cs
- DataKey.cs
- AxHost.cs
- ResizeGrip.cs
- TraceData.cs
- ClientScriptManagerWrapper.cs
- TextEditor.cs
- RadioButtonRenderer.cs