using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ZionRobot
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            createBasicDirectories();
            try
            {

                Tasks.JobManager jobManager = new Tasks.JobManager(new Models.Process.Workflow(
                          new Models.Workflow.RoadMap(
                              System.IO.Path.Combine(
                                  Persistence.Basic.ApplicationFolder,
                                  Persistence.Basic.ApplicationName + @".wflow"))), true);
            }
            catch (Exception ex)
            {

                throw;
            }

            /*Tasks.JobManager jobManager = new Tasks.JobManager(new Models.Process.Workflow(
                      new Models.Workflow.RoadMap(
                          System.IO.Path.Combine(@"C:\Temp\Workflow\Demo.wflow"))), true);*/

            this.Visibility = Visibility.Hidden;
            this.ShowInTaskbar = false;
        }

        private void createBasicDirectories()
        {
            System.IO.Directory.CreateDirectory(Persistence.Basic.ApplicationFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.BlueprintsFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.ConfigurationFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.PublicFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.DoneFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.SearchResultFolder);
            System.IO.Directory.CreateDirectory(Persistence.Basic.LogsFolder);
        }

    }
}
