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
- BitmapEffectState.cs
- SecUtil.cs
- MenuItemCollection.cs
- DiscardableAttribute.cs
- followingquery.cs
- AttributeQuery.cs
- bidPrivateBase.cs
- WbmpConverter.cs
- ReflectEventDescriptor.cs
- VarRefManager.cs
- ModuleConfigurationInfo.cs
- RestClientProxyHandler.cs
- ListControl.cs
- Overlapped.cs
- X509CertificateTrustedIssuerElement.cs
- Triangle.cs
- DependsOnAttribute.cs
- ObjectSecurityT.cs
- PrePrepareMethodAttribute.cs
- RelationalExpressions.cs
- UpdateTranslator.cs
- Calendar.cs
- XmlNamespaceDeclarationsAttribute.cs
- InputEventArgs.cs
- UInt16.cs
- LocatorPartList.cs
- ImageListUtils.cs
- HttpHeaderCollection.cs
- StylusPoint.cs
- GenericRootAutomationPeer.cs
- BitmapPalettes.cs
- VisualProxy.cs
- DataServiceEntityAttribute.cs
- GenericPrincipal.cs
- StringSorter.cs
- HttpResponseHeader.cs
- ExpressionBuilderContext.cs
- ActionFrame.cs
- HMACRIPEMD160.cs
- PerformanceCounter.cs
- PermissionSet.cs
- SecUtil.cs
- XmlCompatibilityReader.cs
- KeyNotFoundException.cs
- HttpCacheVary.cs
- CompilationLock.cs
- ToolStripContentPanelRenderEventArgs.cs
- ArrayList.cs
- Light.cs
- Int32CollectionConverter.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ArraySortHelper.cs
- StylusButtonCollection.cs
- InteropExecutor.cs
- DefaultSerializationProviderAttribute.cs
- Ref.cs
- Quaternion.cs
- InstallerTypeAttribute.cs
- RolePrincipal.cs
- ServicePoint.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Blend.cs
- CheckBoxField.cs
- WebPartCloseVerb.cs
- HtmlInputSubmit.cs
- ConfigurationCollectionAttribute.cs
- Stacktrace.cs
- DataGridViewRowHeaderCell.cs
- OutputCacheModule.cs
- WebControl.cs
- _SingleItemRequestCache.cs
- QueryContinueDragEventArgs.cs
- AccessorTable.cs
- ScriptManager.cs
- InheritanceAttribute.cs
- RewritingSimplifier.cs
- GridViewRowEventArgs.cs
- XmlILStorageConverter.cs
- ClientUtils.cs
- Grammar.cs
- LoginAutoFormat.cs
- SqlClientFactory.cs
- MetadataArtifactLoaderResource.cs
- FieldBuilder.cs
- SessionSwitchEventArgs.cs
- QueryOutputWriter.cs
- XmlReader.cs
- Statements.cs
- RawStylusSystemGestureInputReport.cs
- ProviderSettingsCollection.cs
- COM2ExtendedUITypeEditor.cs
- Trace.cs
- BitmapCodecInfoInternal.cs
- ToolStripItemEventArgs.cs
- SerializationSectionGroup.cs
- CategoryGridEntry.cs
- Vector3DCollectionConverter.cs
- _NetworkingPerfCounters.cs
- BidirectionalDictionary.cs
- StreamGeometryContext.cs