Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / ComponentModel / CategoryAttribute.cs / 1 / CategoryAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies the category in which the property or event will be displayed in a
/// visual designer.
///
[AttributeUsage(AttributeTargets.All)]
public class CategoryAttribute : Attribute {
private static CategoryAttribute appearance;
private static CategoryAttribute asynchronous;
private static CategoryAttribute behavior;
private static CategoryAttribute data;
private static CategoryAttribute design;
private static CategoryAttribute action;
private static CategoryAttribute format;
private static CategoryAttribute layout;
private static CategoryAttribute mouse;
private static CategoryAttribute key;
private static CategoryAttribute focus;
private static CategoryAttribute windowStyle;
private static CategoryAttribute dragDrop;
private static CategoryAttribute defAttr;
private bool localized;
///
///
/// Provides the actual category name.
///
///
private string categoryValue;
///
/// Gets the action category attribute.
///
public static CategoryAttribute Action {
get {
if (action == null) {
action = new CategoryAttribute("Action");
}
return action;
}
}
///
/// Gets the appearance category attribute.
///
public static CategoryAttribute Appearance {
get {
if (appearance == null) {
appearance = new CategoryAttribute("Appearance");
}
return appearance;
}
}
///
/// Gets the asynchronous category attribute.
///
public static CategoryAttribute Asynchronous {
get {
if (asynchronous == null) {
asynchronous = new CategoryAttribute("Asynchronous");
}
return asynchronous;
}
}
///
/// Gets the behavior category attribute.
///
public static CategoryAttribute Behavior {
get {
if (behavior == null) {
behavior = new CategoryAttribute("Behavior");
}
return behavior;
}
}
///
/// Gets the data category attribute.
///
public static CategoryAttribute Data {
get {
if (data == null) {
data = new CategoryAttribute("Data");
}
return data;
}
}
///
/// Gets the default category attribute.
///
public static CategoryAttribute Default {
get {
if (defAttr == null) {
defAttr = new CategoryAttribute();
}
return defAttr;
}
}
///
/// Gets the design category attribute.
///
public static CategoryAttribute Design {
get {
if (design == null) {
design = new CategoryAttribute("Design");
}
return design;
}
}
///
/// Gets the drag and drop category attribute.
///
public static CategoryAttribute DragDrop {
get {
if (dragDrop == null) {
dragDrop = new CategoryAttribute("DragDrop");
}
return dragDrop;
}
}
///
/// Gets the focus category attribute.
///
public static CategoryAttribute Focus {
get {
if (focus == null) {
focus = new CategoryAttribute("Focus");
}
return focus;
}
}
///
/// Gets the format category attribute.
///
public static CategoryAttribute Format {
get {
if (format == null) {
format = new CategoryAttribute("Format");
}
return format;
}
}
///
/// Gets the keyboard category attribute.
///
public static CategoryAttribute Key {
get {
if (key == null) {
key = new CategoryAttribute("Key");
}
return key;
}
}
///
/// Gets the layout category attribute.
///
public static CategoryAttribute Layout {
get {
if (layout == null) {
layout = new CategoryAttribute("Layout");
}
return layout;
}
}
///
/// Gets the mouse category attribute.
///
public static CategoryAttribute Mouse {
get {
if (mouse == null) {
mouse = new CategoryAttribute("Mouse");
}
return mouse;
}
}
///
/// Gets the window style category
/// attribute.
///
public static CategoryAttribute WindowStyle {
get {
if (windowStyle == null) {
windowStyle = new CategoryAttribute("WindowStyle");
}
return windowStyle;
}
}
///
/// Initializes a new instance of the
/// class with the default category.
///
public CategoryAttribute() : this("Default") {
}
///
/// Initializes a new instance of the class with
/// the specified category name.
///
public CategoryAttribute(string category) {
this.categoryValue = category;
this.localized = false;
}
///
/// Gets the name of the category for the property or event
/// that this attribute is bound to.
///
public string Category {
get {
if (!localized) {
localized = true;
string localizedValue = GetLocalizedString(categoryValue);
if (localizedValue != null) {
categoryValue = localizedValue;
}
}
return categoryValue;
}
}
///
///
///
///
///
///
public override bool Equals(object obj){
if (obj == this) {
return true;
}
if (obj is CategoryAttribute){
return Category.Equals(((CategoryAttribute)obj).Category);
}
return false;
}
///
/// [To be supplied.]
///
public override int GetHashCode() {
return Category.GetHashCode();
}
///
/// Looks up the localized name of a given category.
///
protected virtual string GetLocalizedString(string value) {
return (string)SR.GetObject("PropertyCategory" + value);
}
///
///
///
///
///
///
public override bool IsDefaultAttribute() {
return Category.Equals(Default.Category);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies the category in which the property or event will be displayed in a
/// visual designer.
///
[AttributeUsage(AttributeTargets.All)]
public class CategoryAttribute : Attribute {
private static CategoryAttribute appearance;
private static CategoryAttribute asynchronous;
private static CategoryAttribute behavior;
private static CategoryAttribute data;
private static CategoryAttribute design;
private static CategoryAttribute action;
private static CategoryAttribute format;
private static CategoryAttribute layout;
private static CategoryAttribute mouse;
private static CategoryAttribute key;
private static CategoryAttribute focus;
private static CategoryAttribute windowStyle;
private static CategoryAttribute dragDrop;
private static CategoryAttribute defAttr;
private bool localized;
///
///
/// Provides the actual category name.
///
///
private string categoryValue;
///
/// Gets the action category attribute.
///
public static CategoryAttribute Action {
get {
if (action == null) {
action = new CategoryAttribute("Action");
}
return action;
}
}
///
/// Gets the appearance category attribute.
///
public static CategoryAttribute Appearance {
get {
if (appearance == null) {
appearance = new CategoryAttribute("Appearance");
}
return appearance;
}
}
///
/// Gets the asynchronous category attribute.
///
public static CategoryAttribute Asynchronous {
get {
if (asynchronous == null) {
asynchronous = new CategoryAttribute("Asynchronous");
}
return asynchronous;
}
}
///
/// Gets the behavior category attribute.
///
public static CategoryAttribute Behavior {
get {
if (behavior == null) {
behavior = new CategoryAttribute("Behavior");
}
return behavior;
}
}
///
/// Gets the data category attribute.
///
public static CategoryAttribute Data {
get {
if (data == null) {
data = new CategoryAttribute("Data");
}
return data;
}
}
///
/// Gets the default category attribute.
///
public static CategoryAttribute Default {
get {
if (defAttr == null) {
defAttr = new CategoryAttribute();
}
return defAttr;
}
}
///
/// Gets the design category attribute.
///
public static CategoryAttribute Design {
get {
if (design == null) {
design = new CategoryAttribute("Design");
}
return design;
}
}
///
/// Gets the drag and drop category attribute.
///
public static CategoryAttribute DragDrop {
get {
if (dragDrop == null) {
dragDrop = new CategoryAttribute("DragDrop");
}
return dragDrop;
}
}
///
/// Gets the focus category attribute.
///
public static CategoryAttribute Focus {
get {
if (focus == null) {
focus = new CategoryAttribute("Focus");
}
return focus;
}
}
///
/// Gets the format category attribute.
///
public static CategoryAttribute Format {
get {
if (format == null) {
format = new CategoryAttribute("Format");
}
return format;
}
}
///
/// Gets the keyboard category attribute.
///
public static CategoryAttribute Key {
get {
if (key == null) {
key = new CategoryAttribute("Key");
}
return key;
}
}
///
/// Gets the layout category attribute.
///
public static CategoryAttribute Layout {
get {
if (layout == null) {
layout = new CategoryAttribute("Layout");
}
return layout;
}
}
///
/// Gets the mouse category attribute.
///
public static CategoryAttribute Mouse {
get {
if (mouse == null) {
mouse = new CategoryAttribute("Mouse");
}
return mouse;
}
}
///
/// Gets the window style category
/// attribute.
///
public static CategoryAttribute WindowStyle {
get {
if (windowStyle == null) {
windowStyle = new CategoryAttribute("WindowStyle");
}
return windowStyle;
}
}
///
/// Initializes a new instance of the
/// class with the default category.
///
public CategoryAttribute() : this("Default") {
}
///
/// Initializes a new instance of the class with
/// the specified category name.
///
public CategoryAttribute(string category) {
this.categoryValue = category;
this.localized = false;
}
///
/// Gets the name of the category for the property or event
/// that this attribute is bound to.
///
public string Category {
get {
if (!localized) {
localized = true;
string localizedValue = GetLocalizedString(categoryValue);
if (localizedValue != null) {
categoryValue = localizedValue;
}
}
return categoryValue;
}
}
///
///
///
///
///
///
public override bool Equals(object obj){
if (obj == this) {
return true;
}
if (obj is CategoryAttribute){
return Category.Equals(((CategoryAttribute)obj).Category);
}
return false;
}
///
/// [To be supplied.]
///
public override int GetHashCode() {
return Category.GetHashCode();
}
///
/// Looks up the localized name of a given category.
///
protected virtual string GetLocalizedString(string value) {
return (string)SR.GetObject("PropertyCategory" + value);
}
///
///
///
///
///
///
public override bool IsDefaultAttribute() {
return Category.Equals(Default.Category);
}
}
}
// 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
- XPathException.cs
- Codec.cs
- ActivityContext.cs
- SqlBuffer.cs
- IndentedWriter.cs
- XPathNodeIterator.cs
- _CommandStream.cs
- TileModeValidation.cs
- EnvelopedSignatureTransform.cs
- XslNumber.cs
- ScrollPattern.cs
- SimpleTypesSurrogate.cs
- ListMarkerSourceInfo.cs
- ConversionHelper.cs
- StringArrayConverter.cs
- DataGridViewAccessibleObject.cs
- Selection.cs
- ValueUtilsSmi.cs
- SerializationAttributes.cs
- DataBindingsDialog.cs
- SecurityHelper.cs
- ToolTip.cs
- SmtpNetworkElement.cs
- BulletChrome.cs
- FileLogRecord.cs
- SchemaCollectionPreprocessor.cs
- SecureStringHasher.cs
- StorageRoot.cs
- SQLInt64.cs
- DataContractSerializerOperationBehavior.cs
- Directory.cs
- Model3DCollection.cs
- HtmlValidatorAdapter.cs
- ToolboxItemFilterAttribute.cs
- AdornedElementPlaceholder.cs
- RotateTransform.cs
- ScriptResourceHandler.cs
- NetPipeSectionData.cs
- FullTrustAssembliesSection.cs
- PowerModeChangedEventArgs.cs
- ToolStripRenderer.cs
- DataServiceHost.cs
- ReturnType.cs
- BrowserInteropHelper.cs
- SelectionEditingBehavior.cs
- MenuAutoFormat.cs
- UnaryNode.cs
- QueryAsyncResult.cs
- VectorConverter.cs
- TypeDescriptionProviderAttribute.cs
- GraphicsContainer.cs
- SQLByteStorage.cs
- GeneralTransform3DTo2D.cs
- RowParagraph.cs
- ServiceKnownTypeAttribute.cs
- ContentDisposition.cs
- BuildProvider.cs
- MetadataPropertyvalue.cs
- CodeVariableDeclarationStatement.cs
- MemberMaps.cs
- DocumentViewerBaseAutomationPeer.cs
- TableRow.cs
- LogicalExpressionEditor.cs
- MexBindingBindingCollectionElement.cs
- WindowsStartMenu.cs
- EntityUtil.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- InternalBufferOverflowException.cs
- UnsafeNetInfoNativeMethods.cs
- FrameworkPropertyMetadata.cs
- DesignerAutoFormatStyle.cs
- XamlVector3DCollectionSerializer.cs
- SemanticResultKey.cs
- DriveNotFoundException.cs
- WizardPanel.cs
- SubMenuStyleCollection.cs
- ErrorTolerantObjectWriter.cs
- StandardTransformFactory.cs
- MenuAdapter.cs
- PolicyUnit.cs
- WaitHandleCannotBeOpenedException.cs
- TextTreeTextBlock.cs
- ProgressBar.cs
- NamedPipeTransportManager.cs
- DefinitionUpdate.cs
- IBuiltInEvidence.cs
- SqlOuterApplyReducer.cs
- MemoryStream.cs
- ValidationRule.cs
- ReadOnlyPermissionSet.cs
- HMACSHA1.cs
- MobileUserControlDesigner.cs
- Pair.cs
- OleDbErrorCollection.cs
- Mutex.cs
- DropTarget.cs
- WebDescriptionAttribute.cs
- DesignerAttribute.cs
- RequestCacheManager.cs
- ResourceReferenceExpression.cs