private void wrongNamespaceIssueProvider_CheckCodeIssues(object sender, CheckCodeIssuesEventArgs ea)
        {
            if (ea.IsSuppressed(ea.Scope))
            {
                return;
            }

            var scope = ea.Scope as SourceFile;

            if (scope == null)
            {
                return;
            }

            var project = scope.Project as ProjectElement;

            if (project == null)
            {
                return;
            }

            string path = scope.FilePath;
            string expectedNamespace = ExpectedNamespace(project, path);
            var    issueRanges       = new HashSet <TextRange>();

            foreach (IElement element in ea.GetEnumerable(ea.Scope, ElementFilters.Namespace))
            {
                var namespaceElement = element as INamespaceElement;
                if (namespaceElement == null)
                {
                    continue;
                }

                if (NamespaceShouldBeUpdated(scope, namespaceElement, expectedNamespace))
                {
                    foreach (var fullNameRange in GetWrongNamespaceNameRanges(scope, namespaceElement))
                    {
                        issueRanges.Add(fullNameRange);
                    }
                }
            }
            foreach (TextRange range in issueRanges)
            {
                ea.AddHint(range, "Namespace is not default", 10);
            }
        }
        public void CheckCodeIssue( CheckCodeIssuesEventArgs eventArg )
        {
            var types = new LanguageElementType[] { LanguageElementType.MethodCall };
            var elementFilter = new ElementTypeFilter( types );
            var enumerable = eventArg.GetEnumerable( eventArg.Scope, elementFilter );
            foreach ( var element in enumerable )
            {
                IMethodCallStatement methodCall = element as IMethodCallStatement;
                if ( methodCall == null )
                    continue;

                IMethodElement methodDeclaration = methodCall.GetDeclaration() as IMethodElement;
                if ( methodDeclaration == null )
                    continue;

                if ( methodDeclaration.MethodType == MethodTypeEnum.Function )
                {
                    eventArg.AddHint( methodCall.FirstNameRange, "Return value is not used" );
                }
            }
        }
        private void wrongNamespaceIssueProvider_CheckCodeIssues(object sender, CheckCodeIssuesEventArgs ea)
        {
            if (ea.IsSuppressed(ea.Scope))
                return;

            var scope = ea.Scope as SourceFile;
            if (scope == null)
                return;

            var project = scope.Project as ProjectElement;
            if (project == null)
                return;

            string path = scope.FilePath;
            string expectedNamespace = ExpectedNamespace(project, path);
            var issueRanges = new HashSet<TextRange>();

            foreach (IElement element in ea.GetEnumerable(ea.Scope, ElementFilters.Namespace))
            {
                var namespaceElement = element as INamespaceElement;
                if (namespaceElement == null)
                    continue;

                if (NamespaceShouldBeUpdated(scope, namespaceElement, expectedNamespace))
                {
                    foreach (var fullNameRange in GetWrongNamespaceNameRanges(scope, namespaceElement))
                    {
                        issueRanges.Add(fullNameRange);
                    }
                }
            }
            foreach (TextRange range in issueRanges)
            {
                ea.AddHint(range, "Namespace is not default", 10);
            }
        }