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
- ListMarkerSourceInfo.cs
- XPathParser.cs
- SessionSwitchEventArgs.cs
- SQLDecimalStorage.cs
- TypedReference.cs
- TrackingMemoryStreamFactory.cs
- UserControlBuildProvider.cs
- EmissiveMaterial.cs
- TimerElapsedEvenArgs.cs
- DataGridTextBox.cs
- Propagator.ExtentPlaceholderCreator.cs
- Hex.cs
- GifBitmapDecoder.cs
- FontStretches.cs
- ItemChangedEventArgs.cs
- CngUIPolicy.cs
- UpdateTranslator.cs
- WorkflowRuntimeServiceElementCollection.cs
- NotFiniteNumberException.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- cookiecollection.cs
- PropertyCondition.cs
- LinqDataSourceSelectEventArgs.cs
- SQLDouble.cs
- ToolboxBitmapAttribute.cs
- CreateUserWizard.cs
- RemoteWebConfigurationHost.cs
- GeneratedContractType.cs
- SqlClientPermission.cs
- CodeCastExpression.cs
- Utils.cs
- X509CertificateValidationMode.cs
- Border.cs
- ConsoleCancelEventArgs.cs
- LambdaCompiler.Generated.cs
- StatusBarPanelClickEvent.cs
- RelatedView.cs
- ProfileSection.cs
- ResolveNameEventArgs.cs
- RootProfilePropertySettingsCollection.cs
- MethodCallTranslator.cs
- RecordsAffectedEventArgs.cs
- SimpleBitVector32.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- OdbcConnectionPoolProviderInfo.cs
- ServiceOperation.cs
- streamingZipPartStream.cs
- ToolTip.cs
- FilteredDataSetHelper.cs
- counter.cs
- mactripleDES.cs
- SpotLight.cs
- MergeFailedEvent.cs
- DbFunctionCommandTree.cs
- OSFeature.cs
- ToolStripRenderer.cs
- WindowsSecurityTokenAuthenticator.cs
- Rotation3D.cs
- HMACSHA1.cs
- ListItemsPage.cs
- FixedSOMPage.cs
- RunInstallerAttribute.cs
- FillErrorEventArgs.cs
- ImageCodecInfoPrivate.cs
- EditingScopeUndoUnit.cs
- PermissionSetEnumerator.cs
- PolyQuadraticBezierSegment.cs
- Button.cs
- CodeSnippetCompileUnit.cs
- BaseValidatorDesigner.cs
- DataGridViewMethods.cs
- StringCollection.cs
- StructuredTypeEmitter.cs
- PropertyItem.cs
- SettingsContext.cs
- SimpleWebHandlerParser.cs
- DataContractSet.cs
- AesCryptoServiceProvider.cs
- SecurityUniqueId.cs
- ToolStripDropDownButton.cs
- SoapIncludeAttribute.cs
- SqlCachedBuffer.cs
- ExpressionConverter.cs
- DecoratedNameAttribute.cs
- ExpressionList.cs
- OdbcCommandBuilder.cs
- rsa.cs
- MobileControlBuilder.cs
- URLBuilder.cs
- ReferencedCollectionType.cs
- SqlUtil.cs
- IsolatedStorageSecurityState.cs
- MultiBinding.cs
- TextRunCache.cs
- BooleanStorage.cs
- WebPartZoneBase.cs
- BindingValueChangedEventArgs.cs
- LogReservationCollection.cs
- SqlProcedureAttribute.cs
- ZipIOCentralDirectoryDigitalSignature.cs