BindingMemberInfo.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 / WinForms / Managed / System / WinForms / BindingMemberInfo.cs / 1 / BindingMemberInfo.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Windows.Forms { 
 
    using System;
    using System.Globalization; 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public struct BindingMemberInfo { 
        private string dataList; 
        private string dataField;
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public BindingMemberInfo(string dataMember) {
            if (dataMember == null) 
                dataMember = ""; 

            int lastDot = dataMember.LastIndexOf("."); 
            if (lastDot != -1) {
                dataList = dataMember.Substring(0,lastDot);
                dataField = dataMember.Substring(lastDot+1);
            } 
            else {
                dataList = ""; 
                dataField = dataMember; 
            }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public string BindingPath { 
            get { 
                return (dataList != null ? dataList : "");
            } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public string BindingField { 
            get {
                return (dataField != null ? dataField : ""); 
            }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public string BindingMember {
            get { 
                return (BindingPath.Length > 0 ? BindingPath + "." + BindingField : BindingField);
            }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public override bool Equals(object otherObject) { 
            if (otherObject is BindingMemberInfo) {
                BindingMemberInfo otherMember = (BindingMemberInfo) otherObject;
                return (String.Equals(this.BindingMember, otherMember.BindingMember, StringComparison.OrdinalIgnoreCase));
            } 
            return false;
        } 
 
        public static bool operator ==(BindingMemberInfo a, BindingMemberInfo b) {
            return a.Equals(b); 
        }

        public static bool operator !=(BindingMemberInfo a, BindingMemberInfo b) {
            return !a.Equals(b); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public override int GetHashCode() {
            return base.GetHashCode();
        } 
    }
} 
 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

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