~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/Base/Project/Src/Project/UnknownProject.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using ICSharpCode.Core;
 
6
 
 
7
namespace ICSharpCode.SharpDevelop.Project
 
8
{
 
9
        public class UnknownProject : AbstractProject
 
10
        {
 
11
                string warningText = "${res:ICSharpCode.SharpDevelop.Commands.ProjectBrowser.NoBackendForProjectType}";
 
12
                bool warningDisplayedToUser;
 
13
                
 
14
                public string WarningText {
 
15
                        get { return warningText; }
 
16
                        set { warningText = value; }
 
17
                }
 
18
                
 
19
                public bool WarningDisplayedToUser {
 
20
                        get { return warningDisplayedToUser; }
 
21
                        set { warningDisplayedToUser = value; }
 
22
                }
 
23
                
 
24
                public void ShowWarningMessageBox()
 
25
                {
 
26
                        warningDisplayedToUser = true;
 
27
                        MessageService.ShowError("Error loading " + this.FileName + ":\n" + warningText);
 
28
                }
 
29
                
 
30
                public UnknownProject(string fileName, string title, string warningText, bool displayWarningToUser)
 
31
                        : this(fileName, title)
 
32
                {
 
33
                        this.warningText = warningText;
 
34
                        if (displayWarningToUser) {
 
35
                                ShowWarningMessageBox();
 
36
                        }
 
37
                }
 
38
                
 
39
                public UnknownProject(string fileName, string title)
 
40
                {
 
41
                        Name     = title;
 
42
                        FileName = fileName;
 
43
                        TypeGuid = "{00000000-0000-0000-0000-000000000000}";
 
44
                }
 
45
        }
 
46
}