Exemplo n.º 1
0
        private void AddTask(ITask task, string name, AddType type)
        {
            bool added = false;

            switch (type)
            {
            case AddType.Before:
                added = _taskManager.AddBefore(task, name);
                break;

            case AddType.After:
                added = _taskManager.AddAfter(task, name);
                break;

            case AddType.Replace:
                added = _taskManager.Replace(name, task);
                break;
            }
            if (!added)
            {
                Log.ErrorFormat("[Summoner] Fail to add \"{0}\".", name);
                BotManager.Stop();
            }
        }