public IEnumerable<TaskToken> Parse(Task task) { return task.Content.Split(',') .Select(ParseToken) .Where(token => token != null) .ToList(); }
public TaskViewModel(Task model, IDiagram widget, IMessagingService messagingService) { _widget = widget; _messagingService = messagingService; Model = model; ToggleCompletedCommand = new CaptionCommand<string>("¨", OnToggleCompleted); }
public IEnumerable<TaskToken> Parse(Task task) { if (string.IsNullOrEmpty(task.Content)) return null; return task.Content.Split(',') .Select(ParseToken) .Where(token => token != null) .ToList(); }
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); }
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; }
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; }
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; }
public void SaveTask(Task task) { _taskDao.SaveTask(task); }
public void SaveTask(Task task) { Dao.Save(task); }
private void ExecuteCommand(Task task, TaskCommand command, dynamic dataObject) { dataObject.AutomationCommandName = command.CommandName; dataObject.CommandValue = command.GetCommandValue(task); _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted, dataObject); }
private void ExecuteCommands(IEnumerable<TaskCommand> commands, Task task) { var dataObject = new ExpandoObject(); foreach (var command in commands) { ExecuteCommand(task, command, dataObject); } }
public void ExecuteTaskCommand(Task task, string commandName) { var command = Settings.TaskCommandList.FirstOrDefault(x => x.DisplayName == commandName); if (command != null) ExecuteCommand(task, command, new ExpandoObject()); }
public void ExecuteTaskCreateCommands(Task task) { ExecuteCommands(Settings.TaskCreateCommandList, task); }
private void ExecuteCommands(IEnumerable<TaskCommand> commands, Task task) { foreach (var command in commands) { ExecuteCommand(task, command); } }
private void ExecuteCommand(Task task, TaskCommand command) { _applicationState.NotifyEvent(RuleEventNames.AutomationCommandExecuted, new { AutomationCommandName = command.CommandName, CommandValue = command.GetCommandValue(task) }); }
public TaskViewModel(Task model, IDiagram widget) { _widget = widget; Model = model; ToggleCompletedCommand = new CaptionCommand<string>("£", OnToggleCompleted); }