Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / Diagnostics / SwitchAttribute.cs / 1305376 / 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
- EventLogWatcher.cs
- CommandConverter.cs
- GroupLabel.cs
- ComponentEvent.cs
- KeyValueConfigurationElement.cs
- TextFormatter.cs
- TemplateBindingExpressionConverter.cs
- HtmlInputReset.cs
- CDSCollectionETWBCLProvider.cs
- IisTraceListener.cs
- Int32Storage.cs
- TrackPointCollection.cs
- SelectionEditor.cs
- XmlName.cs
- PassportAuthenticationEventArgs.cs
- UnsafeNativeMethodsMilCoreApi.cs
- FacetEnabledSchemaElement.cs
- DataReceivedEventArgs.cs
- RtfFormatStack.cs
- sortedlist.cs
- ActionMessageFilter.cs
- BinaryOperationBinder.cs
- RegexTree.cs
- ProfessionalColorTable.cs
- SafeReversePInvokeHandle.cs
- CellParagraph.cs
- TextRunCacheImp.cs
- MessageEncodingBindingElementImporter.cs
- Timer.cs
- DBSchemaTable.cs
- ElementMarkupObject.cs
- LogExtentCollection.cs
- PropertyChangedEventManager.cs
- BinaryObjectWriter.cs
- RoleManagerEventArgs.cs
- WindowsMenu.cs
- StatusBarPanelClickEvent.cs
- ServiceDescriptions.cs
- Environment.cs
- ILGenerator.cs
- BulletedListEventArgs.cs
- CustomErrorCollection.cs
- DBSchemaRow.cs
- XmlSchemaGroupRef.cs
- ToolboxItemSnapLineBehavior.cs
- Light.cs
- Misc.cs
- WebBrowser.cs
- DataListItem.cs
- CustomGrammar.cs
- InsufficientMemoryException.cs
- WindowsFont.cs
- Matrix3D.cs
- DispatcherTimer.cs
- RequestBringIntoViewEventArgs.cs
- Claim.cs
- XNodeNavigator.cs
- mediapermission.cs
- TdsParserStaticMethods.cs
- ResolveMatchesMessage11.cs
- QilInvoke.cs
- PathParser.cs
- XmlJsonWriter.cs
- GridProviderWrapper.cs
- UnsafeNativeMethods.cs
- UserPreferenceChangedEventArgs.cs
- ScriptServiceAttribute.cs
- LogLogRecordEnumerator.cs
- XPathNodeIterator.cs
- ClientType.cs
- BamlRecordWriter.cs
- TypeGeneratedEventArgs.cs
- Separator.cs
- MSAAEventDispatcher.cs
- BigInt.cs
- FilteredSchemaElementLookUpTable.cs
- CompositeDataBoundControl.cs
- DropShadowBitmapEffect.cs
- UInt16Storage.cs
- ClipboardData.cs
- XmlSchemaImport.cs
- DropDownList.cs
- cache.cs
- BoolLiteral.cs
- HTTPNotFoundHandler.cs
- DataRelationPropertyDescriptor.cs
- Package.cs
- PropertyEmitter.cs
- RequestNavigateEventArgs.cs
- TraceHandlerErrorFormatter.cs
- ListViewGroupItemCollection.cs
- Sentence.cs
- DataStorage.cs
- ActionMessageFilter.cs
- IndentedTextWriter.cs
- DelayedRegex.cs
- BindingExpressionBase.cs
- ContextMenuService.cs
- KerberosSecurityTokenAuthenticator.cs
- Point3DAnimation.cs