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
- Graphics.cs
- HttpTransportManager.cs
- LayoutTable.cs
- TextDpi.cs
- ReadOnlyObservableCollection.cs
- DataGridColumn.cs
- mediapermission.cs
- PersonalizationStateQuery.cs
- DeliveryStrategy.cs
- UnaryExpression.cs
- NativeMethods.cs
- ISAPIRuntime.cs
- FileSystemWatcher.cs
- DataSourceXmlAttributeAttribute.cs
- OneToOneMappingSerializer.cs
- FormViewUpdateEventArgs.cs
- FixedSOMGroup.cs
- ListManagerBindingsCollection.cs
- WsdlBuildProvider.cs
- ColorAnimationBase.cs
- UrlPath.cs
- SolidColorBrush.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DataTrigger.cs
- ExtentCqlBlock.cs
- EntityFrameworkVersions.cs
- MeasureData.cs
- SiteMembershipCondition.cs
- PropertyPath.cs
- WebPartEditorOkVerb.cs
- SmtpCommands.cs
- AssemblyUtil.cs
- NativeMethodsOther.cs
- CodeCastExpression.cs
- TransformPattern.cs
- ThicknessConverter.cs
- Action.cs
- DocumentScope.cs
- ByteKeyFrameCollection.cs
- ViewManager.cs
- SplashScreen.cs
- HiddenField.cs
- NoneExcludedImageIndexConverter.cs
- PasswordTextContainer.cs
- TextParagraphView.cs
- ProcessHostConfigUtils.cs
- M3DUtil.cs
- HMACMD5.cs
- Axis.cs
- ErrorRuntimeConfig.cs
- WebPartConnectionsCloseVerb.cs
- RawStylusInputCustomData.cs
- ComponentEditorPage.cs
- X509CertificateCollection.cs
- InternalConfigHost.cs
- HttpListenerContext.cs
- HierarchicalDataBoundControlAdapter.cs
- Root.cs
- FragmentQueryKB.cs
- ValidationErrorCollection.cs
- AudioLevelUpdatedEventArgs.cs
- StructuredTypeEmitter.cs
- UnsafeNativeMethods.cs
- DocumentViewer.cs
- DesignerProperties.cs
- IFlowDocumentViewer.cs
- ExpandSegment.cs
- NetMsmqBindingElement.cs
- LogReservationCollection.cs
- XmlUrlEditor.cs
- GZipStream.cs
- HierarchicalDataSourceIDConverter.cs
- DbException.cs
- PointConverter.cs
- RsaKeyGen.cs
- Html32TextWriter.cs
- BevelBitmapEffect.cs
- BindUriHelper.cs
- MetadataCollection.cs
- PageSettings.cs
- InvalidPrinterException.cs
- RowBinding.cs
- DataBoundControlActionList.cs
- FontStyleConverter.cs
- AttachInfo.cs
- SettingsPropertyIsReadOnlyException.cs
- ListItemCollection.cs
- _UriTypeConverter.cs
- CalendarAutomationPeer.cs
- GPStream.cs
- GetPageNumberCompletedEventArgs.cs
- SqlTypesSchemaImporter.cs
- SvcFileManager.cs
- ImpersonationContext.cs
- ValidationEventArgs.cs
- PlainXmlDeserializer.cs
- GrabHandleGlyph.cs
- BinaryFormatterWriter.cs
- LinqDataSourceDisposeEventArgs.cs
- FormClosingEvent.cs