////////////////////////////////////////////////////////////////////////// /// <summary> /// Initialize the thread for NAnt process. /// </summary> /// <param name="targetNode">The target to run.</param> ////////////////////////////////////////////////////////////////////////// public void StartTarget() { if (!m_NAntProcess.IsWorking) { m_NAntProcess.Filename = m_Filename; m_NAntProcess.TargetNode = m_CurrentNode; // Sets focus to console VisualStudioUtils.ShowWindow(m_ApplicationObject, "Output"); m_NAntProcess.Start(); } }
////////////////////////////////////////////////////////////////////////// /// <summary> /// Select the line of NAntNode in the VisualStudio editor. /// </summary> /// <param name="nantNode">The node</param> ////////////////////////////////////////////////////////////////////////// public void SelectNodeLine() { // First load the file into VisualStudio VisualStudioUtils.ShowFile(m_ApplicationObject, m_Filename); // Refocus AddIn (lost while opening the file) VisualStudioUtils.ShowWindow(m_ApplicationObject, "NAntAddin"); // Display the node's line within the file VisualStudioUtils.ShowLine(m_ApplicationObject, m_Filename, m_CurrentNode.LineNumber, false); // Finally display the document VisualStudioUtils.ShowDocument(m_ApplicationObject, m_Filename); }
////////////////////////////////////////////////////////////////////////// /// <summary> /// </summary> ////////////////////////////////////////////////////////////////////////// public void Start() { // Initialize backround worker m_BackgroundWorker = new BackgroundWorker(); m_BackgroundWorker.WorkerReportsProgress = true; m_BackgroundWorker.WorkerSupportsCancellation = true; m_BackgroundWorker.DoWork += new DoWorkEventHandler(OnStart); m_BackgroundWorker.ProgressChanged += new ProgressChangedEventHandler(OnProgress); m_BackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(OnComplete); // Run task m_BackgroundWorker.RunWorkerAsync(); // Autoclear console, if required if (Properties.Settings.Default.NANT_CLEAR_OUTPUT) { VisualStudioUtils.GetConsole(m_ApplicationObject, "NAntAddin").Clear(); } // Trace start build WriteConsole(Environment.NewLine + "[NAntAddin]: Target '" + m_TargetNode["name"] + "' started..." + Environment.NewLine + Environment.NewLine); }
////////////////////////////////////////////////////////////////////////// /// <summary> /// </summary> ////////////////////////////////////////////////////////////////////////// public void WriteConsole(string message) { VisualStudioUtils.GetConsole(m_ApplicationObject, "NAntAddin").OutputString(message); }