/// <summary>
 /// Destroys the <see cref="OutputWindowTraceListener"/> associated with <see cref="Debug"/>
 /// and <see cref="Trace"/>.
 /// </summary>
 private static void DestroyTraceListener()
 {
     Trace.Listeners.Remove(traceListener);
     traceListener = null;
 }
 /// <summary>
 /// Destroys the <see cref="OutputWindowTraceListener"/> associated with <see cref="Debug"/>
 /// and <see cref="Trace"/>.
 /// </summary>
 private static void DestroyTraceListener()
 {
     Trace.Listeners.Remove(traceListener);
     traceListener = null;
 }
 /// <summary>
 /// Creates a trace listener to redirect <see cref="Debug"/> and <see cref="Trace"/>
 /// logging to the <see cref="OutputWindow"/> of Visual Studio.
 /// </summary>
 private static void CreateTraceListener()
 {
     traceListener = new OutputWindowTraceListener("Transform text templates ");
     Trace.Listeners.Add(traceListener);
 }
        /// <summary>
        /// Saves content to a file and adds it to the Visual Studio <see cref="Project"/>,
        /// only if the file does not already exist.
        /// </summary>
        /// Suggestion made by ggreig in Nov 2008, with thanks
        //public static void RenderIfNotExists(string content, OutputInfo output, CompilerErrorCollection errors)
        //{
        //    TransformationContext.ReportErrors(errors);

        //    string templateDirectory = System.IO.Path.GetDirectoryName(TransformationContext.Host.TemplateFile);
        //    string outputFilePath = System.IO.Path.Combine(templateDirectory, output.File);

        //    if (!System.IO.File.Exists(outputFilePath))
        //    {
        //        TransformationContext.outputManager.Append(output, content, Host, Transformation);
        //    }
        //}

        #endregion

        #region private

        /// <summary>
        /// Creates a trace listener to redirect <see cref="Debug"/> and <see cref="Trace"/>
        /// logging to the <see cref="OutputWindow"/> of Visual Studio.
        /// </summary>
        private static void CreateTraceListener()
        {
            traceListener = new OutputWindowTraceListener("Transform text templates ");
            Trace.Listeners.Add(traceListener);
        }