Example #1
0
        /*********
        ** Private methods
        *********/
        /// <summary>Get the dynamic and config token names defined by a content pack.</summary>
        /// <param name="content">The content pack to read.</param>
        private ISet <string> GetLocalTokenNames(ContentConfig content)
        {
            InvariantHashSet names = new InvariantHashSet();

            // dynamic tokens
            foreach (string name in content.DynamicTokens.Select(p => p.Name))
            {
                if (!string.IsNullOrWhiteSpace(name))
                {
                    names.Add(name);
                }
            }

            // config schema
            foreach (string name in content.ConfigSchema.Select(p => p.Key))
            {
                if (!string.IsNullOrWhiteSpace(name))
                {
                    names.Add(name);
                }
            }

            // exclude tokens that conflict with a built-in condition, which will be ignored
            names.RemoveWhere(p => this.GetEnum <ConditionType>(p) != null);

            return(names);
        }