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);
        }
Exemple #2
0
        public bool SupportsObject(object obj)
        {
            ProjectFile file = obj as ProjectFile;

            if (file != null && file.Project != null)
            {
                MakefileData data = file.Project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
                if (data != null && data.IsFileIntegrationEnabled(file.BuildAction))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #3
0
        public void OnExclude()
        {
            //if all of the selection is already checked, then toggle checks them off
            //else it turns them on. hence we need to find if they're all checked,
            bool allChecked = true;

            foreach (ITreeNavigator node in CurrentNodes)
            {
                ProjectFile file = (ProjectFile)node.DataItem;
                if (file.Project != null)
                {
                    MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
                    if (data != null && data.IsFileIntegrationEnabled(file.BuildAction))
                    {
                        if (data.IsFileExcluded(file.FilePath))
                        {
                            allChecked = false;
                            break;
                        }
                    }
                }
            }

            Set <SolutionEntityItem> projects = new Set <SolutionEntityItem> ();

            foreach (ITreeNavigator node in CurrentNodes)
            {
                ProjectFile file = (ProjectFile)node.DataItem;
                if (file.Project != null)
                {
                    projects.Add(file.Project);
                    MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
                    if (data != null && data.IntegrationEnabled)
                    {
                        data.SetFileExcluded(file.FilePath, allChecked);
                    }
                }
            }

            IdeApp.ProjectOperations.Save(projects);
        }
Exemple #4
0
        public void OnUpdateExclude(CommandInfo cinfo)
        {
            bool anyChecked = false;
            bool allChecked = true;
            bool anyEnabled = false;
            bool allEnabled = true;

            foreach (ITreeNavigator node in CurrentNodes)
            {
                ProjectFile file = (ProjectFile)node.DataItem;
                if (file.Project != null)
                {
                    MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
                    if (data != null && data.IsFileIntegrationEnabled(file.BuildAction))
                    {
                        anyEnabled = true;
                        if (!data.IsFileExcluded(file.FilePath))
                        {
                            anyChecked = true;
                        }
                        else
                        {
                            allChecked = false;
                        }
                    }
                    else
                    {
                        allEnabled = false;
                    }
                }
            }

            cinfo.Visible             = anyEnabled;
            cinfo.Enabled             = anyEnabled && allEnabled;
            cinfo.Checked             = anyChecked;
            cinfo.CheckedInconsistent = anyChecked && !allChecked;
        }