public ShowHistory() { InitializeComponent(); historyJson = new HistoryJson(); historyJson.GetHistory(); this.DataContext = historyJson; }
public dynamic sendHistoryData(string json) { HistoryJson hj = new HistoryJson(); hj.id = "HistoryData"; hj.json = json; return(hj); }
private IHistory convertJsonHistory(HistoryJson historyJson) { if (historyJson == null) { return(new History.History()); } return(new History.History(historyJson.History, historyJson.AlreadyRead, historyJson.LastId)); }
public IHistory Read(string path) { if (File.Exists(_defaultRepertory + path)) { try { using (StreamReader sr = new StreamReader(_defaultRepertory + path)) { string line = sr.ReadToEnd(); HistoryJson historyJson = JsonConvert.DeserializeObject <HistoryJson>(line); return(convertJsonHistory(historyJson)); } } catch (Exception e) { } return(new History.History()); } using var f = File.Create(_defaultRepertory + path); return(new History.History()); }
/// <summary> /// invokes <see cref="ReadHistoryJson"/> and then <see cref="CalculateEndResult"/> /// </summary> public MultiMatch(HistoryJson historyJson) { ReadHistoryJson(); CalculateEndResult(); }