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
- SQLDateTimeStorage.cs
- LOSFormatter.cs
- ArgumentDesigner.xaml.cs
- EntityDataSourceViewSchema.cs
- VBCodeProvider.cs
- ChannelSinkStacks.cs
- XmlDictionary.cs
- AuthenticationService.cs
- NeutralResourcesLanguageAttribute.cs
- UpdateExpressionVisitor.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DataControlField.cs
- SchemaInfo.cs
- PageBreakRecord.cs
- SimpleMailWebEventProvider.cs
- WSFederationHttpSecurityElement.cs
- RequestCache.cs
- UpdatePanelTriggerCollection.cs
- UserPersonalizationStateInfo.cs
- ZoomPercentageConverter.cs
- SplitterEvent.cs
- OleDbDataAdapter.cs
- PropertyPathConverter.cs
- QueryInterceptorAttribute.cs
- NetNamedPipeSecurity.cs
- HtmlInputFile.cs
- DirectoryNotFoundException.cs
- FilteredAttributeCollection.cs
- M3DUtil.cs
- BStrWrapper.cs
- BitArray.cs
- CaseCqlBlock.cs
- StyleCollection.cs
- MissingMemberException.cs
- AttributeProviderAttribute.cs
- ComponentEditorForm.cs
- FileSystemInfo.cs
- LinkedResourceCollection.cs
- DateTimeFormatInfo.cs
- DataKeyArray.cs
- XmlUtf8RawTextWriter.cs
- Propagator.cs
- FacetChecker.cs
- ReferencedAssembly.cs
- DataGridTableCollection.cs
- UriScheme.cs
- WbmpConverter.cs
- DataSourceHelper.cs
- StatusStrip.cs
- Util.cs
- DataSourceCacheDurationConverter.cs
- IISMapPath.cs
- SecurityCriticalDataForSet.cs
- Console.cs
- InputLanguage.cs
- HtmlEmptyTagControlBuilder.cs
- SqlGenerator.cs
- SessionStateUtil.cs
- ViewBase.cs
- SQLByteStorage.cs
- ReachFixedDocumentSerializerAsync.cs
- OleDbConnectionInternal.cs
- BindingExpressionUncommonField.cs
- HTMLTextWriter.cs
- KnownColorTable.cs
- BuildProvider.cs
- SynchronizedDisposablePool.cs
- RegexWorker.cs
- CheckBoxStandardAdapter.cs
- UrlPath.cs
- ApplicationFileParser.cs
- FormatConvertedBitmap.cs
- Vector.cs
- IISUnsafeMethods.cs
- FlagsAttribute.cs
- Translator.cs
- FunctionDescription.cs
- ResourceReferenceExpression.cs
- UIElementParaClient.cs
- FacetChecker.cs
- LookupNode.cs
- XmlHierarchicalDataSourceView.cs
- EntityParameter.cs
- TypeLoadException.cs
- ContentType.cs
- SqlComparer.cs
- InstanceCreationEditor.cs
- BaseEntityWrapper.cs
- _NegoState.cs
- EnumerableRowCollectionExtensions.cs
- MenuScrollingVisibilityConverter.cs
- GeneralTransformCollection.cs
- SqlDataSourceFilteringEventArgs.cs
- BrushValueSerializer.cs
- XpsImage.cs
- X509CertificateInitiatorServiceCredential.cs
- FormViewDeletedEventArgs.cs
- StrongTypingException.cs
- CodeArgumentReferenceExpression.cs
- ProxyWebPartConnectionCollection.cs