Пример #1
0
        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));
        }
Пример #2
0
        public async override Task <bool> Start()
        {
            await PluginFactory.Start(this);

            return(await base.Start());
        }