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
- Rect.cs
- PieceNameHelper.cs
- DocumentApplicationJournalEntry.cs
- ListViewDeletedEventArgs.cs
- PersonalizationStateInfoCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- EntityViewGenerator.cs
- NumberFormatInfo.cs
- GeneralTransform.cs
- UrlMappingsModule.cs
- WindowsFormsSynchronizationContext.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- UserNameSecurityTokenAuthenticator.cs
- ConfigurationManager.cs
- entityreference_tresulttype.cs
- InternalsVisibleToAttribute.cs
- DoWorkEventArgs.cs
- DependencyPropertyChangedEventArgs.cs
- DataGridViewCellValueEventArgs.cs
- GorillaCodec.cs
- ArgumentReference.cs
- DesignerTransaction.cs
- TextProperties.cs
- BindingList.cs
- EntityCommandExecutionException.cs
- ExpressionParser.cs
- GridViewColumnHeader.cs
- CompilerTypeWithParams.cs
- InternalPolicyElement.cs
- FormViewDeletedEventArgs.cs
- AutoScrollExpandMessageFilter.cs
- InvalidOleVariantTypeException.cs
- InputBinding.cs
- ErrorFormatterPage.cs
- ErrorWrapper.cs
- MessagingActivityHelper.cs
- RadioButtonPopupAdapter.cs
- sqlser.cs
- Section.cs
- XmlDataImplementation.cs
- UITypeEditor.cs
- WebPartMenu.cs
- GridViewDeletedEventArgs.cs
- Verify.cs
- IncrementalReadDecoders.cs
- TextBlock.cs
- DataTableCollection.cs
- BulletedList.cs
- QilInvokeEarlyBound.cs
- WindowsPen.cs
- ActionFrame.cs
- isolationinterop.cs
- PersonalizableAttribute.cs
- FileDialog.cs
- StreamGeometry.cs
- Latin1Encoding.cs
- TypeUtils.cs
- ArgumentException.cs
- InternalResources.cs
- CommentEmitter.cs
- PageEventArgs.cs
- MouseGesture.cs
- PipeConnection.cs
- StringKeyFrameCollection.cs
- SystemFonts.cs
- SmtpMail.cs
- GZipDecoder.cs
- PackageDigitalSignature.cs
- ApplicationFileParser.cs
- QueryOperationResponseOfT.cs
- PolicyException.cs
- DataGridViewRowCancelEventArgs.cs
- QueryCursorEventArgs.cs
- BlobPersonalizationState.cs
- DateTimeConverter2.cs
- MultipartIdentifier.cs
- StylusPointPropertyId.cs
- ListenerHandler.cs
- WeakEventTable.cs
- TimersDescriptionAttribute.cs
- FixedSOMImage.cs
- StartUpEventArgs.cs
- RuntimeConfigurationRecord.cs
- PromptEventArgs.cs
- ClientSettings.cs
- AnnotationResource.cs
- ReadOnlyTernaryTree.cs
- IntSecurity.cs
- EtwTrace.cs
- HandlerWithFactory.cs
- WindowsToolbarAsMenu.cs
- SqlSelectStatement.cs
- FontStretchConverter.cs
- RectangleGeometry.cs
- EntitySqlQueryBuilder.cs
- SR.cs
- XsltCompileContext.cs
- FormatterServices.cs
- CollectionChangeEventArgs.cs
- ChangeConflicts.cs