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
- RedirectionProxy.cs
- IgnoreFileBuildProvider.cs
- hwndwrapper.cs
- DeferredTextReference.cs
- ScrollChrome.cs
- KnownBoxes.cs
- GeometryDrawing.cs
- FastPropertyAccessor.cs
- BitmapMetadata.cs
- ExtendedPropertiesHandler.cs
- ProfilePropertyMetadata.cs
- RtType.cs
- MetaChildrenColumn.cs
- ObjectRef.cs
- GeneralTransform3D.cs
- ReversePositionQuery.cs
- FlowLayout.cs
- Single.cs
- UriSectionReader.cs
- CacheOutputQuery.cs
- CustomErrorCollection.cs
- InputEventArgs.cs
- ScrollProviderWrapper.cs
- DelegateSerializationHolder.cs
- RewritingPass.cs
- FieldToken.cs
- SqlCacheDependency.cs
- TemplateParser.cs
- ChangesetResponse.cs
- SecureStringHasher.cs
- SerializationAttributes.cs
- XmlSchemaInfo.cs
- RenamedEventArgs.cs
- ActivityExecutorOperation.cs
- _PooledStream.cs
- SerializableAttribute.cs
- OracleDateTime.cs
- ListViewEditEventArgs.cs
- MonitorWrapper.cs
- Pen.cs
- DeferredBinaryDeserializerExtension.cs
- RecordsAffectedEventArgs.cs
- SamlConstants.cs
- HtmlImage.cs
- RequestQueue.cs
- DataSourceViewSchemaConverter.cs
- mactripleDES.cs
- String.cs
- ProfileModule.cs
- Latin1Encoding.cs
- ToolboxCategoryItems.cs
- TextElementEnumerator.cs
- QueryRewriter.cs
- DataControlFieldsEditor.cs
- ScrollData.cs
- SequenceDesigner.xaml.cs
- UnmanagedBitmapWrapper.cs
- ValidationSummary.cs
- DATA_BLOB.cs
- UnsafeNativeMethods.cs
- PaperSize.cs
- XmlSchemas.cs
- _ListenerAsyncResult.cs
- ExportOptions.cs
- BaseCollection.cs
- Matrix3D.cs
- DynamicQueryableWrapper.cs
- RotateTransform.cs
- DoWorkEventArgs.cs
- HandlerFactoryWrapper.cs
- DeliveryRequirementsAttribute.cs
- RepeatEnumerable.cs
- Attributes.cs
- ProxySimple.cs
- ValueTypeFixupInfo.cs
- ContextMenu.cs
- FontFaceLayoutInfo.cs
- TrackingStringDictionary.cs
- RelatedView.cs
- StyleXamlTreeBuilder.cs
- KeyPressEvent.cs
- WindowsEditBox.cs
- SynthesizerStateChangedEventArgs.cs
- ConnectionsZoneAutoFormat.cs
- CodeTypeDelegate.cs
- EntitySqlQueryState.cs
- ExpandedWrapper.cs
- EndpointInfo.cs
- JapaneseLunisolarCalendar.cs
- TableSectionStyle.cs
- TabPanel.cs
- ResXResourceReader.cs
- XsdCachingReader.cs
- TextServicesHost.cs
- FormViewInsertEventArgs.cs
- SubMenuStyle.cs
- PersianCalendar.cs
- DesignerActionTextItem.cs
- XmlParserContext.cs
- BindableAttribute.cs