1
I'm writing a piece of software which requires the creation of a number of nearly identical blocks of code that only vary in a few locations which need to be replaced by a unique value for each specific instance.
I have the template for the block of code written out, as well as the list of values that need to be feed into the template. How can I automate this with out actually writing more code to do it? Do any text editors have this kind of functionality? I think MS Word's mail merge feature would work, but I'd rather keep my source code away from Word. That just feels wrong. I just downloaded Notepad++, but nothing is really jumping out at me. Also this is a C# project in visual studio so if I can do it in visual studio that would be even better.
In response to the suggestions regarding duplicating functionality I'm really not. The block of code I'm duplicating is below. It's a non-generic class which derives from a. I need to create a large number of these non-generic versions of the class that are associated with specific types. I have
[ComponentDescription("Document XXXXXX", "Returns the XXXXXX objects from the document")]
[DataContract]
public class DocumentXXXXXXCollection : DocumentElements<XXXXXX>
{
}
See my addition to the question – aireq – 2011-03-26T00:18:48.913