Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / Design / PropertyTabAttribute.cs / 1305376 / 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;
///
/// Identifies the property tab or tabs that should be displayed for the
/// specified class or classes.
///
[AttributeUsage(AttributeTargets.All)]
public class PropertyTabAttribute : Attribute {
private PropertyTabScope[] tabScopes;
private Type[] tabClasses;
private string[] tabClassNames;
///
///
/// Basic constructor that creates a PropertyTabAttribute. Use this ctor to derive from this
/// attribute and specify multiple tab types by calling InitializeArrays.
///
///
public PropertyTabAttribute() {
tabScopes = new PropertyTabScope[0];
tabClassNames = new string[0];
}
///
///
/// Basic constructor that creates a property tab attribute that will create a tab
/// of the specified type.
///
///
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};
}
///
/// Gets the types of tab that this attribute specifies.
///
public Type[] TabClasses {
get {
if (tabClasses == null && tabClassNames != null) {
tabClasses = new Type[tabClassNames.Length];
for (int i=0; i
/// [To be supplied.]
///
protected string[] TabClassNames{
get {
if (tabClassNames != null) {
return (string[])tabClassNames.Clone();
}
else {
return null;
}
}
}
///
/// Gets the scopes of tabs for this System.ComponentModel.Design.PropertyTabAttribute, from System.ComponentModel.Design.PropertyTabScope.
///
public PropertyTabScope[] TabScopes {
get {
return tabScopes;
}
}
///
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;
}
///
///
/// Returns the hashcode for this object.
///
///
public override int GetHashCode() {
return base.GetHashCode();
}
///
///
/// Utiliity function to set the types of tab classes this PropertyTabAttribute specifies.
///
///
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;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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;
///
/// Identifies the property tab or tabs that should be displayed for the
/// specified class or classes.
///
[AttributeUsage(AttributeTargets.All)]
public class PropertyTabAttribute : Attribute {
private PropertyTabScope[] tabScopes;
private Type[] tabClasses;
private string[] tabClassNames;
///
///
/// Basic constructor that creates a PropertyTabAttribute. Use this ctor to derive from this
/// attribute and specify multiple tab types by calling InitializeArrays.
///
///
public PropertyTabAttribute() {
tabScopes = new PropertyTabScope[0];
tabClassNames = new string[0];
}
///
///
/// Basic constructor that creates a property tab attribute that will create a tab
/// of the specified type.
///
///
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};
}
///
/// Gets the types of tab that this attribute specifies.
///
public Type[] TabClasses {
get {
if (tabClasses == null && tabClassNames != null) {
tabClasses = new Type[tabClassNames.Length];
for (int i=0; i
/// [To be supplied.]
///
protected string[] TabClassNames{
get {
if (tabClassNames != null) {
return (string[])tabClassNames.Clone();
}
else {
return null;
}
}
}
///
/// Gets the scopes of tabs for this System.ComponentModel.Design.PropertyTabAttribute, from System.ComponentModel.Design.PropertyTabScope.
///
public PropertyTabScope[] TabScopes {
get {
return tabScopes;
}
}
///
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;
}
///
///
/// Returns the hashcode for this object.
///
///
public override int GetHashCode() {
return base.GetHashCode();
}
///
///
/// Utiliity function to set the types of tab classes this PropertyTabAttribute specifies.
///
///
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;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- QuaternionRotation3D.cs
- TextBoxAutoCompleteSourceConverter.cs
- GridView.cs
- ItemCollection.cs
- VariableBinder.cs
- ObjectSecurity.cs
- DataServiceQueryException.cs
- FrameworkRichTextComposition.cs
- OpCodes.cs
- ScrollableControlDesigner.cs
- JsonUriDataContract.cs
- DesignerRegionCollection.cs
- COSERVERINFO.cs
- WorkflowInlining.cs
- MergeFilterQuery.cs
- TableRow.cs
- GlobalItem.cs
- LocalizableAttribute.cs
- DataGridViewColumnHeaderCell.cs
- LocalizableResourceBuilder.cs
- SR.cs
- PageRequestManager.cs
- AtomicFile.cs
- UInt16Storage.cs
- LinkedDataMemberFieldEditor.cs
- Property.cs
- StylusPointPropertyInfo.cs
- Expander.cs
- DPCustomTypeDescriptor.cs
- ContentType.cs
- DataRecordInternal.cs
- DataGridCellsPresenter.cs
- SessionSwitchEventArgs.cs
- AutoGeneratedFieldProperties.cs
- XmlRawWriter.cs
- controlskin.cs
- SiteMembershipCondition.cs
- Accessible.cs
- XmlEntityReference.cs
- BitmapImage.cs
- TypeConverterHelper.cs
- SelectionUIService.cs
- ControlTemplate.cs
- DrawingVisualDrawingContext.cs
- FontWeights.cs
- TypedRowHandler.cs
- ServiceModelActivationSectionGroup.cs
- BinaryMessageFormatter.cs
- Preprocessor.cs
- ValidationError.cs
- Sql8ExpressionRewriter.cs
- CompletedAsyncResult.cs
- ActivityExecutor.cs
- ScriptRef.cs
- XsltArgumentList.cs
- KeyConverter.cs
- ForeignKeyFactory.cs
- DataSetViewSchema.cs
- SchemaElement.cs
- CategoryAttribute.cs
- WebPermission.cs
- SchemaElement.cs
- DbConvert.cs
- DynamicRendererThreadManager.cs
- StateManagedCollection.cs
- XmlReader.cs
- MatrixAnimationUsingKeyFrames.cs
- Certificate.cs
- TypeResolver.cs
- MonitoringDescriptionAttribute.cs
- BuildResult.cs
- RegexParser.cs
- HtmlElementCollection.cs
- ClientScriptManagerWrapper.cs
- PolicyImporterElement.cs
- OptionalMessageQuery.cs
- TextRunCacheImp.cs
- BlockCollection.cs
- ParseNumbers.cs
- TextEditorDragDrop.cs
- InputBuffer.cs
- DrawingBrush.cs
- RemoteWebConfigurationHost.cs
- DataGridViewHeaderCell.cs
- StreamInfo.cs
- XmlIlGenerator.cs
- RestClientProxyHandler.cs
- DecoderFallbackWithFailureFlag.cs
- TypeElement.cs
- EventProperty.cs
- WizardSideBarListControlItemEventArgs.cs
- QilInvokeLateBound.cs
- BigInt.cs
- InputEventArgs.cs
- ExpandSegment.cs
- DateBoldEvent.cs
- CellCreator.cs
- NegationPusher.cs
- RowToFieldTransformer.cs
- XmlSchemaParticle.cs