private void Include(ListView listView, string s) { if (s == CurrentDirectory) { s = ""; } VSCleanSetting obj = VSCleanLib.GetCurrentSetting(); if (VSCleanLib.AddScan(obj, VSCleanLib.GetFilenameAbsolute(s))) { VSCleanLib.RemoveExclude(obj, VSCleanLib.GetFilenameAbsolute(s)); VSCleanLib.SaveCurrentSetting(obj); } }
public void ListViewDelete(ListView listView, bool isExclude) { if (listView.SelectedItems == null || listView.SelectedItems.Count == 0) { return; } VSCleanSetting obj = VSCleanLib.GetCurrentSetting(); for (int i = listView.SelectedItems.Count - 1; i >= 0; i--) { string strx = listView.SelectedItems[i].Text; if (strx == CurrentDirectory) { strx = ""; } string str = VSCleanLib.GetFilenameAbsolute(strx); if (isExclude) { if (VSCleanLib.ContainsExclude(obj, str)) { VSCleanLib.RemoveExclude(obj, str); } } else { if (VSCleanLib.ContainsScan(obj, str)) { VSCleanLib.RemoveScan(obj, str); } } } if (VSCleanLib.SaveCurrentSetting(obj)) { LoadSetting(); return; } MessageBoxShow("Fail removing Path(s)"); return; }