Пример #1
0
            private bool CheckAttributeUsage(Analyzer /*!*/ analyzer, ref bool duplicateFound)
            {
                // check usage target of this attribute:
                bool is_usage_definite;
                AttributeUsageAttribute specific_usage = type.GetCustomAttributeUsage(out is_usage_definite);

                if (is_usage_definite)
                {
                    if (!CheckAttributeUsage(analyzer, specific_usage, ref duplicateFound))
                    {
                        return(false);
                    }
                }
                else
                {
                    // usage constraints cannot be determined now; ckeck the usage later during post-analysis:
                    analyzer.PostAnalyzed.Add(this);
                }

                return(true);
            }