public string GetJson() { var m = new QueryPlanModel() { PhysicalQueryPlanRows = this.PhysicalQueryPlanRows, LogicalQueryPlanRows = this.LogicalQueryPlanRows }; var json = Newtonsoft.Json.JsonConvert.SerializeObject(m, Newtonsoft.Json.Formatting.Indented); return(json); }
void ISaveState.Save(string filename) { var m = new QueryPlanModel() { PhysicalQueryPlanRows = this.PhysicalQueryPlanRows, LogicalQueryPlanRows = this.LogicalQueryPlanRows }; var json = Newtonsoft.Json.JsonConvert.SerializeObject(m, Newtonsoft.Json.Formatting.Indented); File.WriteAllText(filename + ".queryPlans", json); }
public void LoadJson(string data) { QueryPlanModel m = JsonConvert.DeserializeObject <QueryPlanModel>(data); PhysicalQueryPlanRows = m.PhysicalQueryPlanRows; LogicalQueryPlanRows = m.LogicalQueryPlanRows; NotifyOfPropertyChange(() => PhysicalQueryPlanRows); NotifyOfPropertyChange(() => LogicalQueryPlanRows); NotifyOfPropertyChange(() => CanExport); }
void ISaveState.Load(string filename) { filename = filename + ".queryPlans"; if (!File.Exists(filename)) { return; } this.IsChecked = true; string data = File.ReadAllText(filename); QueryPlanModel m = JsonConvert.DeserializeObject <QueryPlanModel>(data); PhysicalQueryPlanRows = m.PhysicalQueryPlanRows; LogicalQueryPlanRows = m.LogicalQueryPlanRows; NotifyOfPropertyChange(() => PhysicalQueryPlanRows); NotifyOfPropertyChange(() => LogicalQueryPlanRows); }
void ISaveState.Load(string filename) { filename = filename + ".queryPlans"; if (!File.Exists(filename)) { return; } _eventAggregator.PublishOnUIThread(new ShowTraceWindowEvent(this)); string data = File.ReadAllText(filename); QueryPlanModel m = JsonConvert.DeserializeObject <QueryPlanModel>(data); PhysicalQueryPlanRows = m.PhysicalQueryPlanRows; LogicalQueryPlanRows = m.LogicalQueryPlanRows; NotifyOfPropertyChange(() => PhysicalQueryPlanRows); NotifyOfPropertyChange(() => LogicalQueryPlanRows); }