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
- COM2ComponentEditor.cs
- WaitForChangedResult.cs
- TextTreeInsertUndoUnit.cs
- Empty.cs
- ObjectIDGenerator.cs
- FontSizeConverter.cs
- ProfilePropertyNameValidator.cs
- FontStretch.cs
- BStrWrapper.cs
- DataTableMappingCollection.cs
- DPTypeDescriptorContext.cs
- SerializationFieldInfo.cs
- PackageRelationshipCollection.cs
- Clause.cs
- DependencyPropertyKey.cs
- DirtyTextRange.cs
- ApplicationProxyInternal.cs
- Menu.cs
- ReaderWriterLock.cs
- CellPartitioner.cs
- SchemaSetCompiler.cs
- EdmSchemaAttribute.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TextBox.cs
- Shared.cs
- SystemIPv6InterfaceProperties.cs
- XmlSchemaComplexType.cs
- XPathSingletonIterator.cs
- ServiceHttpModule.cs
- httpapplicationstate.cs
- LinkLabel.cs
- SystemInformation.cs
- NavigationCommands.cs
- GridEntry.cs
- EnumValidator.cs
- UserControlCodeDomTreeGenerator.cs
- PixelFormatConverter.cs
- DataIdProcessor.cs
- CompositeDuplexElement.cs
- DBConnection.cs
- StrokeCollection2.cs
- MouseOverProperty.cs
- XhtmlTextWriter.cs
- PropertyTab.cs
- PointHitTestResult.cs
- ClickablePoint.cs
- StaticResourceExtension.cs
- TextTreeFixupNode.cs
- ToolStripOverflowButton.cs
- CodeSnippetExpression.cs
- HttpProfileBase.cs
- RotateTransform.cs
- QueryLifecycle.cs
- MeasureItemEvent.cs
- TextOutput.cs
- CompilerCollection.cs
- UrlPath.cs
- UInt64Storage.cs
- SectionXmlInfo.cs
- Window.cs
- CodeDOMUtility.cs
- DesignerOptions.cs
- ClientRolePrincipal.cs
- TerminateDesigner.cs
- PathSegmentCollection.cs
- URIFormatException.cs
- DefaultCommandConverter.cs
- GenericArgumentsUpdater.cs
- AspCompat.cs
- ListViewDesigner.cs
- WebPartManagerInternals.cs
- TableHeaderCell.cs
- TemporaryBitmapFile.cs
- ObfuscationAttribute.cs
- InputBindingCollection.cs
- ThreadExceptionEvent.cs
- DetailsViewDeleteEventArgs.cs
- BinaryReader.cs
- Schema.cs
- SHA1Managed.cs
- EntityCollection.cs
- Match.cs
- UriWriter.cs
- TrustManagerPromptUI.cs
- AutoSizeComboBox.cs
- GroupStyle.cs
- ActivityDesignerResources.cs
- FontWeights.cs
- XmlSchemaAny.cs
- _ChunkParse.cs
- Transaction.cs
- JavaScriptObjectDeserializer.cs
- NativeBuffer.cs
- RightsManagementInformation.cs
- EntitySqlQueryBuilder.cs
- GroupLabel.cs
- SettingsSection.cs
- AlphabeticalEnumConverter.cs
- ThreadStaticAttribute.cs
- FileSystemEventArgs.cs