Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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// 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
- MessageEncodingBindingElementImporter.cs
- XmlElementAttributes.cs
- CodeDomSerializationProvider.cs
- DataGridViewUtilities.cs
- Rotation3D.cs
- FrameworkTemplate.cs
- GroupPartitionExpr.cs
- XmlNodeReader.cs
- Pair.cs
- AssociationSetMetadata.cs
- TimeIntervalCollection.cs
- DivideByZeroException.cs
- EditorPartChrome.cs
- RightsManagementEncryptionTransform.cs
- ViewSimplifier.cs
- GridViewUpdateEventArgs.cs
- DataGridViewRowsAddedEventArgs.cs
- ConnectionProviderAttribute.cs
- ScrollBarAutomationPeer.cs
- StopRoutingHandler.cs
- AssemblyEvidenceFactory.cs
- WindowsListBox.cs
- PreviewPageInfo.cs
- XsdValidatingReader.cs
- ApplicationSettingsBase.cs
- XmlDocumentViewSchema.cs
- HostProtectionException.cs
- DataGridHelper.cs
- ContentDefinition.cs
- MsmqEncryptionAlgorithm.cs
- HttpWebResponse.cs
- SegmentInfo.cs
- CacheDict.cs
- CharEntityEncoderFallback.cs
- SymmetricAlgorithm.cs
- RuleSettingsCollection.cs
- SymmetricKeyWrap.cs
- GPRECTF.cs
- XmlWellformedWriter.cs
- XPathAncestorQuery.cs
- Window.cs
- DocumentPageTextView.cs
- CoreSwitches.cs
- PublisherMembershipCondition.cs
- SiteMapNodeItemEventArgs.cs
- Int32.cs
- ActivitySurrogateSelector.cs
- TextTreeExtractElementUndoUnit.cs
- Pts.cs
- XmlBinaryReaderSession.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- DrawListViewItemEventArgs.cs
- AdRotator.cs
- StringUtil.cs
- AddingNewEventArgs.cs
- TableItemStyle.cs
- DragDeltaEventArgs.cs
- NativeStructs.cs
- SmiMetaData.cs
- BamlLocalizer.cs
- EditingMode.cs
- activationcontext.cs
- CanExecuteRoutedEventArgs.cs
- DummyDataSource.cs
- SqlBuffer.cs
- CodeDelegateInvokeExpression.cs
- StringSorter.cs
- ButtonFieldBase.cs
- OdbcStatementHandle.cs
- ExceptionValidationRule.cs
- WebConvert.cs
- MatrixTransform3D.cs
- MemoryRecordBuffer.cs
- ManagementEventArgs.cs
- OdbcUtils.cs
- MemberRelationshipService.cs
- Menu.cs
- InfoCardRequestException.cs
- IisTraceListener.cs
- AliasExpr.cs
- AnnotationService.cs
- ConfigXmlCDataSection.cs
- securestring.cs
- ReadOnlyAttribute.cs
- CodeCompiler.cs
- ContentPosition.cs
- DesignerOptionService.cs
- ManipulationPivot.cs
- GeneralTransform3DCollection.cs
- QilName.cs
- DbConnectionFactory.cs
- CultureSpecificStringDictionary.cs
- HitTestParameters3D.cs
- BamlResourceSerializer.cs
- hwndwrapper.cs
- FieldTemplateUserControl.cs
- FixedSOMFixedBlock.cs
- UpdateRecord.cs
- TextRunTypographyProperties.cs
- UnSafeCharBuffer.cs