Code:
/ FX-1434 / FX-1434 / 1.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
- PtsHost.cs
- ZipIOCentralDirectoryBlock.cs
- ConversionHelper.cs
- SecurityException.cs
- NativeRecognizer.cs
- RuntimeConfigLKG.cs
- DataServices.cs
- XmlIlTypeHelper.cs
- ScaleTransform3D.cs
- SystemGatewayIPAddressInformation.cs
- ValidationService.cs
- CLSCompliantAttribute.cs
- DrawingState.cs
- SmiContextFactory.cs
- XomlCompilerParameters.cs
- ImageDrawing.cs
- BamlRecordHelper.cs
- BuildProviderAppliesToAttribute.cs
- CollectionViewGroupRoot.cs
- WaitForChangedResult.cs
- DeadCharTextComposition.cs
- BasicAsyncResult.cs
- CodeTypeReference.cs
- TextContainerChangeEventArgs.cs
- DbSource.cs
- Transform.cs
- MatrixTransform3D.cs
- NativeRightsManagementAPIsStructures.cs
- ListDataBindEventArgs.cs
- ImageMap.cs
- InteropAutomationProvider.cs
- DoubleCollectionConverter.cs
- QilLoop.cs
- NetworkAddressChange.cs
- TypeForwardedToAttribute.cs
- PropertyItemInternal.cs
- AssociationSetEnd.cs
- ACL.cs
- DiscoveryDocument.cs
- UserInitiatedNavigationPermission.cs
- EventLogTraceListener.cs
- MyContact.cs
- DrawListViewColumnHeaderEventArgs.cs
- ReferenceConverter.cs
- ReadWriteSpinLock.cs
- SerializationEventsCache.cs
- Mutex.cs
- MemberAssignment.cs
- GPRECT.cs
- WindowsFormsHostAutomationPeer.cs
- HighlightVisual.cs
- HeaderedItemsControl.cs
- SimpleHandlerBuildProvider.cs
- ContainerParagraph.cs
- BaseCollection.cs
- CharacterString.cs
- PeerName.cs
- ValidationErrorEventArgs.cs
- TextComposition.cs
- Classification.cs
- ConstantCheck.cs
- Types.cs
- PeerCredential.cs
- AuthenticationManager.cs
- BasicAsyncResult.cs
- ManagementEventArgs.cs
- SqlConnectionHelper.cs
- ImageSource.cs
- QuerySubExprEliminator.cs
- DataGridToolTip.cs
- Image.cs
- InputReferenceExpression.cs
- FontStretchConverter.cs
- ControlCollection.cs
- XmlTextReaderImpl.cs
- ConnectionPool.cs
- EdmItemError.cs
- MessageQueue.cs
- RoleManagerEventArgs.cs
- ContainerVisual.cs
- ClientUtils.cs
- ClaimComparer.cs
- StackOverflowException.cs
- CachedBitmap.cs
- XNodeValidator.cs
- IItemProperties.cs
- CoTaskMemSafeHandle.cs
- ContentDisposition.cs
- StringBlob.cs
- HMACSHA256.cs
- XPathConvert.cs
- OracleDateTime.cs
- LogRecordSequence.cs
- SoapEnumAttribute.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- FamilyTypeface.cs
- HttpRuntime.cs
- Converter.cs
- SessionParameter.cs
- WhereaboutsReader.cs