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
- WmlImageAdapter.cs
- ConfigXmlElement.cs
- GroupItem.cs
- StdValidatorsAndConverters.cs
- DesignerOptionService.cs
- IriParsingElement.cs
- ResetableIterator.cs
- LinqDataSourceInsertEventArgs.cs
- LinqDataSourceView.cs
- WebServiceResponse.cs
- HScrollProperties.cs
- RegisteredHiddenField.cs
- Options.cs
- LineGeometry.cs
- XmlSchemaComplexContent.cs
- XmlProcessingInstruction.cs
- SafeTokenHandle.cs
- HttpRequestCacheValidator.cs
- MetadataPropertyAttribute.cs
- PropertyGridEditorPart.cs
- MsmqBindingMonitor.cs
- StylusCollection.cs
- CodeExporter.cs
- sqlcontext.cs
- SqlComparer.cs
- MethodBuilder.cs
- UInt16Storage.cs
- Substitution.cs
- ContextBase.cs
- CultureTableRecord.cs
- ProfileParameter.cs
- PersonalizationProviderHelper.cs
- Dump.cs
- RepeaterItemEventArgs.cs
- QilReplaceVisitor.cs
- SpecialFolderEnumConverter.cs
- XmlIgnoreAttribute.cs
- DependencyObjectPropertyDescriptor.cs
- TemplateBamlTreeBuilder.cs
- CultureInfoConverter.cs
- Dynamic.cs
- Int64.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- Span.cs
- DockPattern.cs
- TickBar.cs
- PingReply.cs
- SortFieldComparer.cs
- NativeCppClassAttribute.cs
- LinkedResourceCollection.cs
- InteropAutomationProvider.cs
- BlockCollection.cs
- ItemType.cs
- HttpConfigurationContext.cs
- BitmapFrame.cs
- Number.cs
- ServiceObjectContainer.cs
- ChtmlLinkAdapter.cs
- CultureTableRecord.cs
- WorkflowInstance.cs
- KnowledgeBase.cs
- WithParamAction.cs
- Int16AnimationBase.cs
- CompositeDataBoundControl.cs
- BindingsCollection.cs
- TreeIterators.cs
- ToolStripCustomTypeDescriptor.cs
- DbDataSourceEnumerator.cs
- WpfKnownType.cs
- SimpleApplicationHost.cs
- ExpressionBuilder.cs
- HttpBindingExtension.cs
- WindowsFormsHostPropertyMap.cs
- CodePageUtils.cs
- XmlNullResolver.cs
- OleDbStruct.cs
- XmlSchemaSubstitutionGroup.cs
- TreeNode.cs
- VisualTreeUtils.cs
- ColumnClickEvent.cs
- XmlDataDocument.cs
- ByteStack.cs
- EntryPointNotFoundException.cs
- CodeSnippetStatement.cs
- InputLanguageEventArgs.cs
- LongSumAggregationOperator.cs
- AttributeQuery.cs
- LineGeometry.cs
- TextEditorMouse.cs
- CollectionDataContractAttribute.cs
- ClusterSafeNativeMethods.cs
- EmptyCollection.cs
- OperationInfoBase.cs
- ErrorEventArgs.cs
- VisualCollection.cs
- SkipQueryOptionExpression.cs
- SystemColors.cs
- ErasingStroke.cs
- DriveInfo.cs
- DecimalConverter.cs