Open jcansdale opened 6 years ago
MEF importing constructors are now supported, but a little ceremony is required to use with Visual Studio services.
For example, it's now possible to do the following:
[Export] class DteTests { DTE dte; [ImportingConstructor] Foo(SVsServiceProvider sp) { this.dte = (DTE)sp.GetServiceProvider(typeof(DTE)); } void Test() { Console.WriteLine(dte.FileName); } }
It would be more convenient if we could instead do this:
class DteTests { DTE dte; Foo(DTE dte) { this.dte = dte; } void Test() { Console.WriteLine(dte.FileName); } }
There are other ways, but this could be a handy shortcut if a little setup is required.
MEF importing constructors are now supported, but a little ceremony is required to use with Visual Studio services.
For example, it's now possible to do the following:
It would be more convenient if we could instead do this:
There are other ways, but this could be a handy shortcut if a little setup is required.