//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ /* */ namespace System.ComponentModel { using System; using System.ComponentModel; using System.Diagnostics; using System.Security.Permissions; /// /// Specifies the data source and data member properties for a component. /// [AttributeUsage(AttributeTargets.Class)] public sealed class ComplexBindingPropertiesAttribute : Attribute { private readonly string dataSource; private readonly string dataMember; /// /// /// Initializes a new instance of /// the class. /// /// public ComplexBindingPropertiesAttribute() { this.dataSource = null; this.dataMember = null; } /// /// /// Initializes a new instance of /// the class. /// /// public ComplexBindingPropertiesAttribute(string dataSource) { this.dataSource = dataSource; this.dataMember = null; } /// /// /// Initializes a new instance of /// the class. /// /// public ComplexBindingPropertiesAttribute(string dataSource, string dataMember) { this.dataSource = dataSource; this.dataMember = dataMember; } /// /// /// Gets the name of the data source property for the component this attribute is /// bound to. /// /// public string DataSource { get { return dataSource; } } /// /// /// Gets the name of the data member property for the component this attribute is /// bound to. /// /// public string DataMember { get { return dataMember; } } /// /// /// Specifies the default value for the , which is . This /// field is read-only. /// /// public static readonly ComplexBindingPropertiesAttribute Default = new ComplexBindingPropertiesAttribute(); public override bool Equals(object obj) { ComplexBindingPropertiesAttribute other = obj as ComplexBindingPropertiesAttribute; return other != null && other.DataSource == dataSource && other.DataMember == dataMember; } public override int GetHashCode() { return base.GetHashCode(); } } }