فهرست منبع

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]);
+                    }
                 }
             }
         }