61 lines
No EOL
1.9 KiB
C#
61 lines
No EOL
1.9 KiB
C#
using System.Windows.Input;
|
|
using JD.Inspector.Actions;
|
|
using JD.Inspector.Plugin;
|
|
using JD.Inspector.View;
|
|
using JD.Inspector.ViewModel;
|
|
using JD.Remoting.Services;
|
|
using Plume.Icons;
|
|
using Plume.Interfaces.Modules;
|
|
using Plume.Interfaces.WPF.Actions;
|
|
using Plume.Interfaces.WPF.Menu;
|
|
using Plume.Interfaces.WPF.Modules;
|
|
using Plume.Interfaces.WPF.ToolBar;
|
|
using Plume.Interfaces.WPF.Window;
|
|
using Plume.WPF.Commands;
|
|
|
|
namespace JD.Inspector
|
|
{
|
|
public class InspectorModule : IWpfModule
|
|
{
|
|
private IModuleSetup _setup;
|
|
|
|
/// <inheritdoc />
|
|
public void Dispose()
|
|
{
|
|
//Nothing to dispose
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void Setup(IModuleSetup setup)
|
|
{
|
|
_setup = setup;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void Initialize(IWpfModuleContext context)
|
|
{
|
|
InspectorPlugin plugin = new InspectorPlugin();
|
|
context.GetService<IPluginService>().Register(plugin);
|
|
|
|
|
|
IActionManager actionService = context.ActionManager;
|
|
IWindowManager windowService = context.WindowManager;
|
|
IToolBarManager toolbarService = context.ToolBarManager;
|
|
IMenuManager menuService = context.MenuManager;
|
|
|
|
InspectorView inspectorView = new InspectorView
|
|
{
|
|
DataContext = new InspectorViewModel(plugin, context.ServiceManager, context.NotificationManager)
|
|
};
|
|
windowService.AddToolWindow("InspectorWindow", "Inspector", StandardIcon.Property, inspectorView,
|
|
DockingSide.Right,
|
|
new DoubleKeyGesture(ModifierKeys.Control, Key.V, Key.I));
|
|
|
|
actionService.Register<SaveAction>();
|
|
toolbarService.AddButton("Inspector", actionService.Get<SaveAction>());
|
|
|
|
menuService.AddSeparator("Engine");
|
|
menuService.AddMenuItem("Engine", actionService.Get<SaveAction>());
|
|
}
|
|
}
|
|
} |