public void CircWork()
        {
            CircularReferenceOne cr = new CircularReferenceOne
                {
                    Identifier = 1,
                    CR2 = new CircularReferenceTwo
                        {
                            Identifier = 2
                        }
                };
            cr.CR2.CR1 = cr;

            var copy = cr.HCopy();
        }
        public CircularReferenceOne HCircCopy(object obj, Dictionary<int, object> track)
        {
            object clone;
            if (track.TryGetValue(RuntimeHelpers.GetHashCode(obj), out clone))
            {
                var c = clone as CircularReferenceOne;
                if (null != c)
                    return c;
            }

            var myClone = new CircularReferenceOne();
            track.Add(RuntimeHelpers.GetHashCode(obj), myClone);

            myClone.Identifier = this.Identifier;
            CircularReferenceTwo cr = this.CR2;
            myClone.CR2 = null == cr ? null : cr.HCircCopy(cr, track);

            return myClone;
        }
        public CircularReferenceOne HCircCopy(object obj, Dictionary <int, object> track)
        {
            object clone;

            if (track.TryGetValue(RuntimeHelpers.GetHashCode(obj), out clone))
            {
                var c = clone as CircularReferenceOne;
                if (null != c)
                {
                    return(c);
                }
            }

            var myClone = new CircularReferenceOne();

            track.Add(RuntimeHelpers.GetHashCode(obj), myClone);

            myClone.Identifier = this.Identifier;
            CircularReferenceTwo cr = this.CR2;

            myClone.CR2 = null == cr ? null : cr.HCircCopy(cr, track);

            return(myClone);
        }