“Will VS.NET also (like IDEA) be smart enough to give me a dropdown with appropriate values for the template-variables? That is, if the template calls for an IList somewhere, will it show a dropdown with all IList-type variables that are in scope at that time?"_
Note: If you’re interested in the basics of creating expansions, check out my first blog entry on expansions.
Back to Luke’s question, the answer is yes it will. In fact, the foreach
expansion does exactly that by showing objects that implement the IEnumerable interface
within the specific scope where the expansion was called. To do this, you can
When the expansion is invoked and the user tabs to the collection variable, they will see a list of IEnumerable collections.
The code section for the foreach expansion (below) is straighforward with the collection literal being declared the same as any other variable.