private async Task LoadFile() { CSFFile = new CSFFile(); await CSFFile.LoadFromFile(FilePath); ListUpdata(CSFFile); }
private void ListUpdata(CSFFile CSFFile) { _dgTagList.Items.Clear(); int i = 0; foreach (var Label in CSFFile.Label) { System.Diagnostics.Debug.WriteLine(i.ToString()); var tag = Label.LabelString.Split(':'); string lbl = string.Empty; if (tag.Length != 1) { lbl = tag[0]; } else { lbl = "(default)"; } ListAdd(lbl.ToUpper(), new LKV(Label.LabelString, Label.ValueString, Label.ExtraValue)); i++; } }
private void search() { SearchReturn = new CSFFile(); SearchReturn.CleanLabels(); int[] a = Array.Empty <int>(), b = Array.Empty <int>(); if (_cbSLabel.IsChecked == true) { a = CSFFile.SearchLabel(_tbSearchBox.Text); } if (_cbSString.IsChecked == true) { b = CSFFile.SearchString(_tbSearchBox.Text); } List <int> tmp = b.ToList(); tmp.AddRange(a.ToList()); foreach (var i in tmp) { SearchReturn.Label.Add(CSFFile.Label[i]); } ListUpdata(SearchReturn); }