Przeglądaj źródła

PDF EventBar 新增多活動並列顯示

ChingYi 8 miesięcy temu
rodzic
commit
8d6349fe6d
1 zmienionych plików z 13 dodań i 3 usunięć
  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]);
+                    }
                 }
             }
         }