Code:
/ DotNET / DotNET / 8.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
- ColumnMapProcessor.cs
- HwndProxyElementProvider.cs
- StoreItemCollection.Loader.cs
- FileDetails.cs
- BaseResourcesBuildProvider.cs
- InlineObject.cs
- CodeArgumentReferenceExpression.cs
- RegexStringValidator.cs
- DataSet.cs
- tooltip.cs
- AssociatedControlConverter.cs
- MulticastDelegate.cs
- TypeElement.cs
- SerializationInfoEnumerator.cs
- EntitySetDataBindingList.cs
- EncryptedPackageFilter.cs
- Predicate.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- CompilerTypeWithParams.cs
- ListView.cs
- COM2Enum.cs
- PersonalizableAttribute.cs
- XamlReaderHelper.cs
- DeviceSpecificChoice.cs
- TreeNode.cs
- DesignerCategoryAttribute.cs
- OperationAbortedException.cs
- RoutedCommand.cs
- GenerateHelper.cs
- SoapObjectWriter.cs
- IListConverters.cs
- ChannelManager.cs
- CodeDelegateCreateExpression.cs
- ValidatorCompatibilityHelper.cs
- ArgumentNullException.cs
- QilNode.cs
- ToolStripArrowRenderEventArgs.cs
- MaterializeFromAtom.cs
- IntranetCredentialPolicy.cs
- TypeRefElement.cs
- TransportChannelFactory.cs
- HashSetEqualityComparer.cs
- TripleDESCryptoServiceProvider.cs
- ClientRuntimeConfig.cs
- _NegoState.cs
- TimeStampChecker.cs
- RawStylusSystemGestureInputReport.cs
- WorkflowStateRollbackService.cs
- COM2IDispatchConverter.cs
- ObjectManager.cs
- DebugViewWriter.cs
- UIPropertyMetadata.cs
- BitmapEffectGeneralTransform.cs
- TypeDependencyAttribute.cs
- EncryptedKeyIdentifierClause.cs
- EventSinkHelperWriter.cs
- DataPointer.cs
- CodeCommentStatement.cs
- HttpCookieCollection.cs
- ImageSourceConverter.cs
- OdbcFactory.cs
- MenuItem.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- GenericIdentity.cs
- _ConnectOverlappedAsyncResult.cs
- TransformerInfoCollection.cs
- RegexReplacement.cs
- StylusDevice.cs
- ProcessManager.cs
- COM2AboutBoxPropertyDescriptor.cs
- CookieProtection.cs
- RowToParametersTransformer.cs
- TranslateTransform.cs
- ProfileEventArgs.cs
- TimelineClockCollection.cs
- ValidatingPropertiesEventArgs.cs
- PagesSection.cs
- TraceContextEventArgs.cs
- SafeCoTaskMem.cs
- DesignerToolStripControlHost.cs
- DrawingCollection.cs
- RectAnimationBase.cs
- IndentedWriter.cs
- AuthenticationModuleElement.cs
- PropertyMappingExceptionEventArgs.cs
- ExpressionBuilder.cs
- DataContext.cs
- AttributedMetaModel.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- FormView.cs
- JsonFormatMapping.cs
- BufferModeSettings.cs
- DispatcherEventArgs.cs
- WebScriptMetadataFormatter.cs
- CalendarDateChangedEventArgs.cs
- CompiledELinqQueryState.cs
- OutputScope.cs
- WebPartVerbCollection.cs
- CompilerWrapper.cs
- SchemaImporterExtensionElement.cs