Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / WebCategoryAttribute.cs / 1 / WebCategoryAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Web {
using System;
using System.ComponentModel;
using System.Web.Util;
///
///
///
/// CategoryAttribute that can access ASP.NET localized strings.
///
///
[AttributeUsage(AttributeTargets.All)]
internal sealed class WebCategoryAttribute : CategoryAttribute {
///
///
/// Initializes a new instance of the class.
///
///
internal WebCategoryAttribute(string category) : base(category) {
}
public override object TypeId {
get {
return typeof(CategoryAttribute);
}
}
///
/// This method is called the first time the category property
/// is accessed. It provides a way to lookup a localized string for
/// the given category. Classes may override this to add their
/// own localized names to categories. If a localized string is
/// available for the given value, the method should return it.
/// Otherwise, it should return null.
///
protected override string GetLocalizedString(string value) {
string localizedValue = base.GetLocalizedString(value);
if (localizedValue == null) {
localizedValue = (string)SR.GetString("Category_" + value);
}
// This attribute is internal, and we should never have a missing resource string.
//
Debug.Assert(localizedValue != null, "All WebForms category attributes should have localized strings. Category '" + value + "' not found.");
return localizedValue;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Web {
using System;
using System.ComponentModel;
using System.Web.Util;
///
///
///
/// CategoryAttribute that can access ASP.NET localized strings.
///
///
[AttributeUsage(AttributeTargets.All)]
internal sealed class WebCategoryAttribute : CategoryAttribute {
///
///
/// Initializes a new instance of the class.
///
///
internal WebCategoryAttribute(string category) : base(category) {
}
public override object TypeId {
get {
return typeof(CategoryAttribute);
}
}
///
/// This method is called the first time the category property
/// is accessed. It provides a way to lookup a localized string for
/// the given category. Classes may override this to add their
/// own localized names to categories. If a localized string is
/// available for the given value, the method should return it.
/// Otherwise, it should return null.
///
protected override string GetLocalizedString(string value) {
string localizedValue = base.GetLocalizedString(value);
if (localizedValue == null) {
localizedValue = (string)SR.GetString("Category_" + value);
}
// This attribute is internal, and we should never have a missing resource string.
//
Debug.Assert(localizedValue != null, "All WebForms category attributes should have localized strings. Category '" + value + "' not found.");
return localizedValue;
}
}
}
// 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
- ContentTextAutomationPeer.cs
- WindowsMenu.cs
- OleDbEnumerator.cs
- ByteAnimationBase.cs
- Transactions.cs
- SqlInternalConnection.cs
- TraceSection.cs
- InvokeMethodActivityDesigner.cs
- HorizontalAlignConverter.cs
- Enum.cs
- PatternMatcher.cs
- SigningProgress.cs
- CanonicalizationDriver.cs
- Annotation.cs
- CodeDefaultValueExpression.cs
- ZipIOFileItemStream.cs
- AsyncOperationManager.cs
- PersistenceProviderBehavior.cs
- RouteValueExpressionBuilder.cs
- RemoteWebConfigurationHostServer.cs
- Scanner.cs
- _SpnDictionary.cs
- FilterQuery.cs
- LayoutTable.cs
- MD5CryptoServiceProvider.cs
- Matrix3DConverter.cs
- WebSysDefaultValueAttribute.cs
- ProbeRequestResponseAsyncResult.cs
- EntityDataSourceSelectedEventArgs.cs
- AlphabetConverter.cs
- XmlDictionaryReader.cs
- ErrorRuntimeConfig.cs
- PersonalizationStateInfo.cs
- DataViewSetting.cs
- ToolStripProgressBar.cs
- SettingsPropertyValueCollection.cs
- BuildManagerHost.cs
- XmlSchemaInferenceException.cs
- HandleCollector.cs
- DataGridViewCellStyleEditor.cs
- AttributeProviderAttribute.cs
- HeaderPanel.cs
- XPathParser.cs
- ImpersonateTokenRef.cs
- SafeUserTokenHandle.cs
- CodeIdentifiers.cs
- FixedSOMTextRun.cs
- BaseTemplateBuildProvider.cs
- GridViewColumnCollection.cs
- MenuAutomationPeer.cs
- RootProfilePropertySettingsCollection.cs
- RequestCacheEntry.cs
- DesignOnlyAttribute.cs
- ImageIndexConverter.cs
- LogEntrySerialization.cs
- SpellCheck.cs
- FontResourceCache.cs
- SerialPinChanges.cs
- SqlErrorCollection.cs
- XmlSchemaParticle.cs
- DBPropSet.cs
- Stacktrace.cs
- WindowsFont.cs
- BindingCompleteEventArgs.cs
- TextTreeExtractElementUndoUnit.cs
- DocumentOrderQuery.cs
- DeferredReference.cs
- SmiXetterAccessMap.cs
- ListBoxDesigner.cs
- XmlResolver.cs
- MediaPlayer.cs
- InProcStateClientManager.cs
- DBParameter.cs
- SpecularMaterial.cs
- DurableInstancingOptions.cs
- BinaryParser.cs
- XsdCachingReader.cs
- TextHidden.cs
- ToolboxItem.cs
- CategoryAttribute.cs
- HttpAsyncResult.cs
- ValidatingPropertiesEventArgs.cs
- TCPListener.cs
- InternalBase.cs
- IdentityReference.cs
- InstancePersistenceEvent.cs
- XamlBuildProvider.cs
- HitTestResult.cs
- MarkupExtensionSerializer.cs
- UmAlQuraCalendar.cs
- PaperSize.cs
- SessionState.cs
- IndependentlyAnimatedPropertyMetadata.cs
- DeploymentSectionCache.cs
- DurableServiceAttribute.cs
- AutoResizedEvent.cs
- ZipIOLocalFileBlock.cs
- TransactionFlowBindingElement.cs
- CardSpaceShim.cs
- ZipIORawDataFileBlock.cs