ComplexBindingPropertiesAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / ComplexBindingPropertiesAttribute.cs / 1 / ComplexBindingPropertiesAttribute.cs

                            //------------------------------------------------------------------------------ 
// 
//     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(); 
        } 
    }
} 


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK