~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
using System;
28
28
using MonoDevelop.Ide.CustomTools;
29
 
using System.CodeDom.Compiler;
30
29
using MonoDevelop.Projects;
31
 
using System.IO;
32
 
using Mono.TextTemplating;
33
30
using MonoDevelop.Core;
34
 
using System.Threading;
35
31
 
36
32
namespace MonoDevelop.TextTemplating
37
33
{
40
36
                public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
41
37
                {
42
38
                        return new ThreadAsyncOperation (delegate {
43
 
                                using (var host = new MonoDevelopTemplatingHost ()) {
44
 
                                        
 
39
                                using (var host = new ProjectFileTemplatingHost (file)) {
 
40
                                        host.AddMonoDevelopHostImport ();
45
41
                                        var defaultOutputName = file.FilePath.ChangeExtension (".cs"); //cs extension for VS compat
46
42
                                        
47
43
                                        string ns = TextTemplatingFilePreprocessor.GetNamespaceHint (file, defaultOutputName);
52
48
                                        result.Errors.AddRange (host.Errors);
53
49
                                        
54
50
                                        foreach (var err in host.Errors)
55
 
                                                monitor.Log.WriteLine (err.ToString ());
 
51
                                                monitor.Log.WriteLine (err);
56
52
                                }
57
53
                        }, result);
58
54
                }