public void SaveAppData(string JsonValue) { var Programmes = JsonConvert.DeserializeObject <Dictionary <string, object> > (JsonValue); for (int i = 0; i < Programmes.Count; i++) { Programme _Programme = new Programme(); _Programme.Name = Programmes.ElementAt(i).Key.ToString(); var ProgrammeDates = JsonConvert.DeserializeObject <Dictionary <string, object> > (Programmes.ElementAt(i).Value.ToString()); for (int j = 0; j < ProgrammeDates.Count; j++) { ProgDate _ProgrammeDate = new ProgDate(); _ProgrammeDate.Date = ProgrammeDates.ElementAt(j).Key.ToString(); var ProgrammeTimes = JsonConvert.DeserializeObject <Dictionary <string, object> > (ProgrammeDates.ElementAt(j).Value.ToString()); for (int k = 0; k < ProgrammeTimes.Count; k++) { ProgTime _ProgrammeTime = new ProgTime(); _ProgrammeTime.Time = ProgrammeTimes.ElementAt(k).Key.ToString(); var SongList = JsonConvert.DeserializeObject <Dictionary <string, object> > (ProgrammeTimes.ElementAt(k).Value.ToString()); for (int l = 0; l < SongList.Count; l++) { Song _Song = new Song(); var songData = JsonConvert.DeserializeObject <Dictionary <string, string> > (SongList.ElementAt(l).Value.ToString()); _Song.Title = songData.Where(a => a.Key.Contains("SongName")).First().Value.ToString(); _Song.Album = songData.Where(a => a.Key.Contains("Movie")).First().Value.ToString(); _Song.Artist = songData.Where(a => a.Key.Contains("Singers")).First().Value.ToString(); _Song.Year = songData.Where(a => a.Key.Contains("Year")).First().Value.ToString(); _Song.MusicDir = songData.Where(a => a.Key.Contains("MusicDirector")).First().Value.ToString(); _Song.Lyricist = songData.Where(a => a.Key.Contains("Lyricist")).First().Value.ToString(); _ProgrammeTime.Songlist.Add(_Song); // Instantiate (SongTemplate_prefab, song_Manager); // SongManager.instance.SongInfo [l].songDetail = _Song; // SongManager.instance.SongInfo [l].songDetail.Album = _Song.Album; // SongManager.instance.SongInfo [l].songDetail.Artist = _Song.Artist; // SongManager.instance.SongInfo [l].songDetail.ImgURL = _Song.ImgURL; // if (TimeToggle [0].isOn && _ProgrammeTime.Time == "AM") // SongManager.instance.SongInfo [l].AssignValuesAM (); // else if(TimeToggle [1].isOn && _ProgrammeTime.Time == "PM") // SongManager.instance.SongInfo [l].AssignValuesPM (); } _ProgrammeDate.Timelist.Add(_ProgrammeTime); TimeManager.instance.TimeInfo [k].programTime = _ProgrammeTime; TimeManager.instance.TimeInfo [k].Assign(); } _Programme.Datelist.Add(_ProgrammeDate); DateManager.instance.DateInfo [j].programDate = _ProgrammeDate; print(DateManager.instance.DateInfo [j].programDate); DateManager.instance.DateInfo [j].Assign(); } _AppData.ProgrammeList.Add(_Programme); } }
public string ToString(IEnumerable <ProgEnter> items) { var(d, d2) = GetProgDurationByHalf(items); return((Prog.Duration == 60 ? "#####ЧАС#####>" : "") + Prog.Name + " (" + (Prog.Duration == 60 ? (d + "," + d2) : d.ToString()) + " мин) : " + ProgDate.ToString() + " - " + Prog.Kind + " en:" + EndMinute.ToLongTimeString() + " [" + File + "]"); //" - распознаная метка -> " + jingle; }
public override string ToString() { return(Prog.Name + " (" + Prog.Duration + " мин) : " + ProgDate.ToString() + " - распознаная метка -> " + jingle); }