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
- RightsManagementInformation.cs
- TraceData.cs
- PolicyStatement.cs
- ForeignKeyConstraint.cs
- Lease.cs
- TextUtf8RawTextWriter.cs
- WinFormsUtils.cs
- GeometryHitTestResult.cs
- ValidatedControlConverter.cs
- ControlIdConverter.cs
- HGlobalSafeHandle.cs
- AudioFormatConverter.cs
- XpsSerializationException.cs
- TransformGroup.cs
- CellConstant.cs
- ExtensionMethods.cs
- DispatchWrapper.cs
- Normalization.cs
- DateTimeValueSerializerContext.cs
- RegionIterator.cs
- FixedTextView.cs
- Vector3dCollection.cs
- ManualResetEvent.cs
- ConfigurationElementProperty.cs
- SqlColumnizer.cs
- Stacktrace.cs
- GridEntry.cs
- XmlTypeAttribute.cs
- SchemaTypeEmitter.cs
- CellConstant.cs
- ReadOnlyHierarchicalDataSourceView.cs
- HwndAppCommandInputProvider.cs
- XmlILIndex.cs
- Utils.cs
- SqlClientWrapperSmiStreamChars.cs
- ServiceHostingEnvironmentSection.cs
- RoleManagerModule.cs
- ThaiBuddhistCalendar.cs
- DateTimeParse.cs
- PageParser.cs
- Location.cs
- SqlDataSource.cs
- UnsafeNativeMethods.cs
- _NtlmClient.cs
- NullableDecimalMinMaxAggregationOperator.cs
- FieldNameLookup.cs
- TdsRecordBufferSetter.cs
- SpecialFolderEnumConverter.cs
- DownloadProgressEventArgs.cs
- NetworkInterface.cs
- UriTemplateLiteralQueryValue.cs
- AppDomainProtocolHandler.cs
- HelpKeywordAttribute.cs
- TouchDevice.cs
- GreenMethods.cs
- Int32RectConverter.cs
- listviewsubitemcollectioneditor.cs
- BaseProcessor.cs
- ListContractAdapter.cs
- UntrustedRecipientException.cs
- FacetDescriptionElement.cs
- ParseChildrenAsPropertiesAttribute.cs
- EmptyEnumerator.cs
- Substitution.cs
- FormViewInsertEventArgs.cs
- WebCategoryAttribute.cs
- DataPagerField.cs
- BaseValidator.cs
- JavaScriptSerializer.cs
- CachedPathData.cs
- InstanceKeyCompleteException.cs
- UserNamePasswordValidator.cs
- __TransparentProxy.cs
- DataMemberFieldEditor.cs
- IncomingWebRequestContext.cs
- ModelItemDictionaryImpl.cs
- Material.cs
- InputLangChangeRequestEvent.cs
- SkewTransform.cs
- IOThreadTimer.cs
- ToolStripRendererSwitcher.cs
- ParameterEditorUserControl.cs
- ParserContext.cs
- XmlSchemaValidator.cs
- StringUtil.cs
- PageStatePersister.cs
- _LocalDataStoreMgr.cs
- KeyProperty.cs
- CharKeyFrameCollection.cs
- WindowsGraphicsCacheManager.cs
- FreeFormDesigner.cs
- BamlTreeMap.cs
- DataKey.cs
- VirtualPath.cs
- CheckBoxField.cs
- mediapermission.cs
- TimelineCollection.cs
- EventlogProvider.cs
- DataGridViewElement.cs
- TagPrefixCollection.cs