Esempio n. 1
0
 public IEnumerable<TaskToken> Parse(Task task)
 {
     return task.Content.Split(',')
         .Select(ParseToken)
         .Where(token => token != null)
         .ToList();
 }
Esempio n. 2
0
 public TaskViewModel(Task model, IDiagram widget, IMessagingService messagingService)
 {
     _widget = widget;
     _messagingService = messagingService;
     Model = model;
     ToggleCompletedCommand = new CaptionCommand<string>("¨", OnToggleCompleted);
 }
Esempio n. 3
0
 public IEnumerable<TaskToken> Parse(Task task)
 {
     if (string.IsNullOrEmpty(task.Content)) return null;
     return task.Content.Split(',')
         .Select(ParseToken)
         .Where(token => token != null)
         .ToList();
 }
Esempio n. 4
0
 public TaskViewModel(Task model, TaskType taskType, TaskEditorViewModel widget, IMessagingService messagingService)
 {
     _taskType = taskType;
     _widget = widget;
     _messagingService = messagingService;
     Model = model;
     ToggleCompletedCommand = new CaptionCommand<string>("¨", OnToggleCompleted);
     ExecuteCommand = new DelegateCommand<string>(OnCommandExecute);
 }
Esempio n. 5
0
 public Task AddNewTask(int taskTypeId, string taskContent)
 {
     if (taskTypeId == 0) return null;
     var task = new Task { Content = taskContent, TaskTypeId = taskTypeId };
     var tokens = _taskParser.Parse(task);
     foreach (var taskToken in tokens)
         task.TaskTokens.Add(taskToken);
     SaveTask(task);
     return task;
 }
Esempio n. 6
0
 public string GetCommandValue(Task task)
 {
     var value = CommandValue;
     if (!string.IsNullOrWhiteSpace(CommandValue) && Regex.IsMatch(value, "\\[(.*)\\]"))
     {
         value = Regex.Match(value, "\\[(.*)\\]").Groups[1].Value;
         value = task.GetCustomDataValue(value);
     }
     return value;
 }
Esempio n. 7
0
 public Task AddNewTask(int taskTypeId, string taskContent, Dictionary<string, string> customFields, bool saveTask)
 {
     if (taskTypeId == 0) return null;
     var task = new Task { Content = taskContent, TaskTypeId = taskTypeId };
     var tokens = _taskParser.Parse(task);
     if (tokens != null)
     {
         foreach (var taskToken in tokens)
             task.TaskTokens.Add(taskToken);
     }
     foreach (var customField in customFields)
     {
         task.UpdateCustomDataValue(customField.Key, customField.Value);
     }
     if (saveTask) SaveTask(task);
     return task;
 }
Esempio n. 8
0
 public void SaveTask(Task task)
 {
     _taskDao.SaveTask(task);
 }
Esempio n. 9
0
 public void SaveTask(Task task)
 {
     Dao.Save(task);
 }
Esempio n. 10
0
 private void ExecuteCommand(Task task, TaskCommand command, dynamic dataObject)
 {
     dataObject.AutomationCommandName = command.CommandName;
     dataObject.CommandValue = command.GetCommandValue(task);
     _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted, dataObject);
 }
Esempio n. 11
0
 private void ExecuteCommands(IEnumerable<TaskCommand> commands, Task task)
 {
     var dataObject = new ExpandoObject();
     foreach (var command in commands)
     {
         ExecuteCommand(task, command, dataObject);
     }
 }
Esempio n. 12
0
 public void ExecuteTaskCommand(Task task, string commandName)
 {
     var command = Settings.TaskCommandList.FirstOrDefault(x => x.DisplayName == commandName);
     if (command != null) ExecuteCommand(task, command, new ExpandoObject());
 }
Esempio n. 13
0
 public void ExecuteTaskCreateCommands(Task task)
 {
     ExecuteCommands(Settings.TaskCreateCommandList, task);
 }
Esempio n. 14
0
 private void ExecuteCommands(IEnumerable<TaskCommand> commands, Task task)
 {
     foreach (var command in commands)
     {
         ExecuteCommand(task, command);
     }
 }
Esempio n. 15
0
 private void ExecuteCommand(Task task, TaskCommand command)
 {
     _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted,
                                   new
                                       {
                                           AutomationCommandName = command.CommandName,
                                           CommandValue = command.GetCommandValue(task)
                                       });
 }
Esempio n. 16
0
 public TaskViewModel(Task model, IDiagram widget)
 {
     _widget = widget;
     Model = model;
     ToggleCompletedCommand = new CaptionCommand<string>("£", OnToggleCompleted);
 }