Ejemplo n.º 1
0
        public static bool IsEventFiled(this IEventSymbol symbol)
        {
            if (!symbol.IsFromCode() || symbol.IsOverridable())
            {
                return(false);
            }

            var syntaxReference = symbol.DeclaringSyntaxReferences.FirstOrDefault();

            if (syntaxReference != null)
            {
                bool isField = syntaxReference.GetSyntax().IsKind(SyntaxKind.VariableDeclarator);
                if (isField)
                {
                    if (symbol.IsInterfaceImplementation())
                    {
                        isField = false;
                    }
                }
                return(isField);
            }
            return(false);
        }