using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace AIStudio.Wpf.DiagramDesigner.Models
{
    [Serializable]
    [XmlInclude(typeof(SerializableItem))]
    public class SerializableItem
    {
        [XmlIgnore]
        public Type Type
        {
            get; set;
        }

        [XmlAttribute]
        public string TypeName
        {
            get; set;
        }

        [XmlAttribute]
        public string ObjectJson
        {
            get; set;
        }
    }

    [Serializable]
    [XmlInclude(typeof(SerializableObject))]
    public class SerializableObject
    {
        [XmlArray]
        public List<SerializableItem> DesignerItems { get; set; } = new List<SerializableItem>();

        [XmlArray]
        public List<SerializableItem> Connections { get; set; } = new List<SerializableItem>();
    }
}
