public bool SearchSaveSets(string searchString, ListView view) { List <SaveSetItem> l = ManageSaveSet.ReturnSaveSetList(); List <SaveSetItem> retList = new List <SaveSetItem>(); searchString = searchString.ToLower(); foreach (SaveSetItem ssi in l) { string name = ssi.SaveSetName.ToLower(); string comment = ssi.Comment.ToLower(); if (name.Contains(searchString)) { retList.Add(ssi); continue; } if (comment.Contains(searchString)) { retList.Add(ssi); continue; } } if (retList.Count > 0) { view.Items.Clear(); foreach (SaveSetItem i in retList) { var t = new string[5]; t[0] = i.SaveSetName; t[1] = i.CreationDate.ToShortDateString(); t[2] = i.Comment; t[3] = i.Password; t[4] = i.TotalFileCount.ToString(); view.Items.Add(new ListViewItem(t)); view.Items[view.Items.Count - 1].Tag = i.IndexIntoFile; } return(true); } else { MessageBox.Show("No encrypted files contain that search phrase."); } return(false); }
public void PopulateSaveSetListView(ListView ssDetails, ListView ssListView) { ssListView.Items.Clear(); ssDetails.Items.Clear(); List <SaveSetItem> l = ManageSaveSet.ReturnSaveSetList(); if (l.Count == 0) { return; } foreach (SaveSetItem i in l) { var t = new string[5]; t[0] = i.SaveSetName; t[1] = i.CreationDate.ToShortDateString(); t[2] = i.Comment; t[3] = i.Password; t[4] = i.TotalFileCount.ToString(); ssListView.Items.Add(new ListViewItem(t)); ssListView.Items[ssListView.Items.Count - 1].Tag = i.IndexIntoFile; } }
public bool SearchFileNames(string searchString, ListView view) { var ssL = ManageSaveSet.ReturnSaveSetList(); return(true); }