private bool KillSoftwareCenter(bool isNewVersion) { bool flag = true; try { IEnumerable<SoftwareCenterInfo> list = dictCurrentSCInfo.Values.Where(v => v.IsNewVersion == isNewVersion); if (list != null && list.Count() > 0) { object obj = Settings.GetMessageBox(); if (obj == null) { if (frmDialog.frmMessageDialog == null) { frmDialog frmMessageDialog = new frmDialog(); frmMessageDialog.Topmost = true; frmMessageDialog.ShowDialog(); if (frmMessageDialog.Result.ToLower() == "yes") { CloseSC(list); } else { flag = false; } } else { frmDialog.frmMessageDialog.Topmost = true; frmDialog.frmMessageDialog.ShowDialog(); if (frmDialog.frmMessageDialog.Result.ToLower() == "yes") { CloseSC(list); } else { flag = false; } } } else { CloseSC(list); } } } catch { } return flag; }
private bool KillCPApplet() { bool flag = true; try { if (dictCurrentCPInfo != null && dictCurrentCPInfo.Count() > 0) { object obj = Settings.GetMessageBox(); if (obj == null) { if (frmDialog.frmMessageDialog == null) { frmDialog frmMessageDialog = new frmDialog(); frmMessageDialog.Topmost = true; frmMessageDialog.ShowDialog(); if (frmMessageDialog.Result.ToLower() == "yes") { CloseCP(dictCurrentCPInfo); } else { flag = false; } } else { frmDialog.frmMessageDialog.Topmost = true; frmDialog.frmMessageDialog.ShowDialog(); if (frmDialog.frmMessageDialog.Result.ToLower() == "yes") { CloseCP(dictCurrentCPInfo); } else { flag = false; } } } else { CloseCP(dictCurrentCPInfo); } } else { Process[] pList = Process.GetProcessesByName("rundll32"); if(pList != null && pList.Count() > 0) { foreach (Process item in pList) { if (item.SessionId == currentSessionID) { item.Kill(); } } } } } catch { } return flag; }
public frmDialog() { InitializeComponent(); frmMessageDialog = this; }