예제 #1
0
        public void SkipCurrentTask(string profileName)
        {
            CharacterProfile profile = GetProfileByName(profileName);

            if (profile != null)
            {
                if (!profile.IsRunning || profile.IsPaused)
                {
                    profile.Log("Could not skip current task because profile is not running or is paused.");
                    return;
                }

                BMTask currentTask = profile.TaskManager.CurrentTask;
                if (currentTask == null)
                {
                    profile.Log("Could not skip current task because there is no task running.");
                }
                else
                {
                    currentTask.Stop();
                    profile.Log("Skipping the \"{0}\" task.", currentTask.Name);
                }
            }
            else
            {
                Log.Write("Could not find a profile with the name: {0}", profileName);
            }
        }
        private void SkipTaskMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var    profile     = (CharacterProfile)((MenuItem)sender).Tag;
            BMTask currentTask = profile.TaskManager.Tasks.FirstOrDefault(t => !t.IsDone);

            if (currentTask != null)
            {
                currentTask.Stop();
            }
        }
        public void SkipCurrentTask(string profileName)
        {
            CharacterProfile profile = GetProfileByName(profileName);

            if (profile != null)
            {
                BMTask currentTask = profile.Tasks.FirstOrDefault(t => !t.IsDone);
                if (currentTask != null)
                {
                    currentTask.Stop();
                }
            }
        }