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
- TagPrefixCollection.cs
- ChannelManagerBase.cs
- StringAnimationUsingKeyFrames.cs
- Geometry3D.cs
- ProcessInfo.cs
- StrongNamePublicKeyBlob.cs
- ControlUtil.cs
- ConfigurationStrings.cs
- EpmSourceTree.cs
- BitConverter.cs
- RuleProcessor.cs
- WrapPanel.cs
- BindValidator.cs
- ThrowHelper.cs
- SqlXmlStorage.cs
- ListDictionaryInternal.cs
- CopyNamespacesAction.cs
- Configuration.cs
- GridItemProviderWrapper.cs
- DuplicateWaitObjectException.cs
- XmlAttributes.cs
- ByteStreamGeometryContext.cs
- InvalidCastException.cs
- StylusPointPropertyId.cs
- PhonemeConverter.cs
- ExceptionValidationRule.cs
- XmlReflectionMember.cs
- CompModHelpers.cs
- CodeTypeDeclaration.cs
- PeerMessageDispatcher.cs
- LineInfo.cs
- RuntimeConfigurationRecord.cs
- _DomainName.cs
- TheQuery.cs
- HMACSHA256.cs
- ListSourceHelper.cs
- WebPartUserCapability.cs
- BitmapEffectInputData.cs
- odbcmetadatacollectionnames.cs
- CustomErrorCollection.cs
- DataTemplateSelector.cs
- KeyTime.cs
- CodeAttachEventStatement.cs
- NavigationProperty.cs
- PointCollection.cs
- GuidConverter.cs
- HttpCapabilitiesSectionHandler.cs
- HtmlInputImage.cs
- TrimSurroundingWhitespaceAttribute.cs
- MetadataReference.cs
- SoapReflectionImporter.cs
- VoiceChangeEventArgs.cs
- BooleanFacetDescriptionElement.cs
- ClientApiGenerator.cs
- DataGridBoolColumn.cs
- FontSizeConverter.cs
- SchemaTableOptionalColumn.cs
- GridViewSelectEventArgs.cs
- IODescriptionAttribute.cs
- StyleCollection.cs
- TextSpan.cs
- SqlNode.cs
- DependencyObject.cs
- SqlConnectionPoolProviderInfo.cs
- XslTransform.cs
- DeliveryRequirementsAttribute.cs
- MgmtConfigurationRecord.cs
- ManualResetEventSlim.cs
- XmlChoiceIdentifierAttribute.cs
- PingReply.cs
- DateTimeParse.cs
- ProcessHost.cs
- HotSpotCollection.cs
- SetterBase.cs
- DecimalAnimation.cs
- DataSvcMapFileSerializer.cs
- SqlGenericUtil.cs
- _OSSOCK.cs
- EntityAdapter.cs
- SelectionGlyph.cs
- HtmlWindowCollection.cs
- BatchServiceHost.cs
- CodeMemberField.cs
- SelectionGlyph.cs
- CutCopyPasteHelper.cs
- ValuePattern.cs
- WindowShowOrOpenTracker.cs
- diagnosticsswitches.cs
- ComboBoxAutomationPeer.cs
- ClientData.cs
- SchemaManager.cs
- QuadraticBezierSegment.cs
- EmissiveMaterial.cs
- EntityDataSourceDesignerHelper.cs
- GeneralTransform3D.cs
- SafeFindHandle.cs
- SetIterators.cs
- BrowserInteropHelper.cs
- DataKey.cs
- Table.cs