예제 #1
0
        public PracticeViewModel(JsonValue json, IJsonContext ctx)
        {
            var dict = JsonDictionary.FromValue(json);

            items         = ctx.FromJson <List <PracticeItem> >(dict["items"]);
            nextItems     = ctx.FromJson <List <PracticeItem> >(dict["nextItems"]);
            failed        = ctx.FromJson <bool>(dict["failed"]);
            currentItem   = ctx.FromJson <PracticeItem>(dict["currentItem"]);
            currentIndex  = ctx.FromJson <int>(dict["currentIndex"]);
            itemCount     = ctx.FromJson <int>(dict["itemCount"]);
            score         = ctx.FromJson <int>(dict["score"]);
            round         = ctx.FromJson <int>(dict["round"]);
            lastRoundInfo = ctx.FromJson <RoundInfo>(dict["lastRoundInfo"]);
            allRounds     = new ObservableCollection <RoundInfo>(ctx.FromJson <List <RoundInfo> >(dict["allRounds"]));
            maxItemCount  = ctx.FromJson <int>(dict["maxItemCount"]);
            title         = ctx.FromJson <string>(dict["title"]);
        }
예제 #2
0
 public PracticeViewModel(JsonValue json, IJsonContext ctx)
 {
     var dict = JsonDictionary.FromValue(json);
     items = ctx.FromJson<List<PracticeItem>>(dict["items"]);
     nextItems = ctx.FromJson<List<PracticeItem>>(dict["nextItems"]);
     failed = ctx.FromJson<bool>(dict["failed"]);
     currentItem = ctx.FromJson<PracticeItem>(dict["currentItem"]);
     currentIndex = ctx.FromJson<int>(dict["currentIndex"]);
     itemCount = ctx.FromJson<int>(dict["itemCount"]);
     score = ctx.FromJson<int>(dict["score"]);
     round = ctx.FromJson<int>(dict["round"]);
     lastRoundInfo = ctx.FromJson<RoundInfo>(dict["lastRoundInfo"]);
     allRounds = new ObservableCollection<RoundInfo>(ctx.FromJson<List<RoundInfo>>(dict["allRounds"]));
     maxItemCount = ctx.FromJson<int>(dict["maxItemCount"]);
     title = ctx.FromJson<string>(dict["title"]);
 }
예제 #3
0
 void AddRoundInfo()
 {
     allRounds.Add(LastRoundInfo = new RoundInfo(allRounds.Count + 1, Score, ItemCount));
 }
예제 #4
0
 void AddRoundInfo()
 {
     allRounds.Add(LastRoundInfo = new RoundInfo(allRounds.Count + 1, Score, ItemCount));
 }