Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / Diagnostics / SwitchAttribute.cs / 1 / SwitchAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Collections;
namespace System.Diagnostics {
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor |
AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property)]
public sealed class SwitchAttribute : Attribute {
private Type type;
private string name;
private string description;
public SwitchAttribute (string switchName, Type switchType) {
SwitchName = switchName;
SwitchType = switchType;
}
public string SwitchName {
get { return name; }
set {
if (value == null)
throw new ArgumentNullException("value");
if (value.Length == 0)
throw new ArgumentException(SR.GetString(SR.InvalidNullEmptyArgument, "value"), "value");
name = value;
}
}
public Type SwitchType {
get { return type; }
set {
if (value == null)
throw new ArgumentNullException("value");
type = value;
}
}
public string SwitchDescription {
get { return description; }
set { description = value;}
}
public static SwitchAttribute[] GetAll(Assembly assembly) {
if (assembly == null)
throw new ArgumentNullException("assembly");
ArrayList switchAttribs = new ArrayList ();
object[] attribs = assembly.GetCustomAttributes(typeof(SwitchAttribute), false);
switchAttribs.AddRange(attribs);
Type[] types = assembly.GetTypes();
for (int i=0; i
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Collections;
namespace System.Diagnostics {
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor |
AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property)]
public sealed class SwitchAttribute : Attribute {
private Type type;
private string name;
private string description;
public SwitchAttribute (string switchName, Type switchType) {
SwitchName = switchName;
SwitchType = switchType;
}
public string SwitchName {
get { return name; }
set {
if (value == null)
throw new ArgumentNullException("value");
if (value.Length == 0)
throw new ArgumentException(SR.GetString(SR.InvalidNullEmptyArgument, "value"), "value");
name = value;
}
}
public Type SwitchType {
get { return type; }
set {
if (value == null)
throw new ArgumentNullException("value");
type = value;
}
}
public string SwitchDescription {
get { return description; }
set { description = value;}
}
public static SwitchAttribute[] GetAll(Assembly assembly) {
if (assembly == null)
throw new ArgumentNullException("assembly");
ArrayList switchAttribs = new ArrayList ();
object[] attribs = assembly.GetCustomAttributes(typeof(SwitchAttribute), false);
switchAttribs.AddRange(attribs);
Type[] types = assembly.GetTypes();
for (int i=0; i
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetaModel.cs
- recordstatescratchpad.cs
- StreamingContext.cs
- ExternalDataExchangeService.cs
- KeyboardNavigation.cs
- SpeechRecognizer.cs
- Int32Rect.cs
- TagNameToTypeMapper.cs
- ListMarkerSourceInfo.cs
- Oid.cs
- ToolStripArrowRenderEventArgs.cs
- ServiceModelConfigurationSection.cs
- EdmItemCollection.OcAssemblyCache.cs
- ContainerAction.cs
- MetadataCache.cs
- XmlValidatingReaderImpl.cs
- ClientTargetCollection.cs
- XmlSchema.cs
- PolicyException.cs
- EdmSchemaError.cs
- CompilerParameters.cs
- OutputCacheProfile.cs
- FixedSOMFixedBlock.cs
- FigureHelper.cs
- TdsParserStateObject.cs
- DataGridViewTextBoxCell.cs
- Cursor.cs
- TransactionalPackage.cs
- FieldAccessException.cs
- ServiceContractListItem.cs
- Types.cs
- File.cs
- MetaColumn.cs
- ColorDialog.cs
- PlatformCulture.cs
- AttributeCallbackBuilder.cs
- GridPatternIdentifiers.cs
- exports.cs
- RegisteredDisposeScript.cs
- TabletDevice.cs
- EntityDataSourceWrapperCollection.cs
- CompilationRelaxations.cs
- DataListItem.cs
- GeneratedContractType.cs
- SmiEventSink_Default.cs
- EntityContainerEntitySet.cs
- RenderDataDrawingContext.cs
- BinaryOperationBinder.cs
- SimpleBitVector32.cs
- SendMailErrorEventArgs.cs
- ToolboxItemCollection.cs
- ListView.cs
- StopStoryboard.cs
- messageonlyhwndwrapper.cs
- AssemblyBuilderData.cs
- CodeArrayIndexerExpression.cs
- RightsController.cs
- MessageFilterException.cs
- RoleService.cs
- ConditionCollection.cs
- WebPartCatalogCloseVerb.cs
- XmlDictionaryReaderQuotasElement.cs
- BaseCodeDomTreeGenerator.cs
- TaskFileService.cs
- WebScriptServiceHostFactory.cs
- RtfToXamlLexer.cs
- OleDbReferenceCollection.cs
- InvalidOleVariantTypeException.cs
- X509ChainPolicy.cs
- CipherData.cs
- FilePrompt.cs
- LZCodec.cs
- TransactedReceiveData.cs
- ZipIOExtraFieldZip64Element.cs
- DataGridViewCellValidatingEventArgs.cs
- NameValuePermission.cs
- ConfigXmlWhitespace.cs
- XmlSchemaElement.cs
- SmiContext.cs
- PauseStoryboard.cs
- MeasurementDCInfo.cs
- WebServiceData.cs
- Certificate.cs
- SponsorHelper.cs
- SlotInfo.cs
- CustomErrorsSection.cs
- UnsafeNativeMethods.cs
- CompilerGlobalScopeAttribute.cs
- SynchronizedPool.cs
- LockCookie.cs
- ColorContext.cs
- SkewTransform.cs
- ImageClickEventArgs.cs
- ParameterSubsegment.cs
- RtfControls.cs
- SHA384CryptoServiceProvider.cs
- ToolboxItemLoader.cs
- GridViewSelectEventArgs.cs
- XmlSerializerFactory.cs
- WorkflowHostingEndpoint.cs