예제 #1
0
        /// <summary>
        /// Is called after every page load.
        /// TODO: don't execute all tasks every PostLoad due to performance?
        /// </summary>
        /// <param name="acc">Account</param>
        private static void PostLoadTasks(Account acc)
        {
            var tasks = PostLoadHelper.GetPostLoadTasks(acc);

            for (int i = 0; i < tasks.Count; i++)
            {
                try
                {
                    tasks[i].Invoke();
                }
                catch (Exception e)
                {
                    acc.Wb.Log($"Error in {i + 1}. PreTask", e);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Is called after every page load.
        /// TODO: don't execute all tasks every PostLoad due to performance?
        /// </summary>
        /// <param name="acc">Account</param>
        private static void PostLoadTasks(Account acc)
        {
            var tasks = PostLoadHelper.GetPostLoadTasks(acc);

            for (int i = 0; i < tasks.Count; i++)
            {
                try
                {
                    tasks[i].Invoke();
                }
                catch (Exception e)
                {
                    if (acc.Wb != null)
                    {
                        acc.Wb.Log($"Error executing pre-task {PostLoadHelper.namePostTask[i]}!", e);
                    }
                }
            }
        }