Note that there are some explanatory texts on larger screens.

plurals
  1. USsean
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThanks Eduardo. However, I'm not sure how this would work to solve my problem. Following the above snippet: The MyFoo instance would have to raise the above event (ProgressChanged) on the background worker, and then the event would updates the MyFoo.ProgressValue property value? The MyFoo instance can of course update its own property (as it does in the code I showed), the problem is that the ProgressBar in the UI does not update.
      singulars
    2. COThanks Matthieu, I thought about using that approach but due to the frequency of update it wasn't efficient enough for my needs. I ended up using an implementation that included a dictionary mapping items to their indexes in the queue, then having a method on the queue, UpdatePosition(Item item), that looks up the items index and then bubbled it to its new position. The queue then has an event that the items register against so that they notify the queue when their priorities change. That seems to work well.
      singulars
    3. COThanks Dav but this is a standard priority queue. If I add an item to the queue and it's priority is changed (outside of the queue), the order of the queue might be incorrect. In other words, a standard priority queue only sorts items when they are added to teh queue and not later. I need to implement a queue that updates as the priority of its items updates. P.S. It's not a homework problem, I need to implement this as part of some simulation software. I have some ideas of how I can implement it but want to see if there is a better way of doing it.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload