protected virtual void startButton_ClickAfter(object sboObject, SBOItemEventArg pVal) { for (int i = 0; i < moduleGrid.Rows.SelectedRows.Count; i++) { int rowId = moduleGrid.Rows.SelectedRows.Item(i, BoOrderType.ot_RowOrder); string moduleName = (string)moduleDT.GetValue("Name", rowId); string type = (string)moduleDT.GetValue("Type", rowId); if (type == "AddIn") { FrameworkAddinManager.StartAddin(moduleName); } } UpdateInstallGrid(); UpdateLicenseGrid(); moduleGrid_ClickAfter(sboObject, pVal); }
private void UpdateAddinStatus() { for (int i = 0; i < moduleDT.Rows.Count; i++) { string name = (string)moduleDT.GetValue("Name", i); string type = (string)moduleDT.GetValue("Type", i); string status; if (type == "AddIn") { AddinStatus addinStatus = FrameworkAddinManager.GetAddinStatus(name); status = (addinStatus == AddinStatus.Running) ? "R" : "S"; } else { status = "R"; // mark framework as running. } moduleDT.SetValue("Status", i, status); } }
protected virtual void moduleGrid_ClickAfter(object sboObject, SBOItemEventArg pVal) { try { this.UIAPIRawForm.Freeze(true); bool enableRemove = false, enableStart = false, enableStop = false, enableInstall = false, isAddin; for (int i = 0; i < moduleGrid.Rows.SelectedRows.Count; i++) { string type = (string)moduleDT.GetValue("Type", moduleGrid.Rows.SelectedRows.Item(i, BoOrderType.ot_SelectionOrder)); isAddin = (type == "AddIn"); if (isAddin) { enableRemove = true; } string status = (string)moduleDT.GetValue("Status", moduleGrid.Rows.SelectedRows.Item(i, BoOrderType.ot_SelectionOrder)); string installed = (string)moduleDT.GetValue("Installed", moduleGrid.Rows.SelectedRows.Item(i, BoOrderType.ot_SelectionOrder)); enableInstall = (installed == "N") || enableInstall; enableStart = ((status == "S") && isAddin) || enableStart; enableStop = (!enableStart && isAddin) || enableStop; } this.removeButton.Item.Enabled = enableRemove; this.startButton.Item.Enabled = enableStart; this.shutdownButton.Item.Enabled = enableStop; this.installButton.Item.Enabled = enableInstall; // History column event. if (pVal.ColUID == "History") { string module = (string)moduleDT.GetValue("Name", pVal.Row); var logForm = CreateForm <ChangeLog>(); logForm.LogMessage.Value = FrameworkAddinManager.GetAddinChangeLog(module); logForm.Show(); } } finally { this.UIAPIRawForm.Freeze(false); } }
internal void InstallAddin() { string addinName = AsmLoader.SaveAddIn(modulePath.Value); if (addinName == "Framework") { if (app.MessageBox(Messages.AdminConfirmReboot, 1, Messages.AdminOK, Messages.AdminCancel) == 1) { appEventHandler.Reboot(); } } else { if (FrameworkAddinManager.GetAddinStatus(addinName) == AddinStatus.Running) { FrameworkAddinManager.ShutdownAddin(addinName); FrameworkAddinManager.StartAddin(addinName); } UpdateInstallGrid(); UpdateLicenseGrid(); SAPAppender.SilentMode = false; Logger.Info(Messages.AdminSuccessInstall); } }