Code:
/ DotNET / DotNET / 8.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
- Timer.cs
- ToolStripContainerDesigner.cs
- InvalidCastException.cs
- SimpleWebHandlerParser.cs
- ToolStripPanelCell.cs
- ProcessManager.cs
- HMACSHA512.cs
- LinearKeyFrames.cs
- PageHandlerFactory.cs
- KerberosSecurityTokenProvider.cs
- WebBrowserBase.cs
- WebPageTraceListener.cs
- SHA384Managed.cs
- Identity.cs
- ProcessHostServerConfig.cs
- WebServiceParameterData.cs
- login.cs
- Section.cs
- BitmapEffectDrawing.cs
- ProgressiveCrcCalculatingStream.cs
- NavigationCommands.cs
- DocumentGridPage.cs
- DrawingState.cs
- BezierSegment.cs
- Visitors.cs
- ColorContextHelper.cs
- MetadataPropertyAttribute.cs
- HttpFileCollection.cs
- EncoderReplacementFallback.cs
- StateManagedCollection.cs
- QuaternionConverter.cs
- TypeInfo.cs
- ComboBox.cs
- HybridDictionary.cs
- TargetControlTypeCache.cs
- DataGridBoolColumn.cs
- RemotingConfigParser.cs
- ViewStateAttachedPropertyFeature.cs
- CodeAccessSecurityEngine.cs
- WebPartMenu.cs
- documentation.cs
- XmlSchemaValidationException.cs
- XPathNode.cs
- SynchronizingStream.cs
- EditingScopeUndoUnit.cs
- DetailsViewRowCollection.cs
- StyleBamlRecordReader.cs
- IMembershipProvider.cs
- DataGridCommandEventArgs.cs
- PeerFlooder.cs
- UnSafeCharBuffer.cs
- Section.cs
- DesignerTransaction.cs
- TextEditorDragDrop.cs
- OdbcUtils.cs
- RecordManager.cs
- ScriptingScriptResourceHandlerSection.cs
- GraphicsState.cs
- ProfessionalColors.cs
- LockCookie.cs
- SR.cs
- IsolationInterop.cs
- cache.cs
- CounterCreationDataCollection.cs
- Rect.cs
- OTFRasterizer.cs
- CommentGlyph.cs
- XamlFilter.cs
- FollowerQueueCreator.cs
- WindowVisualStateTracker.cs
- Misc.cs
- RowBinding.cs
- SessionStateSection.cs
- ConnectionsZoneAutoFormat.cs
- Int32Storage.cs
- EditingScope.cs
- XsdValidatingReader.cs
- Transform3DCollection.cs
- TemplateColumn.cs
- FamilyMapCollection.cs
- RangeContentEnumerator.cs
- ImageKeyConverter.cs
- SafeNativeMethods.cs
- ReaderWriterLockWrapper.cs
- PropertyGeneratedEventArgs.cs
- FormViewPagerRow.cs
- EncodingDataItem.cs
- Executor.cs
- HtmlTable.cs
- Collection.cs
- QilXmlReader.cs
- FormViewCommandEventArgs.cs
- XmlTextReaderImpl.cs
- IdleTimeoutMonitor.cs
- MetadataItemSerializer.cs
- RichTextBox.cs
- TypeConverterAttribute.cs
- ExtensionSimplifierMarkupObject.cs
- Size.cs
- Timer.cs