public void AddTrackToQueue(IPlayable playable, TimeSpan duration) { QueueItems.Add(new QueueItem { Playable = playable, Duration = duration }); playable.IsQueued = true; }
public async Task <IActionResult> PutQueueItems(int id, QueueItems queueItems) { if (id != queueItems.Id) { return(BadRequest()); } _context.Entry(queueItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QueueItemsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Account = new Account(this); Logs = new Logs(this); RobotsService = new RobotsService(this); Stats = new Stats(this); Status = new Status(this); Alerts = new Alerts(this); Assets = new Assets(this); AuditLogs = new AuditLogs(this); Environments = new Environments(this); Jobs = new Jobs(this); OrganizationUnits = new OrganizationUnits(this); Permissions = new Permissions(this); Processes = new Processes(this); ProcessSchedules = new ProcessSchedules(this); QueueDefinitions = new QueueDefinitions(this); QueueItemComments = new QueueItemComments(this); QueueItemEvents = new QueueItemEvents(this); QueueItems = new QueueItems(this); QueueProcessingRecords = new QueueProcessingRecords(this); Queues = new Queues(this); Releases = new Releases(this); RobotLogs = new RobotLogs(this); Robots = new Robots(this); Roles = new Roles(this); Sessions = new Sessions(this); Settings = new Settings(this); Tenants = new Tenants(this); UserLoginAttempts = new UserLoginAttempts(this); Users = new Users(this); BaseUri = new System.Uri("http://localhost:6234"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); }
public async Task <ActionResult <QueueItems> > PostQueueItems(QueueItems queueItems) { _context.Queueitems.Add(queueItems); await _context.SaveChangesAsync(); //return CreatedAtAction("GetTodoItem", new { id = todoItem.Id }, todoItem); return(CreatedAtAction(nameof(GetQueueitems), new { id = queueItems.Id }, queueItems)); }
public Task OnQueueData(QueueData data) { QueueItems.Clear(); foreach (var item in data.Items) { QueueItems.Add(new DisplayQueueDirectory(item)); } return(Task.FromResult(0)); }
public Task OnQueueUpdate(QueueUpdate update) { if (update.Item == null) { // ディレクトリに対する操作 if (update.Type == UpdateType.Add) { QueueItems.Add(new DisplayQueueDirectory(update.Directory)); } else { var dir = QueueItems.FirstOrDefault(d => d.Path == update.DirPath); if (dir != null) { if (update.Type == UpdateType.Remove) { QueueItems.Remove(dir); } else { QueueItems[QueueItems.IndexOf(dir)] = new DisplayQueueDirectory(update.Directory); } } } } else { // ファイルに対する操作 var dir = QueueItems.FirstOrDefault(d => d.Path == update.DirPath); if (dir != null) { if (update.Type == UpdateType.Add) { dir.Items.Add(update.Item); } else { var file = dir.Items.FirstOrDefault(f => f.Path == update.Item.Path); if (file != null) { if (update.Type == UpdateType.Remove) { dir.Items.Remove(file); } else // Update { dir.Items[dir.Items.IndexOf(file)] = update.Item; } } } } } return(Task.FromResult(0)); }
public CollectionCrawlingQueueProxy(InitializationLink initializationLink, ICollection <ResourceLink> resourceLinks, params CollectionCrawlingQueueProxy[] dependencies) : base(dependencies) { if (initializationLink != null) { InitializationLink = initializationLink; } foreach (var resourceLink in resourceLinks) { QueueItems.Add(new CrawlingQueueItem(resourceLink)); } }
static void Main(string[] args) { IAsyncEnumerable<Task<int>> asyncEnumerable = Enumerable.Empty<Task<int>>().ToAsyncEnumerable(); IAsyncEnumerable<int> enumerable = Task.FromResult(4).ToAsyncEnumerable(); var queueItems = new QueueItems(); //.Select(async i => //{ // Console.WriteLine("inside "+i); // await Task.Delay(2000); // return i; //}) queueItems .Do(x => Console.WriteLine(DateTime.Now)) .ForEachAsync(x => Console.WriteLine("out " + x)); Console.ReadLine(); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Account = new Account(this); Token = new Token(this); DirectoryService = new DirectoryService(this); FoldersNavigation = new FoldersNavigation(this); Licensing = new Licensing(this); Logs = new Logs(this); Maintenance = new Maintenance(this); RobotsService = new RobotsService(this); Stats = new Stats(this); Status = new Status(this); TestAutomation = new TestAutomation(this); TestDataQueueActions = new TestDataQueueActions(this); Translations = new Translations(this); TaskForms = new TaskForms(this); Alerts = new Alerts(this); Assets = new Assets(this); AuditLogs = new AuditLogs(this); Buckets = new Buckets(this); Calendars = new Calendars(this); CredentialStores = new CredentialStores(this); Environments = new Environments(this); ExecutionMedia = new ExecutionMedia(this); Folders = new Folders(this); HostLicenses = new HostLicenses(this); Jobs = new Jobs(this); JobTriggers = new JobTriggers(this); Libraries = new Libraries(this); LicensesNamedUser = new LicensesNamedUser(this); LicensesRuntime = new LicensesRuntime(this); Machines = new Machines(this); MessageTemplates = new MessageTemplates(this); OrganizationUnits = new OrganizationUnits(this); Permissions = new Permissions(this); Processes = new Processes(this); ProcessSchedules = new ProcessSchedules(this); QueueDefinitions = new QueueDefinitions(this); QueueItemComments = new QueueItemComments(this); QueueItemEvents = new QueueItemEvents(this); QueueItems = new QueueItems(this); QueueProcessingRecords = new QueueProcessingRecords(this); Queues = new Queues(this); Releases = new Releases(this); RobotLogs = new RobotLogs(this); Robots = new Robots(this); Roles = new Roles(this); Sessions = new Sessions(this); Settings = new Settings(this); TaskActivities = new TaskActivities(this); TaskCatalogs = new TaskCatalogs(this); TaskNotes = new TaskNotes(this); Tasks = new Tasks(this); Tenants = new Tenants(this); TestCaseDefinitions = new TestCaseDefinitions(this); TestCaseExecutions = new TestCaseExecutions(this); TestDataQueueItems = new TestDataQueueItems(this); TestDataQueues = new TestDataQueues(this); TestSetExecutions = new TestSetExecutions(this); TestSets = new TestSets(this); TestSetSchedules = new TestSetSchedules(this); UserLoginAttempts = new UserLoginAttempts(this); Users = new Users(this); Webhooks = new Webhooks(this); GenericTasks = new GenericTasks(this); BaseUri = new System.Uri("https://cloud.uipath.com"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Account = new Account(this); Logs = new Logs(this); RobotsService = new RobotsService(this); Stats = new Stats(this); Status = new Status(this); Translations = new Translations(this); Alerts = new Alerts(this); Assets = new Assets(this); AuditLogs = new AuditLogs(this); Environments = new Environments(this); ExecutionMedia = new ExecutionMedia(this); HostLicenses = new HostLicenses(this); Jobs = new Jobs(this); Libraries = new Libraries(this); LicensesNamedUser = new LicensesNamedUser(this); LicensesRuntime = new LicensesRuntime(this); Machines = new Machines(this); MessageTemplates = new MessageTemplates(this); Permissions = new Permissions(this); Processes = new Processes(this); ProcessSchedules = new ProcessSchedules(this); QueueDefinitions = new QueueDefinitions(this); QueueItemComments = new QueueItemComments(this); QueueItemEvents = new QueueItemEvents(this); QueueItems = new QueueItems(this); QueueProcessingRecords = new QueueProcessingRecords(this); Queues = new Queues(this); Releases = new Releases(this); RobotLogs = new RobotLogs(this); Robots = new Robots(this); Roles = new Roles(this); Sessions = new Sessions(this); Settings = new Settings(this); Tenants = new Tenants(this); UserLoginAttempts = new UserLoginAttempts(this); Users = new Users(this); Webhooks = new Webhooks(this); BaseUri = new System.Uri("https://platform.uipath.com"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); }
public void RemoveQueueItem(QueueItem queueItem) { QueueItems.Remove(queueItem); queueItem.Playable.IsQueued = false; }
public void RemoveTrackFromQueue(IPlayable playable) { RemoveQueueItem(QueueItems.First(x => x.Playable == playable)); }
public void AddTrackToQueue(IPlayable playable) { QueueItems.Add(new QueueItem { Playable = playable }); }