2014-07-29 20:35:59 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using RainmeterStudio.Business;
|
2014-09-12 10:26:52 +00:00
|
|
|
|
using RainmeterStudio.Core.Editor;
|
2014-08-15 21:39:31 +00:00
|
|
|
|
using RainmeterStudio.Core.Model;
|
2014-08-12 13:33:13 +00:00
|
|
|
|
using RainmeterStudio.Core.Storage;
|
2014-09-12 10:19:01 +00:00
|
|
|
|
using RainmeterStudio.Editor.ProjectEditor;
|
2014-07-29 20:35:59 +00:00
|
|
|
|
using RainmeterStudio.UI;
|
|
|
|
|
using RainmeterStudio.UI.Controller;
|
|
|
|
|
|
|
|
|
|
namespace RainmeterStudio
|
|
|
|
|
{
|
|
|
|
|
static class MainClass
|
|
|
|
|
{
|
|
|
|
|
[STAThread]
|
|
|
|
|
public static void Main()
|
|
|
|
|
{
|
|
|
|
|
// Display splash
|
|
|
|
|
SplashScreen splash = new SplashScreen("Resources/splash.png");
|
|
|
|
|
splash.Show(true);
|
|
|
|
|
|
2014-08-12 13:33:13 +00:00
|
|
|
|
// Initialize project manager
|
2014-07-29 20:35:59 +00:00
|
|
|
|
ProjectStorage projectStorage = new ProjectStorage();
|
|
|
|
|
ProjectManager projectManager = new ProjectManager(projectStorage);
|
|
|
|
|
|
2014-08-12 13:33:13 +00:00
|
|
|
|
// Initialize document manager
|
2014-07-29 20:35:59 +00:00
|
|
|
|
DocumentManager documentManager = new DocumentManager();
|
2014-08-12 13:33:13 +00:00
|
|
|
|
|
|
|
|
|
// Initialize plugin manager
|
|
|
|
|
PluginManager pluginManager = new PluginManager();
|
2014-08-14 07:06:20 +00:00
|
|
|
|
pluginManager.AddRegisterExportTypeHandler(typeof(IDocumentStorage), obj => documentManager.RegisterStorage((IDocumentStorage)obj));
|
2014-08-15 21:39:31 +00:00
|
|
|
|
pluginManager.AddRegisterExportTypeHandler(typeof(IDocumentTemplate), obj => documentManager.RegisterTemplate((IDocumentTemplate)obj));
|
2014-08-14 07:06:20 +00:00
|
|
|
|
pluginManager.AddRegisterExportTypeHandler(typeof(IDocumentEditorFactory), obj => documentManager.RegisterEditorFactory((IDocumentEditorFactory)obj));
|
2014-08-15 21:39:31 +00:00
|
|
|
|
pluginManager.AddRegisterExportTypeHandler(typeof(IProjectTemplate), obj => projectManager.RegisterProjectTemplate((IProjectTemplate)obj));
|
2014-08-14 07:06:20 +00:00
|
|
|
|
pluginManager.Initialize();
|
2014-07-29 20:35:59 +00:00
|
|
|
|
|
|
|
|
|
// Create & run app
|
|
|
|
|
var uiManager = new UIManager(projectManager, documentManager);
|
|
|
|
|
uiManager.Run();
|
2014-08-15 12:31:33 +00:00
|
|
|
|
|
|
|
|
|
// Run finished, persist settings
|
|
|
|
|
SettingsProvider.SaveSettings();
|
2014-07-29 20:35:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|