Esempio n. 1
0
        public static Task NewTask(this XafApplication application, TaskStatus taskStatus)
        {
            using var objectSpace = application.CreateObjectSpace();
            var task = objectSpace.NewTask(taskStatus);

            objectSpace.CommitChanges();
            return(task);
        }
Esempio n. 2
0
        public static Task NewTask(this IObjectSpace objectSpace, TaskStatus taskStatus, int index = 0)
        {
            var task = objectSpace.CreateObject <Task>();

            task.Subject     = $"Subject{index}";
            task.Description = "Description";
            task.StartDate   = DateTime.Now.AddMinutes(1);
            task.DueDate     = DateTime.Now.AddMinutes(2);
            task.Status      = taskStatus;
            return(task);
        }
        public static async Task <IList <(Task task, global::Google.Apis.Tasks.v1.Data.Task cloudTask)> > CreateExistingObjects(
            this XafApplication application, string title, TaskStatus taskStatus = TaskStatus.InProgress, int count = 1)
        {
            var credential = await application.AuthorizeTestGoogle();

            var tasksService = credential.NewService <global::Google.Apis.Tasks.v1.TasksService>();
            var folder       = await tasksService.GetTaskList(TasksFolderName, true);

            await tasksService.DeleteAllTasks(folder.Id);

            return(await Observable.Range(0, count).SelectMany(i => tasksService.NewTaskListTasks(1, folder.Id, title)
                                                               .Select((cloudTask, i1) => (application.NewTask(taskStatus, i1), cloudTask))).Buffer(count));
        }
Esempio n. 4
0
        public static async Task <IList <(Task task, OutlookTask outlookTask)> > CreateExistingObjects(
            this XafApplication application, string title, TaskStatus taskStatus = TaskStatus.InProgress, int count = 1)
        {
            var builder = await application.AuthorizeTestMS();

            var folder = await builder.Me.Outlook.TaskFolders.GetFolder(TasksFolderName, true);

            await builder.Me.Outlook.TaskFolders[folder.Id].DeleteAllTasks();

            return(await Observable.Range(0, count).SelectMany(i => {
                return builder.Me.Outlook.TaskFolders[folder.Id].NewFolderTasks(1, title)
                .SelectMany(lst => lst).Select(outlookTask1 => (application.NewTask(taskStatus), outlookTask1));
            }).Buffer(count));
        }
Esempio n. 5
0
 public static void Modify_Task <TTask>(this TTask task, DevExpress.Persistent.Base.General.TaskStatus projectTaskStatus, int i) where TTask : ITask
 {
     task.Subject = $"{nameof(Modify_Task)}{i}";
     task.Status  = projectTaskStatus;
 }
Esempio n. 6
0
 public static void Modify_Task <TTask>(this TTask task, TaskStatus projectTaskStatus, int i) where TTask : ITask
 {
     task.Subject = $"{nameof(Modify_Task)}{i}";
     task.Status  = projectTaskStatus;
 }