I did this recently, though I used a different action, not the default Open action.
First you find out file type of some extension, say .jpg:
var imgKey = Registry.ClassesRoot.OpenSubKey(".jpg")
var imgType = key.GetValue("");
Then you find out the path to your executable and build the "command string":
String myExecutable = Assembly.GetEntryAssembly().Location;
String command = "\"" + myExecutable + "\"" + " \"%1\"";
And register your executable to open files of that type:
String keyName = imgType + @"\shell\Open\command";
using (var key = Registry.ClassesRoot.CreateSubKey(keyName)) {
key.SetValue("", command);
}