-
-
Save anonymous/c2708a79381802a14ec4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoteTemplateList LoadNotes = new NoteTemplateList(); | |
public class NoteTemp | |
{ | |
public string NoteT { get; set; } | |
public string NoteB { get; set; } | |
} | |
public void SearchIT() | |
{ | |
lb1.ItemsSource = LoadNotes.Where(w => w.NoteT.ToUpper().Contains(Search.Text.ToUpper())); | |
lb2.ItemsSource = LoadNotes.Where(w => w.NoteT.ToUpper().Contains(Search.Text.ToUpper())); | |
} | |
public class NoteTemplateList : ObservableCollection<NoteTemp> | |
{ | |
public NoteTemplateList() | |
{ | |
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); | |
store.CreateDirectory("/Pencil/Notes/"); | |
string directory = "/Pencil/Notes/"; | |
string[] filenames = store.GetDirectoryNames(directory); | |
List<NoteTemplateList> dataSource = new List<NoteTemplateList>(); | |
foreach (string filename in filenames) | |
{ | |
IsolatedStorageFileStream fileStream = store.OpenFile("/Pencil/Notes/" + filename + "/Title.txt", FileMode.Open, FileAccess.Read); | |
IsolatedStorageFileStream fileStream1 = store.OpenFile("/Pencil/Notes/" + filename + "/Note.txt", FileMode.Open, FileAccess.Read); | |
using (StreamReader readtitle = new StreamReader(fileStream)) | |
{ | |
var title = readtitle.ReadLine(); | |
using (StreamReader readbody = new StreamReader(fileStream1)) | |
{ | |
var body = readbody.ReadLine(); | |
Add(new NoteTemp { NoteT = title, NoteB = body, }); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment