| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System.ComponentModel.Composition.Hosting;
- using System.Windows;
- using Infrastructure;
- using Microsoft.Practices.Prism.MefExtensions;
- using Microsoft.Practices.Prism.Regions;
- using Modules.BehaviorTree;
- using Modules.Robot;
- using Modules.Login;
- using Modules.WCFClient;
- namespace Editor
- {
- public class Bootstrapper: MefBootstrapper
- {
- protected override void ConfigureAggregateCatalog()
- {
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (Bootstrapper).Assembly));
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (ViewExportAttribute).Assembly));
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (BehaviorTreeModule).Assembly));
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (RobotModule).Assembly));
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (LoginModule).Assembly));
- this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof (WCFClientModule).Assembly));
- }
- protected override void InitializeShell()
- {
- base.InitializeShell();
- Application.Current.MainWindow = (Shell) this.Shell;
- Application.Current.MainWindow.Show();
- }
- protected override IRegionBehaviorFactory ConfigureDefaultRegionBehaviors()
- {
- IRegionBehaviorFactory factory = base.ConfigureDefaultRegionBehaviors();
- factory.AddIfMissing(
- "AutoPopulateExportedViewsBehavior",
- typeof (AutoPopulateExportedViewsBehavior));
- return factory;
- }
- protected override DependencyObject CreateShell()
- {
- return this.Container.GetExportedValue<Shell>();
- }
- }
- }
|