~ubuntu-branches/ubuntu/lucid/monodevelop/lucid

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Projects/MonoDevelop.Projects/SolutionConfigurationSelector.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-01-10 14:25:59 UTC
  • mfrom: (1.2.5 upstream) (1.3.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100110142559-sorji5exvk9tyknr
Tags: 2.2+dfsg-2
* debian/rules/remove_support_for_non_debian_functionality.patch:
  + Also fix monodevelop-core-addins.pc to remove links to the
    addins we remove in Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// 
 
2
// SolutionItem.cs
 
3
//  
 
4
// Author:
 
5
//       Lluis Sanchez Gual <lluis@novell.com>
 
6
// 
 
7
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
 
8
// 
 
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
// of this software and associated documentation files (the "Software"), to deal
 
11
// in the Software without restriction, including without limitation the rights
 
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
// copies of the Software, and to permit persons to whom the Software is
 
14
// furnished to do so, subject to the following conditions:
 
15
// 
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
// 
 
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
// THE SOFTWARE.
 
26
 
 
27
namespace MonoDevelop.Projects
 
28
{
 
29
        public class SolutionConfigurationSelector: ConfigurationSelector
 
30
        {
 
31
                public string Id { get; private set; }
 
32
                
 
33
                public SolutionConfigurationSelector (string id)
 
34
                {
 
35
                        Id = id;
 
36
                }
 
37
                
 
38
                public override string ToString ()
 
39
                {
 
40
                        return Id;
 
41
                }
 
42
                
 
43
                public static explicit operator SolutionConfigurationSelector (string id)
 
44
                {
 
45
                        return new SolutionConfigurationSelector (id);
 
46
                }
 
47
                
 
48
                public override ItemConfiguration GetConfiguration (IConfigurationTarget target)
 
49
                {
 
50
                        ItemConfiguration sconf;
 
51
                        if (target is SolutionEntityItem) {
 
52
                                // Get the mapped configuration
 
53
                                SolutionEntityItem item = (SolutionEntityItem) target;
 
54
                                if (item.ParentSolution != null) {
 
55
                                        SolutionConfiguration config = item.ParentSolution.Configurations [Id];
 
56
                                        if (config != null) {
 
57
                                                string mc = config.GetMappedConfiguration (item);
 
58
                                                if (mc != null) {
 
59
                                                        sconf = item.Configurations [mc];
 
60
                                                        if (sconf != null)
 
61
                                                                return sconf;
 
62
                                                }
 
63
                                        }
 
64
                                }
 
65
                        }
 
66
                        return target.Configurations [Id];
 
67
                }
 
68
        }
 
69
}