Save file in Visual Studio 2015 package -


i'm working on first visual studio extension. managed setup event listener when file saved , modify file using docdata on way:

var docdata = new docdata(this, filename); var editoradaptersfactoryservice = (this.getservice(typeof(scomponentmodel)) icomponentmodel).getservice<ivseditoradaptersfactoryservice>(); var textbuffer = editoradaptersfactoryservice.getdatabuffer(docdata.buffer); textbuffer.replace(new span(0, textbuffer.currentsnapshot.length), content); 

the problem here after modify new file have save couldn't find examples how save file. inside documentsaved listener have envdte.document can call envdte.document.save() i'm trying save file, have full path of new file i'm trying save. though iterating on files in project looking specific file , there use available save() method in projectitem. tried using code in this answer didn't work.

any guidance on great!

with full path try

projectitem dte.solution.findprojectitem("fullpath") 

https://msdn.microsoft.com/en-us/library/envdte._solution.findprojectitem.aspx


Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -