remove init task
authorYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Tue, 19 Dec 2023 11:42:22 +0000 (12:42 +0100)
committerYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Fri, 22 Dec 2023 11:23:51 +0000 (12:23 +0100)
SettingCore/MenuGadget.cs
SettingCore/Sections.cs

index 6068a1458958bb0d8e4f3cbdcc3f55b24825ddd2..1e99801db10effa74293aa9e09464f16bebc633a 100644 (file)
@@ -73,8 +73,6 @@ namespace SettingCore
 
                 if (cust.IsVisible && section != null)
                 {
-                    await section.Init;
-
                     await CoreApplication.Post(() =>
                     {
                         section.CreateItem.Invoke();
index 83c190b1bd24ee366a013a40a761731479d4a3ea..45376eed243651e0dabb668b658e71d135644534 100644 (file)
@@ -34,23 +34,13 @@ namespace SettingCore
             return false;
         }
 
-        public void Add(string menuPath, Action action, Task task = null)
+        public void Add(string menuPath, Action action)
         {
             menuPath = menuPath.ToLowerInvariant();
             sectionList.Add(new Section
             {
                 MenuPath = menuPath,
                 CreateItem = action,
-                Init = task is null ? Task.CompletedTask : InitAsync(task),
-            });
-        }
-
-        private Task InitAsync(Task task)
-        {
-            return Task.Run(async () =>
-            {
-                await task;
-                return true;
             });
         }
 
@@ -97,8 +87,7 @@ namespace SettingCore
         public class Section
         {
             public string MenuPath { get; set; }
-            public Action CreateItem { get; set; } 
-            public Task Init { get; set; }
+            public Action CreateItem { get; set; }
         }
     }
 }