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
- TextSelectionHighlightLayer.cs
- ReachPrintTicketSerializer.cs
- AspNetRouteServiceHttpHandler.cs
- ConfigurationValidatorBase.cs
- SingleSelectRootGridEntry.cs
- XXXInfos.cs
- XmlHelper.cs
- DataGridAutoFormatDialog.cs
- Bits.cs
- CommandConverter.cs
- regiisutil.cs
- COMException.cs
- CaseInsensitiveHashCodeProvider.cs
- DBSqlParserColumn.cs
- DataGridViewDataErrorEventArgs.cs
- ADMembershipUser.cs
- PaginationProgressEventArgs.cs
- BitmapEffectGroup.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- XmlSchema.cs
- HyperlinkAutomationPeer.cs
- RuleSet.cs
- MultipleViewProviderWrapper.cs
- XmlText.cs
- LocatorPartList.cs
- CompilationSection.cs
- MetafileHeader.cs
- MasterPageParser.cs
- PathFigure.cs
- XmlSchemaDocumentation.cs
- SerTrace.cs
- PassportAuthentication.cs
- DataListItemEventArgs.cs
- EntryIndex.cs
- XmlNodeChangedEventArgs.cs
- HiddenField.cs
- HtmlWindowCollection.cs
- XmlResolver.cs
- precedingquery.cs
- CharKeyFrameCollection.cs
- ProvidePropertyAttribute.cs
- ColorConverter.cs
- BinaryKeyIdentifierClause.cs
- ResourceDictionary.cs
- DecoderNLS.cs
- SystemEvents.cs
- FontWeight.cs
- CapiSafeHandles.cs
- BindableTemplateBuilder.cs
- TabControlCancelEvent.cs
- Enlistment.cs
- NullableLongAverageAggregationOperator.cs
- SystemIPAddressInformation.cs
- SspiHelper.cs
- WinEventTracker.cs
- GatewayDefinition.cs
- ServiceModelInstallComponent.cs
- Group.cs
- DynamicValidatorEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- MenuItemStyle.cs
- StylusPointPropertyInfo.cs
- SHA384.cs
- OpenTypeLayout.cs
- IMembershipProvider.cs
- TypeBrowser.xaml.cs
- AccessDataSourceDesigner.cs
- ReachVisualSerializerAsync.cs
- precedingquery.cs
- AuthenticationService.cs
- SharedTcpTransportManager.cs
- RegisteredScript.cs
- XNameTypeConverter.cs
- OutputScope.cs
- CacheDependency.cs
- ThumbButtonInfoCollection.cs
- HostedNamedPipeTransportManager.cs
- DbMetaDataCollectionNames.cs
- SQLDouble.cs
- EditorPartDesigner.cs
- Deflater.cs
- PerfCounters.cs
- Rss20ItemFormatter.cs
- IDReferencePropertyAttribute.cs
- Activity.cs
- DataGridCell.cs
- DetailsViewRow.cs
- DataSourceControlBuilder.cs
- TreeViewDesigner.cs
- DataColumnChangeEvent.cs
- CreateParams.cs
- TextTreeObjectNode.cs
- GenericIdentity.cs
- EllipseGeometry.cs
- DataServiceEntityAttribute.cs
- DoubleCollectionValueSerializer.cs
- ActivityExecutorOperation.cs
- Knowncolors.cs
- JsonSerializer.cs
- MemberCollection.cs