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
- BulletDecorator.cs
- WSSecureConversation.cs
- AdornerDecorator.cs
- TickBar.cs
- HttpContextWrapper.cs
- MaterialCollection.cs
- EditorZoneBase.cs
- SizeAnimation.cs
- DataContractSerializerElement.cs
- HostExecutionContextManager.cs
- SingleStorage.cs
- DbException.cs
- DesignTimeParseData.cs
- DesignerSerializationOptionsAttribute.cs
- ToolboxBitmapAttribute.cs
- AQNBuilder.cs
- ToolStrip.cs
- CharacterMetrics.cs
- HttpApplication.cs
- UnsafeNativeMethodsPenimc.cs
- TdsParserStaticMethods.cs
- SessionChannels.cs
- ChannelSinkStacks.cs
- PointAnimationUsingKeyFrames.cs
- XmlElementAttributes.cs
- DecimalStorage.cs
- ScriptReference.cs
- StreamingContext.cs
- CellConstantDomain.cs
- AmbiguousMatchException.cs
- DrawingCollection.cs
- Wrapper.cs
- SymLanguageVendor.cs
- UnsafeNativeMethods.cs
- LabelAutomationPeer.cs
- OleAutBinder.cs
- DocumentViewerAutomationPeer.cs
- ProvidePropertyAttribute.cs
- DataGridViewEditingControlShowingEventArgs.cs
- Missing.cs
- TextElementEnumerator.cs
- ValueUnavailableException.cs
- InputReportEventArgs.cs
- ComponentCollection.cs
- BlurBitmapEffect.cs
- Volatile.cs
- XmlSyndicationContent.cs
- PersonalizationState.cs
- CustomTypeDescriptor.cs
- XNameConverter.cs
- BStrWrapper.cs
- GenerateTemporaryTargetAssembly.cs
- SoapSchemaExporter.cs
- Behavior.cs
- Query.cs
- TypeElement.cs
- RepeaterCommandEventArgs.cs
- WpfSharedXamlSchemaContext.cs
- SymmetricAlgorithm.cs
- StaticTextPointer.cs
- CurrentChangingEventArgs.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- EventManager.cs
- SrgsNameValueTag.cs
- Int32KeyFrameCollection.cs
- TextParagraphView.cs
- BooleanAnimationUsingKeyFrames.cs
- ParameterToken.cs
- Errors.cs
- NamedPermissionSet.cs
- Parameter.cs
- UTF8Encoding.cs
- DataGridPageChangedEventArgs.cs
- HtmlDocument.cs
- SymLanguageType.cs
- DataSetMappper.cs
- BadImageFormatException.cs
- SafeHandles.cs
- DirectionalLight.cs
- Brush.cs
- AppSettingsReader.cs
- ScriptResourceHandler.cs
- BindableTemplateBuilder.cs
- WebResourceAttribute.cs
- ArglessEventHandlerProxy.cs
- ClientConvert.cs
- ToolboxComponentsCreatedEventArgs.cs
- ObjectPersistData.cs
- PerformanceCounter.cs
- UdpDiscoveryEndpointElement.cs
- LinkUtilities.cs
- LiteralTextParser.cs
- SchemaTypeEmitter.cs
- InstalledVoice.cs
- HtmlEmptyTagControlBuilder.cs
- SchemaName.cs
- ConfigurationManagerInternalFactory.cs
- InputMethodStateTypeInfo.cs
- MetabaseSettings.cs
- DataBindingCollection.cs