Sourcecode in Geodatabase Prototype
I’ve written a proof of concept editor extension based on the ideas outlined in my previous post, plus some helpful feedback from Brian Flood (thanks!).
The solution, which includes an installer and test file gdb, has been uploaded to arcscripts, right here.
The editor extension maintains a generic List of IExtensions. The extensions in this list are instantiated at OnStartEditing from source code in a table called SourceCode in the edit workspace.
There is also a command provided on a commandbar that allows you to browse and load a source .cs file into the SourceCode table, after verifying that it compiles without errors.
Note that the “using” statements need to include a full path name to the assembly files referenced by the source code.
I’m wondering if this approach might be easier than class extensions as well as easier to maintain. I haven’t tried it, but I suppose it would be possible to have it work with shapefiles as well.
The potential uses of dynamic compilation are intriguing. I’d really like to try this in a IServerObjectExtension. More on that later.