コード例 #1
0
        public ReferenceModel SelectIndirectReferences(ReferenceModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            var indirectReferences = model.References.Where(r => !IsDirectReference(r.ReferenceFrom.Symbol, r.ReferenceTo.Symbol));

            var result = new ReferenceModel();

            Parallel.ForEach(indirectReferences, reference => result.CloneReferenceDefinition(reference));

            return(result);
        }
コード例 #2
0
        public string PrintFromToEndpoints(ReferenceModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(Separator);
            sb.AppendLine("== Classes that are referenced in indirect way");
            sb.AppendLine(Separator);
            sb.AppendLine(PrintReferenceEndpoints(model.ReferenceTo.OrderByDescending(p => p.References.Count())));
            sb.AppendLine();
            sb.AppendLine(Separator);
            sb.AppendLine("== Classes that reference in indirect way");
            sb.AppendLine(Separator);
            sb.AppendLine(PrintReferenceEndpoints(model.ReferenceFrom.OrderByDescending(p => p.References.Count())));
            sb.AppendLine(Separator);

            return(sb.ToString());
        }