/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override async void Initialize() { var dte = (DTE)GetService(typeof(DTE)); var runningDocumentTable = new RunningDocumentTable(this); var documentFormatService = new BeautifierFormatService(dte); plugin = new FormatDocumentOnBeforeSave(dte, runningDocumentTable, documentFormatService); runningDocumentTable.Advise(plugin); base.Initialize(); }
public FormatDocumentOnBeforeSave(DTE dte, RunningDocumentTable runningDocumentTable, BeautifierFormatService documentFormatter) { this.runningDocumentTable = runningDocumentTable; this.documentFormatter = documentFormatter; this.dte = dte; }