Пример #1
0
 private static bool MacroDefinitionContainsMacroApplication(TypeDefinition definition, MacroStatement statement)
 {
     return statement.GetAncestors<TypeDefinition>().Any(ancestor => ancestor == definition);
 }
Пример #2
0
        IEntity ResolveMacroExtensionType(MacroStatement node, IMethod extension)
        {
            if (null == extension)
                return null;
            IType extendedMacroType = GetExtendedMacroType(extension);
            if (null == extendedMacroType)
                return null;

            //ok now check if extension is correctly nested under parent
            foreach (MacroStatement parent in node.GetAncestors<MacroStatement>())
                if (ResolveMacroName(parent) == extendedMacroType)
                    return GetExtensionMacroType(extension);

            return null;
        }
Пример #3
0
        private bool MacroDefinitionContainsMacroApplication(TypeDefinition definition, MacroStatement statement)
        {
            foreach (TypeDefinition ancestor in statement.GetAncestors<TypeDefinition>())
                if (ancestor == definition)
                    return true;

            return false;
        }