예제 #1
0
        private IEnumerable <IPrimarySourceLocation /*?*/> MapLocationToSourceLocations(ILocation location)
        {
            IILLocation /*?*/       mbLocation = location as IILLocation;
            ISourceLocationProvider provider   = this.GetProvider(mbLocation);

            if (provider != null)
            {
                return(provider.GetPrimarySourceLocationsFor(location));
            }

            return(Enumerable <IPrimarySourceLocation> .Empty);
        }
예제 #2
0
        private IEnumerable <IPrimarySourceLocation /*?*/> MapLocationToSourceLocations(ILocation location)
        {
            IILLocation /*?*/       mbLocation = location as IILLocation;
            ISourceLocationProvider provider   = this.GetProvider(mbLocation);

            if (provider != null)
            {
                foreach (var psloc in provider.GetPrimarySourceLocationsFor(location))
                {
                    yield return(psloc);
                }
            }
        }
예제 #3
0
        private bool MakeSureSliceHasAtLeastMethodSourceLocation(ISlice <MethodReferenceAdaptor, FieldReferenceAdaptor, TypeReferenceAdaptor, IAssemblyReference> slice, ISourceLocationProvider sourceLocationProvider)
        {
            Contract.Requires(slice != null);
            Contract.Requires(sourceLocationProvider != null);

            foreach (var m in slice.Methods)
            {
                var methodDefinition = m.reference.ResolvedMethod;
                if (sourceLocationProvider.GetPrimarySourceLocationsFor(methodDefinition.Locations).Any())
                {
                    return(true);
                }
            }
            return(false);
        }