Beispiel #1
0
        protected override void CommandAction(DTEHelper helper, Tuple <string, string[]> schemas)
        {
            EnvDTE.Document document = helper.GetOpenedDocumentInCodeWindow(FileOperations.SupportsXmlType);

            if (document != null)
            {
                ContentCoparerHelper.ReplaceXsdSchemaInDocument(document, schemas.Item2);
            }
        }
Beispiel #2
0
        protected override void CommandAction(DTEHelper helper, Tuple <string, string[]> schemas)
        {
            var listDocuments = helper.GetOpenedDocumentsAsDocument(FileOperations.SupportsXmlType).ToList();

            if (listDocuments.Any())
            {
                foreach (var document in listDocuments)
                {
                    ContentCoparerHelper.ReplaceXsdSchemaInDocument(document, schemas.Item2);
                }
            }
        }
Beispiel #3
0
        protected override void CommandAction(DTEHelper helper, Tuple <string, string[]> schemas)
        {
            var listFiles = helper.GetSelectedFilesInSolutionExplorer(FileOperations.SupportsXmlType, false);

            if (listFiles.Any())
            {
                foreach (var document in listFiles.Where(s => s.Document != null && s.Document.ActiveWindow != null && s.Document.ActiveWindow.Visible).Select(s => s.Document))
                {
                    ContentCoparerHelper.ReplaceXsdSchemaInDocument(document, schemas.Item2);
                }

                foreach (var filePath in listFiles.Where(s => !(s.Document != null && s.Document.ActiveWindow != null && s.Document.ActiveWindow.Visible)).Select(s => s.FilePath))
                {
                    ContentCoparerHelper.ReplaceXsdSchemaInFile(filePath, schemas.Item2);
                }
            }
        }