using System.Drawing;
using System.Xml;
using ImageBlockz.Api;


namespace ImageBlockz.Operations.InOut
{
    public class FromImage : AbstractOperation
    {
        public static readonly string OperationName = typeof(FromImage).FullName;

        public FromImage() : base(OperationType.Input)
        {
        }

        public Bitmap Image { get; set; }

        public override Bitmap Do(Bitmap img)
        {
            return Image;
        }

        public override XmlNode ToXml(XmlDocument xmlDoc)
        {
            XmlElement fromimage = xmlDoc.CreateElement(OperationName);
            return fromimage;
        }

        public override void FromXml(XmlNode node)
        {
        }

        public override string GetFormattedName()
        {
            return "From Image";
        }


        public override string GetInfo()
        {
            return "From: Main";
        }
    }
}