Beispiel #1
0
        protected override void CommandAction(DTEHelper helper)
        {
            EnvDTE.Document document = helper.GetOpenedDocumentInCodeWindow(FileOperations.SupportsXmlType);

            if (document != null &&
                (System.Windows.Clipboard.ContainsText(System.Windows.TextDataFormat.Text) || System.Windows.Clipboard.ContainsText(System.Windows.TextDataFormat.UnicodeText))
                )
            {
                string javaScriptCode = System.Windows.Clipboard.GetText();

                if (!string.IsNullOrEmpty(javaScriptCode))
                {
                    JavaScriptFetchXmlParser parser = new JavaScriptFetchXmlParser(helper, javaScriptCode);

                    System.Threading.Tasks.Task.Run(() => ContentComparerHelper.GetTextViewAndMakeActionAsync(document, "Pasting Xml from JavaScript", parser.PasteFetchXml));
                }
            }
        }