using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Resources;
using Core.Common.Base.Workflow;
namespace Core.Common.Base
{
///
/// Defines core functionality of any application which uses modelling framework.
/// Application can be implemented as a gui, web, console application.
///
public interface IApplication : IDisposable
{
event Action ProjectOpening;
event Action ProjectOpened;
event Action ProjectClosing;
event Action ProjectSaving;
event Action ProjectSaved;
event Action ProjectSaveFailed;
///
/// Fired after application has been started.
///
event Action AfterRun;
///
/// Gets or sets collection of plugins.
///
IList Plugins { get; }
///
/// The current application working project.
///
Project Project { get; }
IActivityRunner ActivityRunner { get; }
// HACK: make queue check this
///
/// Gets Application settings.
/// Application settings are usually located in the app.config file of the main executable.
///
///
NameValueCollection Settings { get; set; }
///
/// Gets User settings.
/// User settings will be automatically saved in the user home folder.
///
ApplicationSettingsBase UserSettings { get; set; }
///
/// TODO: should be custom providing access to text string, icons from Application.
///
ResourceManager Resources { get; set; }
IEnumerable FileImporters { get; }
IEnumerable FileExporters { get; }
// TODO: hide it?
string ProjectFilePath { get; }
string PluginVersions { get; }
ApplicationPlugin GetPluginForType(Type type);
///
/// Check if any activity is running.
///
/// true if one or more runnables are running
bool IsActivityRunning();
///
/// Returns path to the user settings directory for the current application.
///
///
string GetUserSettingsDirectoryPath();
///
/// Runs application.
///
void Run();
///
/// Runs application and open project.
///
void Run(string projectPath);
///
/// Exits application.
///
void Exit();
///
/// Runs given activity synchronously.
///
///
void RunActivity(IActivity activity);
///
/// Adds the activity to the CurrentActivities, runs it
///
///
void RunActivityInBackground(IActivity activity);
///
/// Is activity running or queued in the CurrentActivities
///
///
///
bool IsActivityRunningOrWaiting(IActivity activity);
///
/// Cancels the running activity (stop or remove from CurrentActivities).
///
///
void StopActivity(IActivity activity);
void CreateNewProject();
bool OpenProject(string path);
void CloseProject();
void SaveProjectAs(string path);
void SaveProject();
}
}