#region "SoapBox.Core License"
///
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
///
/// This file is part of SoapBox Core.
///
/// Commercial Usage
/// Licensees holding valid SoapBox Automation Commercial licenses may use
/// this file in accordance with the SoapBox Automation Commercial License
/// Agreement provided with the Software or, alternatively, in accordance
/// with the terms contained in a written agreement between you and
/// SoapBox Automation Inc.
///
/// GNU Lesser General Public License Usage
/// SoapBox Core is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License
/// as published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// SoapBox Core is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with SoapBox Core. If not, see .
///
#endregion
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using System.Diagnostics;
using System.Threading;
namespace SoapBox.Core.Host
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application, IPartImportsSatisfiedNotification
{
private CompositionContainer _container;
///
/// Main WPF startup window for the application
///
[Import(CompositionPoints.Host.MainWindow, typeof(Window))]
public new Window MainWindow
{
get { return base.MainWindow; }
set { base.MainWindow = value; }
}
///
/// This imports a resource dictionary for a Theme so it's
/// added to the application resources.
/// This gets imported before the Styles.
///
[Import(ExtensionPoints.Host.Theme, typeof(ResourceDictionary), AllowRecomposition = true, AllowDefault=true)]
private ResourceDictionary Theme { get; set; }
///
/// This imports resource dictionaries for Styles so they're
/// all added to the application resources.
/// These get imported before the Views.
///
[ImportMany(ExtensionPoints.Host.Styles, typeof(ResourceDictionary), AllowRecomposition = true)]
private IEnumerable Styles { get; set; }
///
/// This imports resource dictionaries for Views so they're
/// all added to the application resources.
/// In general these should be full of DataTemplates for
/// displaying ViewModel classes.
///
[ImportMany(ExtensionPoints.Host.Views, typeof(ResourceDictionary), AllowRecomposition=true)]
private IEnumerable Views { get; set; }
///
/// Hosts a logging service
///
[Import(Services.Logging.LoggingService,typeof(ILoggingService))]
public ILoggingService logger { get; set; }
///
/// This imports any commands that are supposed to run when
/// the application starts.
///
[ImportMany(ExtensionPoints.Host.StartupCommands, typeof(IExecutableCommand), AllowRecomposition = true)]
private IEnumerable StartupCommands { get; set; }
///
/// This imports any commands that are supposed to run when
/// the application is shutdown.
///
[ImportMany(ExtensionPoints.Host.ShutdownCommands, typeof(IExecutableCommand), AllowRecomposition = true)]
private IEnumerable ShutdownCommands { get; set; }
///
/// This imports things that just want to be part of the composition.
///
[ImportMany(ExtensionPoints.Host.Void, typeof(Object), AllowRecomposition = true)]
private IEnumerable