Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / Design / PropertyTabAttribute.cs / 1 / PropertyTabAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- // SECREVIEW: Remove this attribute once bug#411903 is fixed. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope="member", Target="System.ComponentModel.PropertyTabAttribute.get_TabClasses():System.Type[]")] namespace System.ComponentModel { using System; using System.ComponentModel; using System.Reflection; using System.Security.Permissions; ////// [AttributeUsage(AttributeTargets.All)] public class PropertyTabAttribute : Attribute { private PropertyTabScope[] tabScopes; private Type[] tabClasses; private string[] tabClassNames; ///Identifies the property tab or tabs that should be displayed for the /// specified class or classes. ////// public PropertyTabAttribute() { tabScopes = new PropertyTabScope[0]; tabClassNames = new string[0]; } ////// Basic constructor that creates a PropertyTabAttribute. Use this ctor to derive from this /// attribute and specify multiple tab types by calling InitializeArrays. /// ////// public PropertyTabAttribute(Type tabClass) : this(tabClass, PropertyTabScope.Component) { } ////// Basic constructor that creates a property tab attribute that will create a tab /// of the specified type. /// ////// public PropertyTabAttribute(string tabClassName) : this(tabClassName, PropertyTabScope.Component) { } ////// Basic constructor that creates a property tab attribute that will create a tab /// of the specified type. /// ////// public PropertyTabAttribute(Type tabClass, PropertyTabScope tabScope) { this.tabClasses = new Type[]{ tabClass}; if (tabScope < PropertyTabScope.Document) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeBadPropertyTabScope), "tabScope"); } this.tabScopes = new PropertyTabScope[]{tabScope}; } ////// Basic constructor that creates a property tab attribute that will create a tab /// of the specified type. /// ////// public PropertyTabAttribute(string tabClassName, PropertyTabScope tabScope) { this.tabClassNames = new string[]{ tabClassName}; if (tabScope < PropertyTabScope.Document) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeBadPropertyTabScope), "tabScope"); } this.tabScopes = new PropertyTabScope[]{tabScope}; } ////// Basic constructor that creates a property tab attribute that will create a tab /// of the specified type. /// ////// public Type[] TabClasses { get { if (tabClasses == null && tabClassNames != null) { tabClasses = new Type[tabClassNames.Length]; for (int i=0; iGets the types of tab that this attribute specifies. ////// [To be supplied.] /// protected string[] TabClassNames{ get { if (tabClassNames != null) { return (string[])tabClassNames.Clone(); } else { return null; } } } ////// public PropertyTabScope[] TabScopes { get { return tabScopes; } } ///Gets the scopes of tabs for this System.ComponentModel.Design.PropertyTabAttribute, from System.ComponentModel.Design.PropertyTabScope. ///public override bool Equals(object other) { if (other is PropertyTabAttribute) { return Equals((PropertyTabAttribute)other); } return false; } /// public bool Equals(PropertyTabAttribute other) { if (other == (object)this) { return true; } if (other.TabClasses.Length != TabClasses.Length || other.TabScopes.Length != TabScopes.Length) { return false; } for (int i = 0; i < TabClasses.Length; i++) { if (TabClasses[i] != other.TabClasses[i] || TabScopes[i] != other.TabScopes[i]) { return false; } } return true; } /// /// public override int GetHashCode() { return base.GetHashCode(); } ////// Returns the hashcode for this object. /// ////// protected void InitializeArrays(string[] tabClassNames, PropertyTabScope[] tabScopes) { InitializeArrays(tabClassNames, null, tabScopes); } ////// Utiliity function to set the types of tab classes this PropertyTabAttribute specifies. /// ////// protected void InitializeArrays(Type[] tabClasses, PropertyTabScope[] tabScopes) { InitializeArrays(null, tabClasses, tabScopes); } private void InitializeArrays(string[] tabClassNames, Type[] tabClasses, PropertyTabScope[] tabScopes) { if (tabClasses != null) { if (tabScopes != null && tabClasses.Length != tabScopes.Length) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeArrayLengthMismatch)); } this.tabClasses = (Type[])tabClasses.Clone(); } else if (tabClassNames != null) { if (tabScopes != null && tabClasses.Length != tabScopes.Length) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeArrayLengthMismatch)); } this.tabClassNames = (string[])tabClassNames.Clone(); this.tabClasses = null; } else if (this.tabClasses == null && this.tabClassNames == null) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeParamsBothNull)); } if (tabScopes != null) { for (int i = 0; i < tabScopes.Length; i++) { if (tabScopes[i] < PropertyTabScope.Document) { throw new ArgumentException(SR.GetString(SR.PropertyTabAttributeBadPropertyTabScope)); } } this.tabScopes = (PropertyTabScope[])tabScopes.Clone(); } else { this.tabScopes = new PropertyTabScope[tabClasses.Length]; for (int i = 0; i < TabScopes.Length; i++) { this.tabScopes[i] = PropertyTabScope.Component; } } } } }/// Utiliity function to set the types of tab classes this PropertyTabAttribute specifies. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextMenuService.cs
- Int32Animation.cs
- GridLengthConverter.cs
- Message.cs
- WebConfigurationFileMap.cs
- BookmarkResumptionRecord.cs
- NamespaceList.cs
- FixedLineResult.cs
- Point3DAnimation.cs
- NavigationWindowAutomationPeer.cs
- Input.cs
- RichTextBoxConstants.cs
- DataSourceXmlSubItemAttribute.cs
- StatusBar.cs
- ImageBrush.cs
- SplineKeyFrames.cs
- SizeAnimationClockResource.cs
- FileDialog.cs
- CompositeActivityMarkupSerializer.cs
- RealizationDrawingContextWalker.cs
- PerfCounterSection.cs
- SinglePageViewer.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- updatecommandorderer.cs
- MdImport.cs
- IgnoreFlushAndCloseStream.cs
- DispatchChannelSink.cs
- Utilities.cs
- RowVisual.cs
- TypeElement.cs
- Authorization.cs
- SslStream.cs
- SplineQuaternionKeyFrame.cs
- CorrelationService.cs
- SchemaImporter.cs
- ThreadExceptionDialog.cs
- DesignSurface.cs
- AnimatedTypeHelpers.cs
- MergeFilterQuery.cs
- SoapReflectionImporter.cs
- _FixedSizeReader.cs
- ProviderUtil.cs
- sqlcontext.cs
- DefaultTextStoreTextComposition.cs
- HTTPNotFoundHandler.cs
- InplaceBitmapMetadataWriter.cs
- RuntimeConfig.cs
- ChannelSinkStacks.cs
- KeyConstraint.cs
- EndpointAddress10.cs
- QEncodedStream.cs
- Mouse.cs
- XmlQueryOutput.cs
- RootProjectionNode.cs
- ApplicationInterop.cs
- EntityDataSourceWrapperCollection.cs
- ProviderManager.cs
- PagerSettings.cs
- GraphicsState.cs
- SystemIcmpV4Statistics.cs
- BaseTemplateParser.cs
- ServiceReference.cs
- CodeDOMUtility.cs
- AsynchronousChannel.cs
- OperationAbortedException.cs
- PropertyCollection.cs
- X509Extension.cs
- ElementMarkupObject.cs
- Privilege.cs
- ScalarType.cs
- HttpCapabilitiesBase.cs
- HierarchicalDataSourceControl.cs
- SessionStateItemCollection.cs
- VirtualDirectoryMapping.cs
- SoapInteropTypes.cs
- HttpListenerContext.cs
- Int32Storage.cs
- DelegatedStream.cs
- RotateTransform.cs
- StringComparer.cs
- FixedDocument.cs
- TabItemAutomationPeer.cs
- Expressions.cs
- APCustomTypeDescriptor.cs
- DataGridViewDataErrorEventArgs.cs
- SerializerDescriptor.cs
- HtmlObjectListAdapter.cs
- dataSvcMapFileLoader.cs
- ContainerParaClient.cs
- EntityContainerEntitySet.cs
- validationstate.cs
- TextLineBreak.cs
- Int32.cs
- EndpointDispatcher.cs
- SiteMapPath.cs
- FixedStringLookup.cs
- FtpWebRequest.cs
- RC2CryptoServiceProvider.cs
- SafeEventLogWriteHandle.cs
- ValidationResult.cs