private static void InitializeContainer(IQFrameworkContainer container) { mViews = null; container.RegisterInstance(container); var viewTypes = GetDerivedTypes <IPackageKitView>(false, false).ToArray(); foreach (var view in viewTypes) { var viewInstance = Activator.CreateInstance(view) as IPackageKitView; if (viewInstance == null) { continue; } container.RegisterInstance(viewInstance, view.Name, false); container.RegisterInstance(viewInstance.GetType(), viewInstance); } container.InjectAll(); foreach (var view in Views) { view.Container = Container; view.Init(Container); } foreach (var view in Views) { container.Inject(view); } }
private static void InitializeContainer(IQFrameworkContainer container) { _plugins = null; container.RegisterInstance <IQFrameworkContainer>(container); var pluginTypes = GetDerivedTypes <ICorePlugin>(false, false).ToArray(); // Load all plugins foreach (var diagramPlugin in pluginTypes) { if (pluginTypes.Any(p => p.BaseType == diagramPlugin)) { continue; } var pluginInstance = Activator.CreateInstance((Type)diagramPlugin) as ICorePlugin; if (pluginInstance == null) { continue; } container.RegisterInstance(pluginInstance, diagramPlugin.Name, false); container.RegisterInstance(pluginInstance.GetType(), pluginInstance); if (pluginInstance.Enabled) { foreach (var item in diagramPlugin.GetInterfaces()) { ListenFor(item, pluginInstance); } } } container.InjectAll(); foreach (var diagramPlugin in Plugins.OrderBy(p => p.LoadPriority).Where(p => !p.Ignore)) { if (diagramPlugin.Enabled) { var start = DateTime.Now; diagramPlugin.Container = Container; diagramPlugin.Initialize(Container); } } foreach (var diagramPlugin in Plugins.OrderBy(p => p.LoadPriority).Where(p => !p.Ignore)) { if (diagramPlugin.Enabled) { var start = DateTime.Now; container.Inject(diagramPlugin); diagramPlugin.Loaded(Container); diagramPlugin.LoadTime = DateTime.Now.Subtract(start); } } SignalEvent <ISystemResetEvents>(_ => _.SystemRestarted()); }
private static void InitializeContainer(IQFrameworkContainer container) { mPlugins = null; container.RegisterInstance(container); var pluginTypes = GetDerivedTypes <QFramework.IPackageKitView>(false, false).ToArray(); foreach (var diagramPlugin in pluginTypes) { var pluginInstance = Activator.CreateInstance((Type)diagramPlugin) as QFramework.IPackageKitView; if (pluginInstance == null) { continue; } container.RegisterInstance(pluginInstance, diagramPlugin.Name, false); container.RegisterInstance(pluginInstance.GetType(), pluginInstance); if (pluginInstance.Enabled) { foreach (var item in diagramPlugin.GetInterfaces()) { ListenFor(item, pluginInstance); } } } container.InjectAll(); foreach (var diagramPlugin in Plugins.Where(p => !p.Ignore)) { if (diagramPlugin.Enabled) { var start = DateTime.Now; diagramPlugin.Container = Container; diagramPlugin.Init(Container); } } foreach (var diagramPlugin in Plugins.Where(p => !p.Ignore)) { if (diagramPlugin.Enabled) { var start = DateTime.Now; container.Inject(diagramPlugin); // diagramPlugin.Loaded(Container); // diagramPlugin.LoadTime = DateTime.Now.Subtract(start); } } SignalEvent <ISystemResetEvents>(_ => _.SystemRestarted()); }
void OnCommandExecute(IEditorStrangeMVCCommand command) { Container.Inject(command); command.Execute(); }
public static TViewModel InjectSelfWithContainer <TViewModel>(this TViewModel self, IQFrameworkContainer container) where TViewModel : IViewModel { container.Inject(self); return(self); }
public void Init(IQFrameworkContainer mContainer) { FrameworkContainer = mContainer; mContainer.Inject(this); }
void OnCommandExecute(TCommand command) { Container.Inject(command); command.Execute(); }