using Database;
using FluentFTP;
using KlassenBIB;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SanSystem
{
    public partial class frmMain : Form
    {
        
        public frmMain()
        {
            InitializeComponent();

            
            if (!Directory.Exists(Global.Instance.Projektpfad)) Directory.CreateDirectory(Global.Instance.Projektpfad);
            Datenbank.Instance.LoadProjekt(Path.Combine(Global.Instance.Projektpfad,"18-850.xaml"));

           
            //Datenbank.Instance.CreateProjekt("");
            this.Width = Screen.PrimaryScreen.WorkingArea.Width;
            this.Height = Screen.PrimaryScreen.WorkingArea.Height;
            this.WindowState = FormWindowState.Maximized;
            this.StartPosition = FormStartPosition.Manual;
            this.Location = new Point(0, 0);

            projektToolStripMenuItem.Text = Global.Instance.language.Labels["mainmenu_projekt"];
            neuToolStripMenuItem.Text = Global.Instance.language.Labels["mainmenu_projekt_new"];
            öffnenToolStripMenuItem.Text = Global.Instance.language.Labels["mainmenu_projekt_open"];

        }

        


        private void frm_main_Load(object sender, EventArgs e)
        {
            
            frmStrassenList strassenList = new frmStrassenList();
            strassenList.MdiParent = this;
            strassenList.Show();


            //frmObjektEdit frmObjektEdit = new frmObjektEdit();
            //frmObjektEdit.Show();
        }

        private void frm_main_FormClosing(object sender, FormClosingEventArgs e)
        {
            
            Datenbank.Instance.SaveProjekt();
        }

        private void neuToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }
    }
}
