using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;

namespace CSTiffImageConverter
{
    class Format
    {
        //List of formats
        List<ImageFormat> _formats;

        public Format()
        {
            //Add the formats to the list
            _formats = new List<ImageFormat>();
            _formats.Add(ImageFormat.Jpeg);
            _formats.Add(ImageFormat.Gif);
            _formats.Add(ImageFormat.Bmp);
        }

        //Getters and setters
        public List<ImageFormat> Formats
        {
            get { return _formats; }
            set { _formats = value; }
        }

        //To filter the images with the good format for the dialog box
        public string GetFilter(int index)
        {
            string value = "";

            switch (index)
            {
                case 0:
                    value = "Image files (.jpg, .jpeg)|*.jpg;*.jpeg";
                    break;
                case 1:
                    value = "Image files (.gif)|*.gif";
                    break;
                case 2:
                    value = "Image files (.bmp)|*.bmp";
                    break;
                default:
                    value = "";
                    break;
            }

            return value;
        }
    }
}
