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

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.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:
32
32
{
33
33
        public class TypeSystemParserNode : TypeExtensionNode
34
34
        {
 
35
                [NodeAttribute (Description="The build actions.")]
 
36
                string[] buildActions = new string[] { MonoDevelop.Projects.BuildAction.Compile };
 
37
 
 
38
                public string[] BuildActions {
 
39
                        get {
 
40
                                return buildActions;
 
41
                        }
 
42
                        set {
 
43
                                buildActions = value;
 
44
                        }
 
45
                }
 
46
 
35
47
                [NodeAttribute (Description="The mime type.")]
36
48
                string mimeType;
37
 
                
 
49
 
38
50
                public string MimeType {
39
51
                        get {
40
52
                                return mimeType;
44
56
                        }
45
57
                }
46
58
                
47
 
                ITypeSystemParser cachedInstance;
 
59
                TypeSystemParser cachedInstance;
48
60
                
49
 
                public ITypeSystemParser Parser {
 
61
                public TypeSystemParser Parser {
50
62
                        get {
51
 
                                return cachedInstance ?? (cachedInstance = (ITypeSystemParser)CreateInstance ());
 
63
                                return cachedInstance ?? (cachedInstance = (TypeSystemParser)CreateInstance ());
52
64
                        }
53
65
                }
54
66
                
55
67
                HashSet<string> mimeTypes;
56
 
                public bool CanParse (string mimeType)
 
68
                public bool CanParse (string mimeType, string buildAction)
57
69
                {
58
70
                        if (mimeTypes == null)
59
71
                                mimeTypes  = this.mimeType != null ? new HashSet<string> (this.mimeType.Split (',').Select (s => s.Trim ())) : new HashSet<string> ();
60
 
                        return mimeTypes.Contains (mimeType, StringComparer.Ordinal);
61
 
                }
62
 
        }
 
72
                        if (!mimeTypes.Contains (mimeType, StringComparer.Ordinal))
 
73
                                return false;
 
74
                        return buildActions.Any (action => string.Equals (action, buildAction, StringComparison.OrdinalIgnoreCase));
 
75
                }
 
76
        }
 
77
 
 
78
 
 
79
        public class TypeSystemOutputTrackingNode : ExtensionNode
 
80
        {
 
81
                [NodeAttribute (Description="The project type.")]
 
82
                string projectType;
 
83
 
 
84
                public string ProjectType {
 
85
                        get {
 
86
                                return projectType;
 
87
                        }
 
88
                        set {
 
89
                                projectType = value;
 
90
                        }
 
91
                }
 
92
        }
 
93
 
63
94
}
64
95