~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
                        BorderWidth = 6;
79
79
                }
80
80
 
81
 
                public void SetProject (Project configureProject)
 
81
                public void SetProject (DotNetProject configureProject)
82
82
                {
83
83
                        store.Clear ();
84
84
                        PopulateListView (configureProject);
127
127
                        return String.Compare (s1, s2, true);
128
128
                }
129
129
                
130
 
                void PopulateListView (Project configureProject)
 
130
                void PopulateListView (DotNetProject configureProject)
131
131
                {
132
 
                        Combine openCombine = configureProject.RootCombine;
 
132
                        Solution openSolution = configureProject.ParentSolution;
133
133
                        
134
 
                        if (openCombine == null) {
 
134
                        if (openSolution == null) {
135
135
                                return;
136
136
                        }
137
137
                        
138
138
                        bool circDeps = false;
139
 
                        foreach (Project projectEntry in openCombine.GetAllProjects()) {
 
139
                        foreach (Project projectEntry in openSolution.GetAllSolutionItems<Project>()) {
140
140
 
141
141
                                if (projectEntry == configureProject) {
142
142
                                        continue;
143
143
                                }
144
 
                                if (ProjectReferencesProject (projectEntry, configureProject.Name)) {
145
 
                                        circDeps = true;
146
 
                                        continue;
 
144
 
 
145
                                DotNetProject netProject = projectEntry as DotNetProject;
 
146
                                if (netProject != null) {
 
147
                                        if (ProjectReferencesProject (netProject, configureProject.Name)) {
 
148
                                                circDeps = true;
 
149
                                                continue;
 
150
                                        }
 
151
                                    if (!configureProject.TargetFramework.IsCompatibleWithFramework (netProject.TargetFramework.Id))
 
152
                                                continue;
147
153
                                }
148
154
 
149
155
                                string iconName = Services.Icons.GetImageForProjectType (projectEntry.ProjectType);
155
161
                                store.AppendValues ("", "<span foreground='dimgrey'>" + GettextCatalog.GetString ("(Projects referencing '{0}' are not shown,\nsince cyclic dependencies are not allowed)", configureProject.Name) + "</span>", null, false, null, false);
156
162
                }
157
163
                
158
 
                bool ProjectReferencesProject (Project project, string targetProject)
 
164
                bool ProjectReferencesProject (DotNetProject project, string targetProject)
159
165
                {
160
 
                        foreach (ProjectReference pr in project.ProjectReferences) {
 
166
                        foreach (ProjectReference pr in project.References) {
161
167
                                if (pr.Reference == targetProject)
162
168
                                        return true;
163
169
                                
164
 
                                Project pref = project.RootCombine.FindProject (pr.Reference);
 
170
                                DotNetProject pref = project.ParentSolution.FindProjectByName (pr.Reference) as DotNetProject;
165
171
                                if (pref != null && ProjectReferencesProject (pref, targetProject))
166
172
                                        return true;
167
173
                        }