ソースを参照

PDF EventBar 新增多活動並列顯示

ChingYi 8 ヶ月 前
コミット
8d6349fe6d
1 ファイル変更13 行追加3 行削除
  1. 13 3
      CMSCollection/CMSCollection.cs

+ 13 - 3
CMSCollection/CMSCollection.cs

@@ -70,6 +70,13 @@ namespace KdanCommon.CMSCollection
                 return _settingList.FirstOrDefault(s => s.SettingName == settingId);
         }
 
+        public async Task<List<ViewerEventBarSetting>> GetPdfEventBarSettings()
+        {
+            await LoadSettings();
+            lock (settingLock)
+                return _settingList.Where(s => s is ViewerEventBarSetting).Select(s => s as ViewerEventBarSetting).ToList();
+        }
+
         public async Task<List<WindowsCardSetting>> GetCardSettings()
         {
             await LoadSettings();
@@ -131,10 +138,13 @@ namespace KdanCommon.CMSCollection
             {
                 var jsonString = await result.Content.ReadAsStringAsync();
                 var response = JsonTool.DeserializeJSON<ViewerEventBarSettingResponse>(jsonString);
-                if (response != null && response.Data != null && response.Data.Length > 0)
+                if (response != null && response.Data != null)
                 {
-                    lock (settingLock)
-                        _settingList.Add(response.Data[0]);
+                    for (int i = 0; i < response.Data.Length; i++)
+                    {
+                        lock (settingLock)
+                            _settingList.Add(response.Data[i]);
+                    }
                 }
             }
         }