コード例 #1
0
ファイル: VSProject.cs プロジェクト: knocte/BuildAMation
        GetUniqueSettingsGroup(
            Bam.Core.Module module,
            VSSettingsGroup.ESettingsGroup group,
            Bam.Core.TokenizedString include = null)
        {
            lock (this.ProjectSettings)
            {
                foreach (var settings in this.ProjectSettings)
                {
                    if (null == include)
                    {
                        if ((null == settings.Include) && (settings.Group == group))
                        {
                            return(settings);
                        }
                    }
                    else
                    {
                        // ignore group, as files can mutate between them during the buildprocess (e.g. headers into custom builds)
                        if (settings.Include.Parse() == include.Parse())
                        {
                            return(settings);
                        }
                    }
                }

                var newGroup = new VSSettingsGroup(module, group, include);
                this.ProjectSettings.Add(newGroup);
                return(newGroup);
            }
        }
コード例 #2
0
        GetSettingsGroup(
            VSSettingsGroup.ESettingsGroup group,
            Bam.Core.TokenizedString include = null,
            bool uniqueToProject             = false)
        {
            lock (this.SettingGroups)
            {
                foreach (var settings in this.SettingGroups)
                {
                    if (null == include)
                    {
                        if ((null == settings.Include) && (settings.Group == group))
                        {
                            return(settings);
                        }
                    }
                    else
                    {
                        // ignore group, as files can mutate between them during the buildprocess (e.g. headers into custom builds)
                        // TODO: can this be a TokenizedString hash compare?
                        if ((null != include) && (settings.Include.ToString() == include.ToString()))
                        {
                            return(settings);
                        }
                    }
                }

                var newGroup = uniqueToProject ?
                               this.Project.GetUniqueSettingsGroup(this.Module, group, include) :
                               new VSSettingsGroup(this.Project, this.Module, group, include);
                this.SettingGroups.Add(newGroup);
                return(newGroup);
            }
        }