Exemple #1
0
        public bool Equals(OnewayCoinToCoinOrder other)
        {
            if (other == null)
            {
                return(false);
            }

            var properties = this.GetType().GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).ToList();

            foreach (var p in properties)
            {
                var v1 = p.GetValue(this);
                var v2 = p.GetValue(other);
                if (v1 == null && v2 == null)
                {
                    continue;
                }
                if (v1 == null || v2 == null)
                {
                    return(false);
                }
                if (!v1.Equals(v2))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemple #2
0
        public void Copy(OnewayCoinToCoinOrder other)
        {
            if (other == null)
            {
                return;
            }
            var properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(p => p.CanWrite).ToList();

            foreach (var p in properties)
            {
                var v2 = p.GetValue(other);
                p.SetValue(this, v2);
            }
        }