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
- CompositeKey.cs
- BufferedWebEventProvider.cs
- ScriptModule.cs
- WCFBuildProvider.cs
- ComponentResourceKeyConverter.cs
- LiteralDesigner.cs
- SessionStateSection.cs
- ClientEventManager.cs
- ConstraintConverter.cs
- DbMetaDataColumnNames.cs
- ItemType.cs
- SID.cs
- ItemMap.cs
- Brush.cs
- NamespaceInfo.cs
- ValueCollectionParameterReader.cs
- Padding.cs
- IBuiltInEvidence.cs
- LogWriteRestartAreaAsyncResult.cs
- TableChangeProcessor.cs
- GeneralTransform3D.cs
- EntryPointNotFoundException.cs
- TemplateBuilder.cs
- ReachSerializationUtils.cs
- QueuePropertyVariants.cs
- TraceShell.cs
- InfoCardTrace.cs
- ZipIOFileItemStream.cs
- TypeSystemProvider.cs
- Variable.cs
- DesignRelationCollection.cs
- AttributeTableBuilder.cs
- ParameterToken.cs
- Point3DAnimationUsingKeyFrames.cs
- BindableTemplateBuilder.cs
- EncodingInfo.cs
- LocatorPartList.cs
- CustomCategoryAttribute.cs
- ExcludePathInfo.cs
- WpfGeneratedKnownProperties.cs
- ObjectDataSourceStatusEventArgs.cs
- WindowsTokenRoleProvider.cs
- HyperLinkDataBindingHandler.cs
- RegexWriter.cs
- CodeGen.cs
- UInt16Storage.cs
- MonitorWrapper.cs
- TextElementCollectionHelper.cs
- LogRecordSequence.cs
- Variant.cs
- HostVisual.cs
- BitmapMetadataEnumerator.cs
- BindingManagerDataErrorEventArgs.cs
- ContainerTracking.cs
- OleDbReferenceCollection.cs
- PropertyGeneratedEventArgs.cs
- DataGridParentRows.cs
- WsdlInspector.cs
- XamlDebuggerXmlReader.cs
- QuaternionValueSerializer.cs
- SplayTreeNode.cs
- mongolianshape.cs
- Rotation3DKeyFrameCollection.cs
- OdbcEnvironment.cs
- DoubleAnimationClockResource.cs
- DataGridViewComboBoxCell.cs
- ScrollViewerAutomationPeer.cs
- BaseComponentEditor.cs
- SpoolingTask.cs
- ResourceIDHelper.cs
- CodeFieldReferenceExpression.cs
- DiscoveryDefaults.cs
- EntityFunctions.cs
- CompilerGlobalScopeAttribute.cs
- CorrelationManager.cs
- RegistrationServices.cs
- ListItemConverter.cs
- WebServiceMethodData.cs
- RoleManagerSection.cs
- ConstNode.cs
- SqlBooleanMismatchVisitor.cs
- XsdDateTime.cs
- CallContext.cs
- AttachInfo.cs
- PerfService.cs
- ExceptionUtil.cs
- InvalidProgramException.cs
- Int32CollectionValueSerializer.cs
- CodeTypeConstructor.cs
- SchemaImporterExtensionElement.cs
- CodeGroup.cs
- PenContexts.cs
- DBSchemaRow.cs
- EndOfStreamException.cs
- TableColumnCollectionInternal.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- WebPartUserCapability.cs
- LogRestartAreaEnumerator.cs
- DataGridViewTopRowAccessibleObject.cs
- XmlNodeComparer.cs