//Takes an Entry object and add it to the root public static void AddEntry(Entry mEntry) { JObject entry = new JObject(); JProperty jTitle = new JProperty("Title", mEntry.Title); JProperty jDescript = new JProperty("Description", mEntry.Description); JProperty jDetails = new JProperty("Details", mEntry.Details); entry.Add(jTitle); entry.Add(jDescript); entry.Add(jDetails); root.Add(entry); }
private void But_Save_Click(object sender, RoutedEventArgs e) { if (NewEntry) { Entry mEntry = new Entry(TexBox_Title.Text, TexBox_Description.Text, TexBox_Details.Text); MainWindow.EntryList.Add(mEntry); this.Close(); } else { MainWindow.EntryList[Index].Title = TexBox_Title.Text; MainWindow.EntryList[Index].Description = TexBox_Description.Text; MainWindow.EntryList[Index].Details = TexBox_Details.Text; this.Close(); } }