Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- XMLSyntaxException.cs
- RequestedSignatureDialog.cs
- CodePageUtils.cs
- DataGridViewTopLeftHeaderCell.cs
- ConcatQueryOperator.cs
- WindowsTokenRoleProvider.cs
- NTAccount.cs
- FormsAuthenticationUserCollection.cs
- Types.cs
- SpeechRecognizer.cs
- TextTrailingCharacterEllipsis.cs
- RIPEMD160.cs
- DataSourceXmlSerializationAttribute.cs
- CaseInsensitiveOrdinalStringComparer.cs
- GridPattern.cs
- FrameworkContentElementAutomationPeer.cs
- PropertyDescriptorComparer.cs
- CodeGenerator.cs
- DataGridViewCellValueEventArgs.cs
- EntityStoreSchemaFilterEntry.cs
- BindingContext.cs
- CompilerLocalReference.cs
- WebRequestModuleElement.cs
- XmlUtilWriter.cs
- Brushes.cs
- HttpMethodConstraint.cs
- MappingException.cs
- RtfControls.cs
- UnaryQueryOperator.cs
- DiscardableAttribute.cs
- CodeTypeDeclaration.cs
- UpdateCompiler.cs
- Point.cs
- EntityDataSourceChangedEventArgs.cs
- BidPrivateBase.cs
- ListViewInsertedEventArgs.cs
- ResourceReferenceExpression.cs
- WebPartEditorOkVerb.cs
- FormatException.cs
- HttpContextWrapper.cs
- SqlGenerator.cs
- XmlQueryOutput.cs
- PerspectiveCamera.cs
- JsonReader.cs
- MachineKeySection.cs
- ImageResources.Designer.cs
- HybridObjectCache.cs
- Normalization.cs
- ZipIOLocalFileHeader.cs
- PluggableProtocol.cs
- Knowncolors.cs
- XmlSchemaExporter.cs
- ThreadPool.cs
- NegatedConstant.cs
- ColorDialog.cs
- Boolean.cs
- BindingValueChangedEventArgs.cs
- AnimationClock.cs
- MultiSelectRootGridEntry.cs
- WindowsListViewScroll.cs
- EmptyImpersonationContext.cs
- ContainerUIElement3D.cs
- ImageKeyConverter.cs
- TypedElement.cs
- TextFindEngine.cs
- ECDiffieHellman.cs
- OutputCache.cs
- Events.cs
- WebPartCloseVerb.cs
- RuleInfoComparer.cs
- CollectionBuilder.cs
- PartialToken.cs
- IOThreadScheduler.cs
- MobileRedirect.cs
- EventWaitHandle.cs
- Rfc2898DeriveBytes.cs
- StaticExtension.cs
- TypeDescriptionProvider.cs
- QueryPageSettingsEventArgs.cs
- Baml2006ReaderFrame.cs
- XhtmlBasicListAdapter.cs
- HighContrastHelper.cs
- ApplicationHost.cs
- RuleSet.cs
- ConsoleTraceListener.cs
- AttachmentService.cs
- ReflectEventDescriptor.cs
- TreeView.cs
- DataGridViewTextBoxColumn.cs
- wgx_sdk_version.cs
- XsdBuilder.cs
- ComplexObject.cs
- FixUp.cs
- WebPartMenu.cs
- BindingListCollectionView.cs
- KeyConverter.cs
- BaseCollection.cs
- GridViewSelectEventArgs.cs
- DynamicQueryStringParameter.cs
- NamedElement.cs