<commit_before>﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Signum.Entities.Scheduler;
using Signum.Windows.Scheduler;
using Signum.Windows.Processes;
using Signum.Windows.Operations;
using System.Windows.Media.Imaging;
using System.Reflection;
using System.Windows.Media;
using Signum.Utilities;
using Signum.Services;

namespace Signum.Windows.Scheduler
{
    public static class SchedulerClient
    {
        public static void Start()
        {
            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                Navigator.AddSettings(new List<EntitySettings>()
                {              
                    new EntitySettings<ScheduledTaskEntity> { View = e => new ScheduledTask(), Icon = Image("clock.png") },

                    new EntitySettings<SimpleTaskSymbol> { View = e => new SimpleTask(), Icon = Image("simpleTask.png") },
                    new EntitySettings<ScheduledTaskLogEntity> { View = e => new ScheduledTaskLog(), Icon = Image("scheduledTaskLog.png") },
                    
                    new EntitySettings<ScheduleRuleMonthsEntity> { View = e => new ScheduleRuleMonths() },
                    new EntitySettings<ScheduleRuleWeekDaysEntity> { View = e => new ScheduleRuleWeekDays() },
                    new EntitySettings<ScheduleRuleMinutelyEntity> { View = e => new ScheduleRuleMinutely() },
                    new EntitySettings<HolidayCalendarEntity> { View = e => new HolidayCalendar() },
                });

                Server.SetSymbolIds<SimpleTaskSymbol>();

                var executeGroup = new EntityOperationGroup
                {
                    Background = Brushes.Gold,
                    AutomationName = "execute",
                    Text = () => TaskMessage.Execute.NiceToString() + "...",
                };

                OperationClient.AddSetting(new EntityOperationSettings<ITaskEntity>(TaskOperation.ExecuteSync) { Icon = Image("execute.png"), Group = executeGroup });
                OperationClient.AddSetting(new EntityOperationSettings<ITaskEntity>(TaskOperation.ExecuteAsync) { Icon = Image("execute.png"), Group = executeGroup });
            }
        }

        static BitmapSource Image(string name)
        {<commit_msg>fix ITaskOperation<commit_after>﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Signum.Entities.Scheduler;
using Signum.Windows.Scheduler;
using Signum.Windows.Processes;
using Signum.Windows.Operations;
using System.Windows.Media.Imaging;
using System.Reflection;
using System.Windows.Media;
using Signum.Utilities;
using Signum.Services;

namespace Signum.Windows.Scheduler
{
    public static class SchedulerClient
    {
        public static void Start()
        {
            if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod()))
            {
                Navigator.AddSettings(new List<EntitySettings>()
                {              
                    new EntitySettings<ScheduledTaskEntity> { View = e => new ScheduledTask(), Icon = Image("clock.png") },

                    new EntitySettings<SimpleTaskSymbol> { View = e => new SimpleTask(), Icon = Image("simpleTask.png") },
                    new EntitySettings<ScheduledTaskLogEntity> { View = e => new ScheduledTaskLog(), Icon = Image("scheduledTaskLog.png") },
                    
                    new EntitySettings<ScheduleRuleMonthsEntity> { View = e => new ScheduleRuleMonths() },
                    new EntitySettings<ScheduleRuleWeekDaysEntity> { View = e => new ScheduleRuleWeekDays() },
                    new EntitySettings<ScheduleRuleMinutelyEntity> { View = e => new ScheduleRuleMinutely() },
                    new EntitySettings<HolidayCalendarEntity> { View = e => new HolidayCalendar() },
                });

                Server.SetSymbolIds<SimpleTaskSymbol>();

                var executeGroup = new EntityOperationGroup
                {
                    Background = Brushes.Gold,
                    AutomationName = "execute",
                    Text = () => ITaskMessage.Execute.NiceToString() + "...",
                };

                OperationClient.AddSetting(new EntityOperationSettings<ITaskEntity>(ITaskOperation.ExecuteSync) { Icon = Image("execute.png"), Group = executeGroup });
                OperationClient.AddSetting(new EntityOperationSettings<ITaskEntity>(ITaskOperation.ExecuteAsync) { Icon = Image("execute.png"), Group = executeGroup });
            }
        }

        static BitmapSource Image(string name)
        {
{'fraction_non_alphanumeric': 0.10013003901170352, 'fraction_numerical': 0.0, 'mean_word_length': 2.3686131386861313, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5007845', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1082, 'n_words': 233}