The way I do this is to use BBEdit, which can copy syntax-colored code to the Clipboard as RTF or HTML, either of which can then be pasted into the Gem editor (the latter using the HTML view). Further, I created a simple service that that handles all this automatically and virtually instantly - just select the code, right-click, and select the service in the context menu. Works for a wide variety of languages, too.
I'm doing all this on a Mac. If you're on a Linux or Windows machine, which I'm guessing is the case since you're writing in C#, you'll need to find different software that does the same thing. Does VS have an option to copy as formatted text? If not, I'd guess you can do it with a decent text editor like Notepad++, TextPad, or UltraEdit. (This is how I'm using BBEdit, since my IDE does not have a copy-as-formatted option.) I have no idea how to do the automation part, though... maybe PowerShell? Though, doing it manually isn't a killer if you're not doing it all the time.