Пример #1
0
        private static void AnalyzeEnumExtValuesID(SyntaxNodeAnalysisContext context)
        {
            EnumExtensionTypeSyntax enumExtensionTypeSyntax = context.Node as EnumExtensionTypeSyntax;
            string appAllowedRanges = GetAppObjectRange(context);

            AnalyzeEnumExtValuesIDs(context, enumExtensionTypeSyntax, appAllowedRanges);
        }
Пример #2
0
 protected void ProcessEnumExtensionTypeNode(ALSymbolInformation symbol, EnumExtensionTypeSyntax syntax)
 {
     if (syntax.BaseObject != null)
     {
         symbol.extends = ALSyntaxHelper.DecodeName(syntax.BaseObject.ToString());
     }
 }
Пример #3
0
        public static void AnalyzeEnumExtValuesIDs(SyntaxNodeAnalysisContext context, EnumExtensionTypeSyntax enumExtensionTypeSyntax, string appAllowedRanges)
        {
            if (appAllowedRanges == null || enumExtensionTypeSyntax == null)
            {
                return;
            }

            if (enumExtensionTypeSyntax.Values != null)
            {
                SyntaxList <EnumValueSyntax> values = enumExtensionTypeSyntax.Values;
                foreach (EnumValueSyntax enumValueSyntax in values)
                {
                    SyntaxToken fieldNo = enumValueSyntax.Id;
                    if (!CheckNoInAllowedRange(int.Parse(fieldNo.Value.ToString()), appAllowedRanges))
                    {
                        ReportEnumValuesInAllowedRange(context, fieldNo.GetLocation(), enumValueSyntax.Name.Identifier.Value.ToString(), enumValueSyntax.Name);
                    }
                }
            }
        }