private void AddNewTaskB_Click(object sender, EventArgs e) { string newTaskName = this.NewTaskNameTB.Text; tasks.SetData(tasksManager.AddTask(new CLTask(newTaskName, false), tasks)); RefreshTasksListDataGridRows(); }
public int SendDataToClient([FromQuery] string connectionId) { Console.WriteLine("Sending data to connection id: {0}", connectionId); MyHubConnector viewConnector = new MyHubConnector(m_MyHubContext, connectionId); Task task = new Task(() => { Thread.Sleep(10000); GeneralData generalData = new GeneralData { SomeId = Guid.NewGuid(), SomeId2 = Guid.NewGuid(), SomeId3 = Guid.NewGuid(), SomeString = "Hello world" }; Task sendGeneralDataTask = viewConnector.SendGeneralData(generalData); sendGeneralDataTask.Wait(); Console.WriteLine("Done sending the current loaded trip plan"); }); m_TasksManager.AddTask(task, connectionId); return(0); }