コード例 #1
0
        public ShowHistory()
        {
            InitializeComponent();

            historyJson = new HistoryJson();
            historyJson.GetHistory();
            this.DataContext = historyJson;
        }
コード例 #2
0
    public dynamic sendHistoryData(string json)
    {
        HistoryJson hj = new HistoryJson();

        hj.id   = "HistoryData";
        hj.json = json;
        return(hj);
    }
コード例 #3
0
ファイル: ReadHistory.cs プロジェクト: Ju-Pierlot/GameBook
 private IHistory convertJsonHistory(HistoryJson historyJson)
 {
     if (historyJson == null)
     {
         return(new History.History());
     }
     return(new History.History(historyJson.History, historyJson.AlreadyRead, historyJson.LastId));
 }
コード例 #4
0
ファイル: ReadHistory.cs プロジェクト: Ju-Pierlot/GameBook
 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());
 }
コード例 #5
0
ファイル: MultiplayerMatch.cs プロジェクト: Blade12629/GAFBot
 /// <summary>
 /// invokes <see cref="ReadHistoryJson"/> and then <see cref="CalculateEndResult"/>
 /// </summary>
 public MultiMatch(HistoryJson historyJson)
 {
     ReadHistoryJson();
     CalculateEndResult();
 }