Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PropertyProvider.cs « MonoDevelop.Autotools « addins « src « main - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 368ce87e2f3e8d1abc38ff32af7be5bf458dd99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

using System;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.DesignerSupport;

namespace MonoDevelop.Autotools
{
	public class PropertyProvider: IPropertyProvider
	{
		public bool SupportsObject (object obj)
		{
			ProjectFile file = obj as ProjectFile;
			if (file != null && file.Project != null) {
				MakefileData data = file.Project.GetMakefileData ();
				if (data != null && data.IsFileIntegrationEnabled (file.BuildAction))
					return true;
			}
			return false;
		}

		public object CreateProvider (object obj)
		{
			return new ProjectFileWrapper ((ProjectFile) obj);
		}
	}
	
	class ProjectFileWrapper
	{
		ProjectFile file;
		MakefileData data;
		
		public ProjectFileWrapper (ProjectFile file)
		{
			this.file = file;
			data = file.Project.GetMakefileData ();
		}
		
		[LocalizedCategory ("Makefile Integration")]
		[LocalizedDisplayName ("Include in Makefile")]
		[LocalizedDescription ("Include this file in the file list of the synchronized Makefile")]
		public bool IncludeInMakefile {
			get {
				return !data.IsFileExcluded (file.FilePath); 
			}
			set {
				data.SetFileExcluded (file.FilePath, !value);
			}
		}
	}
}