/// <summary> /// CalendarInfoDicにカレンダー情報を取得する /// </summary> /// <param name="calendarInfoDic"></param> internal Dictionary <int, object[]> GetCalendarInfoDic() { try { Dictionary <int, object[]> calendarInfoDic = new Dictionary <int, object[]>(); DbUtil util = DbUtil.GetInstance(); util.OnExecute = (SQLiteConnection con, SQLiteTransaction tran) => { string sql = "SELECT ID, CALENDARNAME, CALENDARVALUE, CDATE, CALENDARTYPE FROM CALENDAR_INFO ORDER BY ID"; using (SQLiteCommand command = new SQLiteCommand(sql, con)) { using (SQLiteDataReader reader = command.ExecuteReader()) { while (reader.Read()) { int id = int.Parse("" + reader.GetValue(0)); string name = "" + reader.GetValue(1); CalendarModel model = JsonConvert.DeserializeObject <CalendarModel>("" + reader.GetValue(2)); DateTime cdate = DateTime.Parse("" + reader.GetValue(3)); CalendarType calendarType = (CalendarType)reader.GetValue(4); if (calendarType == CalendarType.外部カレンダー) { var dic = AsyncUtil.RunSync(() => WebCalendarEditForm.GetCalendarValueFromWeb(null, model.Url, model.UrlParams, model.GetDelimitter(), model.EncodeType)); if (dic != null) { model.Value = dic; } } calendarInfoDic.Add(id, new object[] { name, model, cdate, calendarType }); } } } }; util.Execute(false); return(calendarInfoDic); } catch (Exception ex) { throw Program.ThrowException(ex); } }