Пример #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="a_source"></param>
 public XmlBase(XmlBase a_source)
 {
     MemoryStream ms = new MemoryStream();
     a_source.Save(ms);
     ms.Position = 0;
     Load(ms);
 }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="a_source"></param>
        public XmlBase(XmlBase a_source)
        {
            MemoryStream ms = new MemoryStream();

            a_source.Save(ms);
            ms.Position = 0;
            Load(ms);
        }
Пример #3
0
        /// <summary>
        /// Compare objects through xml.
        /// </summary>
        /// <param name="a_obj"></param>
        /// <returns></returns>
        public override bool Equals(object a_obj)
        {
            if (a_obj == null)
            {
                return(false);
            }

            XmlBase xml_base = a_obj as XmlBase;

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

            MemoryStream ms1 = new MemoryStream();

            xml_base.Save(ms1);

            MemoryStream ms2 = new MemoryStream();

            Save(ms2);

            return(ms1.ToArray().AreSame(ms2.ToArray()));
        }