using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ProjetDotNet.metier;
using System.Drawing;
using ProjetDotNet.DAO;
using ProjetDotNet.web;
using Newtonsoft.Json;
using ProjetDotNet.COR;

namespace ProjetDotNet
{
    static class Program
    {
        /// <summary>
        /// Point d'entrée principal de l'application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            SingletonConnexion connexion = null;
            connexion = SingletonConnexion.getInstance();

            /*CORChargerTriangle maillonTriangle = new CORChargerTriangle();
            CORChargerSegment maillonSegment = new CORChargerSegment();
            CORChargerRectangle maillonRect = new CORChargerRectangle();
            CORChargerPolygone maillonPolygone = new CORChargerPolygone();
            CORChargerGroupe maillonGroupe = new CORChargerGroupe();

            maillonTriangle.SetSuccessor(maillonSegment);
            maillonSegment.SetSuccessor(maillonRect);
            maillonRect.SetSuccessor(maillonPolygone);
            maillonPolygone.SetSuccessor(maillonGroupe);
            */
            //Forme f1=maillonTriangle.charge(1,"fraise");
            //Forme f2 = maillonTriangle.charge(2, "baton");
            //Forme f3 = maillonTriangle.charge(32, "pascal");
            //Forme f4 = maillonTriangle.charge(1, "groupetest");
            Console.WriteLine("CONSOLE");
            //Console.WriteLine(f1.ToString());
            //Console.WriteLine(f2.ToString());
            //Console.WriteLine(f3.ToString());
            //Console.WriteLine(f4.ToString());
            //Console.WriteLine(connexion.DAO_GROUPE.charge(1,"groupetest").ToString());

           /* List<PointForme> listePointTest = new List<PointForme>();
            listePointTest.Add(new PointForme(789, 100));
            listePointTest.Add(new PointForme(999, 22));
            listePointTest.Add(new PointForme(757, 7));

            List<PointForme> listePointTest2 = new List<PointForme>();
            listePointTest.Add(new PointForme(789, 100));
            listePointTest.Add(new PointForme(999, 22));
            listePointTest.Add(new PointForme(757, 7));
            listePointTest.Add(new PointForme(799, 7));

            Polygone p0 = new Polygone("azertyui", Color.Cornsilk, listePointTest);
            Triangle p1 = new Triangle("remy", Color.CadetBlue, listePointTest);
            ProjetDotNet.metier.Rect p2 = new ProjetDotNet.metier.Rect("remy2", Color.Coral, listePointTest2);

            connexion.DAO_POLYGONE.save(p0);
            //connexion.DAO_RECTANGLE.save(p2);*/

            //Console.ReadLine();
            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FenetreDessin());
        }
    }
}
