~ubuntu-branches/ubuntu/natty/monodevelop/natty

« back to all changes in this revision

Viewing changes to src/addins/prj2make-sharp-lib/VS2003SlnFileFormat.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-03-29 23:36:33 UTC
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: james.westby@ubuntu.com-20080329233633-l550uuwvfh1e68at
Tags: upstream-1.0+dfsg
ImportĀ upstreamĀ versionĀ 1.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
                {
83
83
                        //if (!CanReadFile (fileName))
84
84
 
85
 
                        int choice = IdeApp.Services.MessageService.ShowCustomDialog (GettextCatalog.GetString ("Conversion required"),
86
 
                                GettextCatalog.GetString (
87
 
                                        "The solution file {0} is a VS2003 solution. It must be converted to either a MonoDevelop " + 
88
 
                                        "or a VS2005 solution. Converting to VS2005 format will overwrite existing files. Convert ?", fileName),
89
 
                                        "MonoDevelop", "VS2005", "Cancel");
 
85
                        int choice;
 
86
                        if (IdeApp.Services == null) {
 
87
                                // HACK, for mdtool
 
88
                                choice = 0;
 
89
                        } else {
 
90
                                choice = IdeApp.Services.MessageService.ShowCustomDialog (GettextCatalog.GetString ("Conversion required"),
 
91
                                        GettextCatalog.GetString (
 
92
                                                        "The solution file {0} is a VS2003 solution. It must be converted to either a MonoDevelop " + 
 
93
                                                        "or a VS2005 solution. Converting to VS2005 format will overwrite existing files. Convert ?", fileName),
 
94
                                                        "MonoDevelop", "VS2005", "Cancel");
 
95
                        }
90
96
                                                                        
91
97
                        if (choice == 2)
92
98
                                throw new InvalidOperationException ("VS2003 solutions are not supported natively.");
101
107
                                combine.Save (monitor);
102
108
 
103
109
                                // Re-read to get a MSBuildSolution object
104
 
                                combine = IdeApp.Services.ProjectService.ReadCombineEntry (combine.FileName, monitor) as Combine;
 
110
                                combine = Services.ProjectService.ReadCombineEntry (combine.FileName, monitor) as Combine;
105
111
                        }
106
112
 
107
113
                        return combine;
112
118
                {
113
119
                        SlnMaker slnmaker = new SlnMaker ();
114
120
                        Combine combine = null;
 
121
                        IProgressMonitor m;
 
122
                        if (IdeApp.Services == null)
 
123
                                m = new ConsoleProgressMonitor ();
 
124
                        else
 
125
                                m = new MonoDevelop.Core.Gui.ProgressMonitoring.MessageDialogProgressMonitor (
 
126
                                                        true, false, true, false);
 
127
 
115
128
                        try { 
116
 
                                using (IProgressMonitor m = new MonoDevelop.Core.Gui.ProgressMonitoring.MessageDialogProgressMonitor (
117
 
                                        true, false, true, false)) {
118
 
                                        combine = slnmaker.MsSlnToCmbxHelper (fileName, m, save);
119
 
                                }
 
129
                                combine = slnmaker.MsSlnToCmbxHelper (fileName, m, save);
120
130
                        } catch (Exception e) {
121
 
                                Console.WriteLine ("exception while converting : " + e.ToString ());
 
131
                                LoggingService.LogError ("exception while converting : " + e.ToString ());
122
132
                                throw;
 
133
                        } finally {
 
134
                                if (m != null)
 
135
                                        m.Dispose ();
123
136
                        }
124
137
 
125
138
                        return combine;