using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using WPLog;

namespace WPLoggingApplication
{
    public partial class MainPage : PhoneApplicationPage
    {
        Logger classLogger;
        // Constructor
        public MainPage()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");

            classLogger = new Logger(this.GetType());
            classLogger.DebugOutput = true;
            classLogger.LogLevel = LogLevel.Error;
            classLogger.Write("Constructor working");
            classLogger.WriteInfo("Before InitializeComponent()");
            
            InitializeComponent();
            
            classLogger.WriteInfo("After InitializeComponent()");

            try
            {
                throw new Exception("Eine Ausnahme ist aufgetreten!");
            }
            catch (Exception e)
            {

                classLogger.WriteError(String.Format("{0}\r\n{1}", e.Message,e.StackTrace));

            }

            MessageBox.Show(LogSystem.Instance.CurrentLog);
        }
    }
}