Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- storepermission.cs
- RuntimeWrappedException.cs
- PathFigureCollection.cs
- ListViewHitTestInfo.cs
- SurrogateSelector.cs
- MobileListItem.cs
- HatchBrush.cs
- FormViewCommandEventArgs.cs
- OpCellTreeNode.cs
- EventHandlersDesigner.cs
- Menu.cs
- PowerModeChangedEventArgs.cs
- HebrewNumber.cs
- DataSourceListEditor.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- MD5CryptoServiceProvider.cs
- ChannelServices.cs
- PolygonHotSpot.cs
- Renderer.cs
- NumericExpr.cs
- UIElement3DAutomationPeer.cs
- SvcMapFileLoader.cs
- DESCryptoServiceProvider.cs
- VectorKeyFrameCollection.cs
- DragDrop.cs
- DockPanel.cs
- EdmError.cs
- JsonCollectionDataContract.cs
- DebugInfoGenerator.cs
- PropertyGridView.cs
- DataGridCaption.cs
- SortFieldComparer.cs
- AuthorizationRuleCollection.cs
- CompareValidator.cs
- DataGridViewRowEventArgs.cs
- ObjectListDesigner.cs
- MultipartContentParser.cs
- MembershipUser.cs
- SoapReflectionImporter.cs
- HttpWebRequest.cs
- TreeViewImageGenerator.cs
- NullableBoolConverter.cs
- DataKeyCollection.cs
- UxThemeWrapper.cs
- SelectedPathEditor.cs
- PerfCounterSection.cs
- IDQuery.cs
- UInt32Storage.cs
- HttpModuleAction.cs
- DataTableExtensions.cs
- ClientUIRequest.cs
- ByteStorage.cs
- XmlAttribute.cs
- WizardStepCollectionEditor.cs
- TimelineGroup.cs
- TraceUtils.cs
- FormsAuthenticationTicket.cs
- SecurityManager.cs
- SessionEndingCancelEventArgs.cs
- WSDualHttpBindingCollectionElement.cs
- ControlCachePolicy.cs
- IndexerReference.cs
- XamlClipboardData.cs
- TemplateKeyConverter.cs
- TextContainerChangeEventArgs.cs
- CheckBox.cs
- NetworkCredential.cs
- PermissionAttributes.cs
- _Semaphore.cs
- ResourceCategoryAttribute.cs
- LinqDataSource.cs
- ComponentEvent.cs
- TargetControlTypeCache.cs
- QilPatternFactory.cs
- ContainerFilterService.cs
- WindowsGraphicsCacheManager.cs
- TrimSurroundingWhitespaceAttribute.cs
- NegationPusher.cs
- MD5HashHelper.cs
- Registry.cs
- ProtocolsConfiguration.cs
- ZoneIdentityPermission.cs
- RootBrowserWindow.cs
- ACE.cs
- BindingMemberInfo.cs
- _ProxyRegBlob.cs
- ProtectedConfigurationSection.cs
- TdsEnums.cs
- FormView.cs
- ActivityValidator.cs
- WebCategoryAttribute.cs
- OdbcEnvironment.cs
- AuthenticatedStream.cs
- TdsParserSessionPool.cs
- SqlException.cs
- ConfigurationPropertyAttribute.cs
- SubclassTypeValidatorAttribute.cs
- TableCellCollection.cs
- BrowserCapabilitiesCodeGenerator.cs
- BasePropertyDescriptor.cs