#region License
// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
// This source code is made available under the terms of the GNU Lesser General Public License v3.0
// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
#endregion
using System;
using System.Collections.Generic;
using Ninject;
namespace MiniSqlQuery.Core
{
///
/// The core services of the application.
///
public interface IApplicationServices
{
///
/// Occurs when a system message is posted.
///
event EventHandler SystemMessagePosted;
///
/// Gets the Dependency Injection container.
/// This container holds all major application components and plugins.
/// See the "Configuration.xml" file in the main application for settings.
///
/// The container.
IKernel Container { get; }
///
/// Gets the application host window.
///
/// The application host window - a .
IHostWindow HostWindow { get; }
///
/// Gets a dictionary of the current plugins for this application.
///
/// A reference to the plugin dictionary.
Dictionary Plugins { get; }
///
/// Gets the application settings instance.
///
/// A reference to the settings handler.
IApplicationSettings Settings { get; }
///
/// The get configuration object types.
///
/// An array of configuration objects.
Type[] GetConfigurationObjectTypes();
///
/// Initializes the plugins that have been loaded during application startup.
///
void InitializePlugIns();
///
/// Loads the (calling its method) and
/// adds it to the dictionary for access by other services.
///
/// The plugin to load.
/// If is null.
void LoadPlugIn(IPlugIn plugIn);
///
/// Posts a system message for listeners.
///
/// A system message type.
/// The asssociated data.
void PostMessage(SystemMessage message, object data);
///
/// Registers the component service type with and implemetation of type .
///
/// The contract type.
/// The implementing type.
/// The key or name of the service.
void RegisterComponent(string key);
///
/// Registers the component implemetation of type .
///
/// The implementing type.
/// The key or name of the service.
void RegisterComponent(string key);
///
/// The register configuration object.
///
/// A configuration class.
void RegisterConfigurationObject() where TConfig : IConfigurationObject;
///
/// Registers the editor of type using the .
///
/// The editor type.
/// The file editor descriptor.
void RegisterEditor(FileEditorDescriptor fileEditorDescriptor) where TEditor : IEditor;
///
/// Registers the component service type with and implemetation of type as a singleton.
///
/// The contract type.
/// The implementing type.
/// The key or name of the service.
void RegisterSingletonComponent(string key);
///
/// Resolves an instance of from the container.
///
/// The type to find in the container.
/// The key (can be null if not applicable).
/// An instance of the type depending on the containters configuration.
T Resolve(string key);
///
/// The resolve.
///
/// The type to find in the container.
/// An instance of the type depending on the containters configuration.
T Resolve();
///
/// Remove the component by name.
///
/// True on success.
void RemoveComponent();
}
}