Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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// 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
- ElementProxy.cs
- Attributes.cs
- Publisher.cs
- HtmlListAdapter.cs
- ThreadAttributes.cs
- PointHitTestResult.cs
- BitSet.cs
- MetaTable.cs
- SecUtil.cs
- SymbolTable.cs
- PropertyPushdownHelper.cs
- COM2ICategorizePropertiesHandler.cs
- KeysConverter.cs
- ConfigurationManagerInternalFactory.cs
- CheckBox.cs
- OneOfElement.cs
- ToolStripDropTargetManager.cs
- LocalizableAttribute.cs
- DrawListViewSubItemEventArgs.cs
- DebugView.cs
- NativeRecognizer.cs
- XXXInfos.cs
- HelloMessage11.cs
- DataGridViewSortCompareEventArgs.cs
- ScrollEvent.cs
- ObjectManager.cs
- AssemblyCache.cs
- TextTreeFixupNode.cs
- QilTernary.cs
- SafeNativeMethods.cs
- TraceUtils.cs
- OperationCanceledException.cs
- LogEntrySerialization.cs
- DragCompletedEventArgs.cs
- StrokeDescriptor.cs
- JobDuplex.cs
- ProtectedConfigurationSection.cs
- MdImport.cs
- SymDocumentType.cs
- Thumb.cs
- ZipIOExtraFieldElement.cs
- DispatcherHooks.cs
- DataGridViewTextBoxColumn.cs
- UdpTransportSettings.cs
- DataTablePropertyDescriptor.cs
- ScriptManagerProxy.cs
- ServiceOperationHelpers.cs
- SafeCancelMibChangeNotify.cs
- WindowsEditBox.cs
- StaticSiteMapProvider.cs
- MessageProperties.cs
- TokenBasedSet.cs
- Stylesheet.cs
- EntityObject.cs
- QueueProcessor.cs
- FrameworkContentElement.cs
- DelegatingHeader.cs
- MetadataArtifactLoaderCompositeFile.cs
- HebrewNumber.cs
- Wildcard.cs
- SQLInt16.cs
- COMException.cs
- KerberosSecurityTokenAuthenticator.cs
- DbConnectionHelper.cs
- BaseResourcesBuildProvider.cs
- GlyphCache.cs
- SQLGuid.cs
- EdmScalarPropertyAttribute.cs
- WrapPanel.cs
- RectAnimationBase.cs
- ScrollContentPresenter.cs
- XamlBrushSerializer.cs
- FontEditor.cs
- ResourceExpression.cs
- ButtonChrome.cs
- ParserOptions.cs
- CustomCategoryAttribute.cs
- JsonEncodingStreamWrapper.cs
- FieldToken.cs
- ResolveMatchesMessageCD1.cs
- QilSortKey.cs
- XmlJsonReader.cs
- CustomError.cs
- DirectoryObjectSecurity.cs
- Dictionary.cs
- BamlBinaryReader.cs
- SmiSettersStream.cs
- FamilyCollection.cs
- WindowsTab.cs
- PtsHost.cs
- StylusButtonCollection.cs
- altserialization.cs
- MediaElement.cs
- CertificateReferenceElement.cs
- ConnectionManagementElementCollection.cs
- GetWinFXPath.cs
- ZipIOExtraFieldElement.cs
- XamlValidatingReader.cs
- SubqueryRules.cs
- GenericWebPart.cs