Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / Diagnostics / SwitchAttribute.cs / 1305376 / 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
- QuotedStringFormatReader.cs
- ImageUrlEditor.cs
- SymbolPair.cs
- SSmlParser.cs
- InheritanceContextChangedEventManager.cs
- XPathScanner.cs
- _NtlmClient.cs
- RadioButton.cs
- SmiTypedGetterSetter.cs
- bindurihelper.cs
- DataMemberAttribute.cs
- DataGridPageChangedEventArgs.cs
- SystemWebSectionGroup.cs
- DataGridView.cs
- StaticResourceExtension.cs
- WinFormsUtils.cs
- QueryableDataSource.cs
- HostingEnvironmentException.cs
- WebRequestModulesSection.cs
- EdmRelationshipRoleAttribute.cs
- ControlEvent.cs
- LayeredChannelListener.cs
- ThousandthOfEmRealDoubles.cs
- WebPartConnectionsDisconnectVerb.cs
- ListViewGroupItemCollection.cs
- XamlValidatingReader.cs
- EnumerableCollectionView.cs
- SafeNativeMethods.cs
- EnvironmentPermission.cs
- CollectionView.cs
- JsonWriter.cs
- ListControl.cs
- Region.cs
- Crc32Helper.cs
- SelectorItemAutomationPeer.cs
- TypeExtensions.cs
- StorageEntityContainerMapping.cs
- RequiredAttributeAttribute.cs
- CapabilitiesUse.cs
- PolyLineSegment.cs
- FixedDSBuilder.cs
- ByteFacetDescriptionElement.cs
- PageThemeCodeDomTreeGenerator.cs
- SimpleWebHandlerParser.cs
- EventSourceCreationData.cs
- CancellableEnumerable.cs
- XmlSchemaImporter.cs
- FormViewActionList.cs
- ConfigXmlElement.cs
- WindowsListViewItemStartMenu.cs
- MaskedTextBox.cs
- LocationSectionRecord.cs
- InvokePattern.cs
- FastEncoder.cs
- ScrollBar.cs
- MetadataUtil.cs
- ConsumerConnectionPoint.cs
- StylusPointPropertyId.cs
- MetaModel.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- TextElementCollectionHelper.cs
- MetafileHeader.cs
- HttpHeaderCollection.cs
- DrawingContextDrawingContextWalker.cs
- Hex.cs
- Scripts.cs
- Misc.cs
- ClockGroup.cs
- SqlGenerator.cs
- RemotingSurrogateSelector.cs
- FontStyle.cs
- X500Name.cs
- safelinkcollection.cs
- CodeMethodReturnStatement.cs
- PeerTransportListenAddressConverter.cs
- DeploymentSectionCache.cs
- WindowsMenu.cs
- UnsafeNativeMethods.cs
- DrawingImage.cs
- StylusCollection.cs
- XXXOnTypeBuilderInstantiation.cs
- IntPtr.cs
- XamlSerializer.cs
- WebBrowserUriTypeConverter.cs
- UrlMappingsSection.cs
- AcceleratedTokenProviderState.cs
- ObjectManager.cs
- HtmlToClrEventProxy.cs
- XmlSchemaComplexType.cs
- ArrayItemValue.cs
- PersonalizationStateInfoCollection.cs
- GB18030Encoding.cs
- TypefaceMap.cs
- SafeSecurityHelper.cs
- DataServiceClientException.cs
- NativeMethods.cs
- TimeEnumHelper.cs
- HtmlContainerControl.cs
- List.cs
- CopyNodeSetAction.cs