Пример #1
0
        private string ToString(object obj, string indent)
        {
            if (obj == null)
            {
                return(indent + "[null]");
            }
            else
            {
                if (!(obj is string))
                {
                    IEnumerable eo = obj as IEnumerable;
                    if (eo != null)
                    {
                        return(eo.Cast <object>().Select(o => ToString(o, indent + "  ")).Join("\n"));
                    }
                }
                SimpleStructured ss = obj as SimpleStructured;
                if (ss != null)
                {
                    return(ToString(ss.InlinedStructure(), indent));
                }

                return(indent + obj.ToString());
            }
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            SimpleStructured other = obj as SimpleStructured;

            if (other == null)
            {
                return(false);
            }

            return(InlinedStructure().SequenceEqual(other.InlinedStructure(), new SimpleEqualityComparer()));
        }