private void onTextDocumentKeyPressed(string Keypress, TextSelection Selection, bool InStatementCompletion) { if (m_settings.options.general.autoFormatWhenKeyPressed) { if (m_settings.options.general.handleNoneProjectFile == false && Selection.Parent.Parent.ProjectItem.Document == null) { return; } DocumentsMakerSingle documentsMaker = new DocumentsMakerSingle(m_serviceProvider, m_settings.options); documentsMaker.make(new DocumentsMakerSingle.KeyPressedData(Selection, Keypress)); } }
public override void Execute() { EnvDTE80.DTE2 dte2 = m_serviceProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE80.DTE2; List <Object> objects = new List <Object>(); if (dte2.ActiveDocument.ProjectItem.Document != null) { objects.Add(dte2.ActiveDocument.ProjectItem); } else if (m_settings.options.general.handleNoneProjectFile) { objects.Add(dte2.ActiveDocument.FullName); } IDocumentsMaker docMaker = new DocumentsMakerSingle(m_serviceProvider, m_settings.options); docMaker.make(objects); }
private void makeDocument(Document document) { List <Object> objects = new List <Object>(); if (document.ProjectItem.Document != null) { objects.Add(document.ProjectItem.Document); } else if (m_settings.options.general.handleNoneProjectFile) { objects.Add(document); } if (objects.Count > 0) { IDocumentsMaker docMaker = new DocumentsMakerSingle(m_serviceProvider, m_settings.options); docMaker.make(objects); } }