To the VS write an extension to listen to music, the edge has been long, these two days to do a first edition, using the Watercress FM, first sent out.
Plug-ins are now only VS2013, and other versions need to be supported next.
Now there is only one adornment (that is, the one with the cover), a margin (at the bottom of the editor, ready for the lyrics, not done), a menu (the top menu), a toolbar (the toolbar, the cue to play).
Only completed the playback function, switching channels ready to do tomorrow, login function to follow up.
about the Watercress FM WPF program, has done a lot of people, here for two projects have a reference and continue to refer to, listed here: Soot Ash and Kfstorm
Now more disgusted with Di, IoC, but unknowingly used.
In fact, to do this vs extension is very simple, and the extension of the very few things, the application should do, here is what to do, but the program is not to write the main body.
But the follow-up to do a lot, first adornment this thing, should not be included in each textview, that is, should be a VS only this one appears, so here should not use the Iwpftextviewcreationlistener interface.
Then again, the extension is for vs extension, while opening several vs is common, you have to think of ways to make unified control and so on, with remoting or something.
Also need a tool window Master interface, need options Page, but also in the Quick Launch (Ctrl + Q) there to get a search song, plus lyrics, users, shortcut key support, and so on, the following may also increase the play local music and other functions, think there are many.
Also say back to MEF, in the original VSX project I maintained an IOC container myself, but the VS extension was originally using MEF, looked at a lot of projects, and finally found the following code snippet:
var componentmodel = (Icomponentmodel) _serviceprovider.getservice (typeof(Scomponentmodel)); var player = componentmodel.defaultexportprovider.getexportedvalue<iplayer> ();
Where _serviceprovider is the IServiceProvider interface object, the most common package in VSX is a iserviceprovider.
Of course, the classes exported using export, that is, the MEF component, can be injected directly using the import feature.
This project will not take me too much effort, only interest. It is hoped that those who are equally interested can continue to do so.
Here is the source code: Https://github.com/NanQi/VSXMusic
VSX-5 Vsxmusic Code listen to music