Tag Archives: TAP

Caching in a desktop application using ObjectCache and LocalDB

Last Wednesday I decided to convert my application’s caching from a file-based cache to a database-based cache implementation, mostly to try out LocalDB, which I had never used before. Unfortunately, due to power outages after that, I could only test … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Updates to my shared code

I’ve made several updates to my shared code, and the files in that share. I don’t think any of them justify an exclusive post for themselves, so I’m devoting this post to all of them (that I can remember) instead. … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

My Parallel TaskScheduler revisited

Recall my post A configurable TaskScheduler that can be changed by the user at runtime… Yesterday I used ILSpy (I don’t use Reflector because it is no longer free) to disassemble the built-in ThreadPoolTaskScheduler class, just out of curiosity. Some … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

How to start an external process that is associated with a file type, and bring it’s window to the front, in C#

I found a number of answers regarding how to do this online, but none worked exactly the way I wanted. This is because I actually have one extra requirement. That is, if the file type does not have an associated … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Putting it all together – Configurable TaskSchedulers that can be changed by the user at runtime

This will be my last post about TaskSchedulers and TaskFactories. It will be easier to understand this post if you have read my previous entries on implementing a custom TaskScheduler, but that is not a requirement, as all the relevant … Continue reading

Posted in Programming | Tagged , , , , , | 1 Comment

Getting more advanced knowledge is difficult

There was an annoying bug in my RomyView application the other day, a bug that caused what is in my mind, the worst kind of situation when it comes to asynchronous code: My code that populates a thumbnail cache item … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Spot the bug! An example of how to use the TaskCompletionSource<TResult> in C#

I have a habit of making several unrelated changes to projects around the same time. That works out fine in a controlled environment, like at work where there is source control, but it’s not so cool at home where I … Continue reading

Posted in Programming | Tagged , , , | 1 Comment

Reliably asynchronously reading and writing binary Streams in c# (Always check method call return values)

Every so often, I get brutally reminded not to think I am too clever. Indeed, one thing I’ve learned as a developer is that there is always more to learn, and I should be humble, because tomorrow, I will learn … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Having an async Task yield to the Windows Forms SynchronizationContext

There are issues with calling Task.Yield in Windows Forms, as explained by Stephen Toub on this forum post. Interestingly, I have the opposite problem to the guy complaining there. I have lots of async code, much of which frequently switches … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Updating the Windows Forms UI from async threads

There are many ways to update your UI from async ThreadPool threads. This is just one of them; my preferred way of doing so. These are my general purpose methods, in my base form class, for updating the UI from … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Some Extension Methods

Extension methods are, in my opinion, one of the best additions to the C# language. I’d been out of track with the various language improvements of the last few years, due to various reasons. (Playing with the language and trying … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Icon Files in c# – Part 2. Writing icon files

Welcome to part 2 of my c# icon file handling code. This one is about my IconFileWriter. Again, the source, for this and a whole bunch of other stuff, is here: RomyView.zip To be honest, I didn’t spend much time … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Concurrent asynchronous processing of all the files in a directory with support for cooperative pausing, in C#

The other day Stephen Toub of MSFT published a blog on cooperative pausing async methods. It’s an awesome post, and a much better way of pausing in async methods than what I was doing (which was a loop where I … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

A C# Windows Forms application that allows only one instance

A common requirement for application developers is an application that allows only a single instance. I can still remember the first time it came up for me. That was way back in the year 1999 – and I was a … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Timing methods in c# to see which implementation is faster

Update. Don’t use the method timing code posted here. A newer and much better version is here. I have been working on a “pet” project in c# for the last three years now… It’s an image viewer, video player (DirectShow), … Continue reading

Posted in Programming | Tagged , , , | Leave a comment