public void LoadIndexFrom(string filename) { try { // deserialize JSON directly from a file using (StreamReader file = File.OpenText(filename)) { JsonSerializer serializer = new JsonSerializer(); this.Items = (IndexItems)serializer.Deserialize(file, typeof(IndexItems)); } } catch (System.Exception) { } }
public Index() { this.Items = new IndexItems(); }