// 弹出bundle的状态信息窗口 private void pushStateForm(object sender) { ToolStripMenuItem toolStripMenuItem = sender as ToolStripMenuItem; ToolStripItem parentToolStrip = toolStripMenuItem.OwnerItem; string text = parentToolStrip.Text; string bundleName = Tools.Tools.toolStripMenuItemText2BundleName(text); IBundle bundle = Tools.Tools.getBundleByName(bundleName, bundles); int bundleState = bundle.GetState(); string bundleStateString = Tools.Tools.transState(bundleState); pluginDetailForm = new PluginDetailForm(framework, bundleName, bundleStateString); pluginDetailForm.Text = text; pluginDetailForm.Show(); }
public string ExecuteCommand(string commandLine) { String bundleIdStr = commandLine.Substring(GetCommandName().Length).Trim(); var bundleId = int.Parse(bundleIdStr); IBundle bundle = framework.GetBundleContext().GetBundle(bundleId); if (bundle == null) { return(String.Format("未找到Index为[{0}]的插件", bundleId)); } bundle.Start(); return(String.Format("启动插件[{0} ({1})]完成,当前状态为:{2}", bundle.GetSymbolicName(), bundle.GetVersion(), BundleUtils.GetBundleStateString(bundle.GetState()))); }
public string ExecuteCommand(string commandLine) { String bundleIdStr = commandLine.Substring(GetCommandName().Length).Trim(); var bundleId = int.Parse(bundleIdStr); IBundle bundle = context.GetBundle(bundleId); if (bundle == null) { return(String.Format("未找到ID为[{0}]的Bundle", bundleId)); } bundle.Stop(); return(String.Format("插件[{0} ({1})]已停止.当前状态为:{2}", bundle.GetSymbolicName(), bundle.GetVersion(), BundleUtils.GetBundleStateString(bundle.GetState()))); }