Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Threaded is now Tasked #7

Merged
merged 4 commits into from
May 12, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 11, 2020

I used ReSharper to implement some best practice recommendations. Then I implemented the Task pattern because modern recommendation is to never manually create Threads. The task handler decides how to run stuff on the threadpool. This should allow us to run our tasks in parallel. On a multi-monitor setup with many taskbars you should see all the icons moving together at the same time. Tasks also come with a CancellationToken feature made to handle the Thread.Abort situation gracefully. All tasks can cancel at the same time because they all share the token. This is more threadsafe than the boolean cancel flag I was using.

Run ReSharper Code Cleanup
Run Optimize References
Close All Sensible ReSharper Issues
 Implements loop canceling with timeout abort fallback
 Remove all EventHandlers!
 Set StartupObject
 Fix bug in OnUIAutomationEvent by casting to list
Make all threads in to tasks
Implement Cancelation Token
Convert foreach to Parallel.ForEach
for clarity
@mdhiggins mdhiggins merged commit 105413f into mdhiggins:threaded May 12, 2020
@mdhiggins
Copy link
Owner

Appreciate your contributions here. My experience with C# is limited so these changes have been very helpful and educational

@amynbe
Copy link

amynbe commented May 21, 2020

Hi, sorry to ask here, but is the issue tab disabled for this repo on purpose? I just wanted to ask whether it would be possible to programmatically disable the grouping of taskbar buttons, beyond what MS Windows proposes (they are still grouped even when you select "never" in taskbar properties, just not merged).
My ultimate goal is to reorder the taskbar windows in most recently used order.
Thanks.

@mdhiggins
Copy link
Owner

mdhiggins commented May 21, 2020 via email

@ghost
Copy link
Author

ghost commented May 23, 2020

@amynbe brings a good question. Did @mdhiggins disable Issues on purpose?

https://help.github.com/en/github/managing-your-work-on-github/disabling-issues

@mdhiggins
Copy link
Owner

Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants