﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using MyMarkdownEditor.Windows.MainWindow;

namespace MyMarkdownEditor
{
    /// <summary>
    /// Interaktionslogik für "App.xaml"
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            this.ShutdownMode = ShutdownMode.OnLastWindowClose;

            string fileToOpen = Environment.GetCommandLineArgs().FirstOrDefault(s => File.Exists(s) && Path.GetExtension(s) != ".exe");

            MyMarkdownEditor.Windows.MainWindow.MainWindow mainWindow = new MainWindow(fileToOpen);
            mainWindow.Show();
        }
    }
}
