public CommandViewTest(ICommandAndViewPlugin commandView, IFactoryClientCommand factoryClientCommand) { _factory = factoryClientCommand.Factory; try { _factory.Start(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } var clientCommand = (FactoryCommand)Activator.CreateInstance(factoryClientCommand.FactoryCommandType); try { clientCommand.Initialize(_factory); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } var administrationCommand = (Orcus.Administration.Plugins.CommandViewPlugin.Command)Activator.CreateInstance(commandView.Command); Initialize(clientCommand, administrationCommand, (ICommandView)Activator.CreateInstance(commandView.CommandView), (FrameworkElement)Activator.CreateInstance(commandView.View)); }
public async override Task <bool> Start() { await PluginFactory.Start(this); return(await base.Start()); }