I've got a Visual Studio extension, where much of the functionality is written through MEF. So far, my individual functionality is per ITextBuffer
, so I have used the Properties member to cache instances.
However, now I have some functionality that needs to be per-project and per-solution. The EnvDTE classes offer a Properties object but I couldn't figure out whether or not they could store my own arbitrary data. I really don't want to make my own data static.
How can I store per-project and per-solution data without having to resort to global variables?
Edit:
I might also mention that since you can't use MEF imports for static data, even if you hide it in something like a Singleton, then using the global variable route is physically impossible. So I really, really need something that is not a global.
Edit:
I'm talking about object references, not persistent values. I don't need to store anything in a solution or project file, only with the object.