using System;
using System.Collections.Generic;
using System.Text;
using de.WWWings;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WWWings_WPF
{
 class Program
 {

  ///// <summary>
  ///// Application Entry Point.
  ///// </summary>
  //[System.STAThreadAttribute()]
  //[System.Diagnostics.DebuggerNonUserCodeAttribute()]
  //public static void Main()
  //{

  // //XAML_Serialsierung();


  // WWWings_WPF.App app = new WWWings_WPF.App();
  // app.InitializeComponent();
  // app.Run();
  //}

  [System.STAThreadAttribute()]
  public static void Main()
  {

   // Ohne app.xaml
   //Application App = new Application();
   ////App.StartupUri = new Uri("file://F_Flugbuchung.xaml"); TODO
   //Window w = new F_Flugbuchung();
   //App.Startup += new StartupEventHandler(App_Startup);
   //App.LoadCompleted += new LoadCompletedEventHandler(App_LoadCompleted);
   //App.Activated += new EventHandler(App_Activated);
   //App.Deactivated += new EventHandler(App_Deactivated);
   //App.Exit += new ExitEventHandler(App_Exit);
   //App.ShutdownMode = ShutdownMode.OnLastWindowClose;
   //App.Run(w);

   // Mit app.xaml
   WorldWideWings_App App = new WorldWideWings_App();
   App.InitializeComponent();
   Window w = new F_Flugbuchung();
   App.Startup += new StartupEventHandler(App_Startup);
   App.LoadCompleted += new LoadCompletedEventHandler(App_LoadCompleted);
   App.Activated += new EventHandler(App_Activated);
   App.Deactivated += new EventHandler(App_Deactivated);
   App.Exit += new ExitEventHandler(App_Exit);
   App.ShutdownMode = ShutdownMode.OnLastWindowClose;
   App.Run(w);

  }

  static void App_Exit(object sender, ExitEventArgs e)
  {
   System.Diagnostics.Trace.WriteLine("App_Exit");
  }

  static void App_Deactivated(object sender, EventArgs e)
  {
   System.Diagnostics.Trace.WriteLine("App_Deactivated");
  }

  static void App_Activated(object sender, EventArgs e)
  {
   System.Diagnostics.Trace.WriteLine("App_Activated");
  }

  static void App_LoadCompleted(object sender, NavigationEventArgs e)
  {
   System.Diagnostics.Trace.WriteLine("App_LoadCompleted");
  }

  static void App_Startup(object sender, StartupEventArgs e)
  {
   System.Diagnostics.Trace.WriteLine("App_Startup");
  }

  //WWWings_WPF.App app = new WWWings_WPF.App();
  //app.InitializeComponent();
  //app.Run();

  public static void XAML_Serialsierung()
  {
   FlugMenge m = FlugBLManager.HoleAlle();
   string s = System.Windows.Markup.XamlWriter.Save(m);
   System.IO.File.WriteAllText("g:\\FlugMenge_XAML.xml", s);
   MessageBox.Show(s);
  }

 }
}
