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
- LazyInitializer.cs
- StrongNameUtility.cs
- SqlAliasesReferenced.cs
- CryptoApi.cs
- NavigatorInput.cs
- SamlAuthenticationClaimResource.cs
- InfoCardService.cs
- TextEditorCharacters.cs
- CustomAttributeBuilder.cs
- PropertyKey.cs
- DetailsViewRow.cs
- RNGCryptoServiceProvider.cs
- OptimalBreakSession.cs
- ComPlusTraceRecord.cs
- HMACSHA1.cs
- ObjectSet.cs
- LocalValueEnumerator.cs
- CounterSample.cs
- DeviceContexts.cs
- GenericAuthenticationEventArgs.cs
- _IPv6Address.cs
- PathNode.cs
- DBDataPermissionAttribute.cs
- RuleConditionDialog.cs
- TableDetailsRow.cs
- CompareValidator.cs
- DrawingVisual.cs
- ClipboardProcessor.cs
- TemplateControlParser.cs
- ReflectionPermission.cs
- StorageInfo.cs
- sqlnorm.cs
- FlagsAttribute.cs
- SqlDataSourceSelectingEventArgs.cs
- ConnectorEditor.cs
- MarkupCompilePass2.cs
- ProcessInputEventArgs.cs
- WebEventTraceProvider.cs
- WrappingXamlSchemaContext.cs
- DocumentPage.cs
- ErrorEventArgs.cs
- XmlAttributeCollection.cs
- ConnectionInterfaceCollection.cs
- WSFederationHttpSecurityMode.cs
- PathGradientBrush.cs
- RSAOAEPKeyExchangeDeformatter.cs
- SelectionManager.cs
- ProfileService.cs
- LinqDataSourceHelper.cs
- CreateUserWizardStep.cs
- SqlError.cs
- RtfToken.cs
- Bidi.cs
- ObjectListFieldsPage.cs
- MouseOverProperty.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DateTimeParse.cs
- DataObjectEventArgs.cs
- PageAdapter.cs
- CodeTypeDelegate.cs
- TagMapInfo.cs
- MSG.cs
- ScrollItemPatternIdentifiers.cs
- ElementAction.cs
- GlyphRunDrawing.cs
- BeginStoryboard.cs
- ErrorWebPart.cs
- XmlSchemaDocumentation.cs
- MaskInputRejectedEventArgs.cs
- FontDifferentiator.cs
- ServiceBusyException.cs
- XmlElementCollection.cs
- SAPICategories.cs
- ZoomPercentageConverter.cs
- AsyncDataRequest.cs
- DataTemplateKey.cs
- CorePropertiesFilter.cs
- ExpressionBinding.cs
- GestureRecognizer.cs
- VBIdentifierName.cs
- Binding.cs
- DiscreteKeyFrames.cs
- WebPartVerbCollection.cs
- TextBox.cs
- ToolStripRenderer.cs
- ThreadStartException.cs
- TemplateAction.cs
- ToolStripDropDown.cs
- DynamicMethod.cs
- Graph.cs
- LiteralText.cs
- CryptoKeySecurity.cs
- XmlDataSourceView.cs
- HtmlForm.cs
- CommentEmitter.cs
- ExpressionBuilderContext.cs
- ComboBoxItem.cs
- BrowserInteropHelper.cs
- XmlDocumentType.cs
- BookmarkEventArgs.cs