Skip to content

Instantly share code, notes, and snippets.

/dur.cs Secret

Created December 29, 2013 21:22
Show Gist options
  • Save anonymous/c2708a79381802a14ec4 to your computer and use it in GitHub Desktop.
Save anonymous/c2708a79381802a14ec4 to your computer and use it in GitHub Desktop.
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