Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _LocalDataStoreMgr.cs
- GridViewCellAutomationPeer.cs
- CollectionBase.cs
- HostingEnvironmentException.cs
- FrameworkTextComposition.cs
- RangeValuePattern.cs
- InheritanceAttribute.cs
- GraphicsPath.cs
- SemanticAnalyzer.cs
- FieldNameLookup.cs
- VerificationAttribute.cs
- HttpServerUtilityWrapper.cs
- RequestNavigateEventArgs.cs
- CodePropertyReferenceExpression.cs
- SevenBitStream.cs
- PolicyException.cs
- DataControlLinkButton.cs
- DecoderExceptionFallback.cs
- ValueOfAction.cs
- Padding.cs
- CollectionsUtil.cs
- IndexedEnumerable.cs
- XmlWrappingReader.cs
- AsnEncodedData.cs
- TypeReference.cs
- GroupQuery.cs
- ClientScriptManager.cs
- XmlRootAttribute.cs
- TdsParserStaticMethods.cs
- XNodeSchemaApplier.cs
- TraceRecords.cs
- ListViewEditEventArgs.cs
- Processor.cs
- EventToken.cs
- SmtpMail.cs
- SID.cs
- UInt64.cs
- COAUTHINFO.cs
- DataGridColumnHeadersPresenter.cs
- SecurityUtils.cs
- CharAnimationUsingKeyFrames.cs
- WinEventWrap.cs
- UnsafeMethods.cs
- WindowsAltTab.cs
- SmtpMail.cs
- InfocardExtendedInformationCollection.cs
- PreloadedPackages.cs
- ResourceDisplayNameAttribute.cs
- TreeNodeCollection.cs
- AuthenticationService.cs
- NullableBoolConverter.cs
- CommentAction.cs
- Triangle.cs
- CaseInsensitiveHashCodeProvider.cs
- SqlBulkCopyColumnMapping.cs
- PropertyInformation.cs
- ServiceTimeoutsBehavior.cs
- WorkflowFileItem.cs
- EventInfo.cs
- BinaryParser.cs
- safex509handles.cs
- DateTimeUtil.cs
- DeviceOverridableAttribute.cs
- XmlSchemaDatatype.cs
- PageCodeDomTreeGenerator.cs
- ToolStripDesigner.cs
- EncryptedData.cs
- PropertyMetadata.cs
- CodeTypeReferenceExpression.cs
- ZoneButton.cs
- DayRenderEvent.cs
- RuntimeTransactionHandle.cs
- ValueTypeIndexerReference.cs
- TypeElement.cs
- LineServicesCallbacks.cs
- Select.cs
- SessionStateUtil.cs
- DataViewSettingCollection.cs
- DiscriminatorMap.cs
- MemberDomainMap.cs
- StorageAssociationTypeMapping.cs
- PhysicalAddress.cs
- XPathCompileException.cs
- ContractMapping.cs
- Vector3DIndependentAnimationStorage.cs
- ResourceAttributes.cs
- MsmqOutputMessage.cs
- NeutralResourcesLanguageAttribute.cs
- MaskedTextProvider.cs
- formatstringdialog.cs
- WindowsAuthenticationModule.cs
- Drawing.cs
- ProxyManager.cs
- SettingsPropertyValueCollection.cs
- SiteOfOriginContainer.cs
- IndexOutOfRangeException.cs
- StackBuilderSink.cs
- OdbcDataAdapter.cs
- UnmanagedMemoryStreamWrapper.cs
- OperationPickerDialog.designer.cs