Beispiel #1
0
        public void LogAboutNDependencies(int maxCount, [CanBeNull] string pattern, [NotNull] WriteTarget target)
        {
            IEnumerable <Dependency> matchingDependencies = LogOnlyDependencyCount(pattern);
            int n = target.IsConsoleOut ? maxCount : int.MaxValue / 2;

            using (var tw = target.CreateWriter()) {
                foreach (var d in matchingDependencies.Take(n))
                {
                    tw.WriteLine(d.AsLimitableStringWithTypes(false, threeLines: true));
                }
                if (matchingDependencies.Skip(n).Any())
                {
                    tw.WriteLine("...");
                }
            }
            SomethingDone = true;
        }
Beispiel #2
0
        public void LogAboutNItems(int maxCount, [CanBeNull] string pattern, [NotNull] WriteTarget target)
        {
            List <Item> matchingItems = LogOnlyItemCount(pattern).ToList();
            int         n             = target.IsConsoleOut ? maxCount : int.MaxValue / 2;

            matchingItems.Sort((i1, i2) => string.Compare(i1.Name, i2.Name,
                                                          IgnoreCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture));
            using (var tw = target.CreateWriter()) {
                foreach (var i in matchingItems.Take(n))
                {
                    tw.WriteLine(i.AsFullString());
                }
                if (matchingItems.Skip(n).Any())
                {
                    tw.WriteLine("...");
                }
            }
            SomethingDone = true;
        }