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
- ResolveResponse.cs
- PropertyCollection.cs
- PointLight.cs
- URIFormatException.cs
- ShutDownListener.cs
- XmlSchemaValidationException.cs
- GridViewRowPresenter.cs
- ProcessHostFactoryHelper.cs
- EventToken.cs
- controlskin.cs
- StrokeNodeOperations.cs
- WebBrowserEvent.cs
- BooleanFunctions.cs
- PointF.cs
- ImageListImageEditor.cs
- FaultContractInfo.cs
- WebBrowsableAttribute.cs
- Thickness.cs
- ActivityMarkupSerializationProvider.cs
- PrintDocument.cs
- AppSettingsReader.cs
- Calendar.cs
- SchemaExporter.cs
- DependencyPropertyKey.cs
- XamlReaderHelper.cs
- HttpListener.cs
- SoapElementAttribute.cs
- SizeFConverter.cs
- SymbolTable.cs
- Empty.cs
- MsmqInputChannelBase.cs
- DocumentPage.cs
- DetailsViewModeEventArgs.cs
- FlowDocument.cs
- RegexWorker.cs
- AsymmetricAlgorithm.cs
- XmlCharacterData.cs
- PerformanceCounterCategory.cs
- TemplateLookupAction.cs
- MethodAccessException.cs
- RayMeshGeometry3DHitTestResult.cs
- TreeNodeStyle.cs
- TransactionScope.cs
- DesignerValidatorAdapter.cs
- Rotation3D.cs
- WebPartDisplayMode.cs
- SqlUserDefinedTypeAttribute.cs
- HTMLTagNameToTypeMapper.cs
- UnsafeNativeMethodsTablet.cs
- ListManagerBindingsCollection.cs
- TokenBasedSetEnumerator.cs
- PageAsyncTask.cs
- VisualTreeUtils.cs
- ExtendedProperty.cs
- XsltArgumentList.cs
- AutoCompleteStringCollection.cs
- IndentTextWriter.cs
- WindowsStreamSecurityBindingElement.cs
- WindowsListViewGroupHelper.cs
- DoubleCollectionValueSerializer.cs
- Permission.cs
- TabControl.cs
- EntityDataSourceViewSchema.cs
- Int32RectValueSerializer.cs
- XPathNodeList.cs
- WebPartCatalogAddVerb.cs
- Transform3DGroup.cs
- CompilerScopeManager.cs
- DataBinder.cs
- ToolBarButtonClickEvent.cs
- DbBuffer.cs
- DeploymentExceptionMapper.cs
- Reference.cs
- GlyphRunDrawing.cs
- HtmlListAdapter.cs
- LoaderAllocator.cs
- CharacterBuffer.cs
- StylusPointProperties.cs
- HtmlProps.cs
- DataBoundLiteralControl.cs
- CharStorage.cs
- SessionIDManager.cs
- DateRangeEvent.cs
- PageWrapper.cs
- HiddenFieldPageStatePersister.cs
- NavigationProgressEventArgs.cs
- Inline.cs
- PageContent.cs
- CompensateDesigner.cs
- QilExpression.cs
- webproxy.cs
- FileSystemWatcher.cs
- PipelineModuleStepContainer.cs
- EventListenerClientSide.cs
- CustomAttribute.cs
- JoinCqlBlock.cs
- EmptyReadOnlyDictionaryInternal.cs
- NumericUpDownAccelerationCollection.cs
- XamlTypeMapper.cs
- ValidationErrorCollection.cs