예제 #1
0
        private string ToFrameworkString(ProjectLoadProgress plp)
        {
            if (string.IsNullOrEmpty(plp.TargetFramework))
            {
                return(null);
            }

            return($" ({plp.TargetFramework})");
        }
        public void Report(ProjectLoadProgress loadProgress)
        {
            var projectDisplay = Path.GetFileName(loadProgress.FilePath);

            if (loadProgress.TargetFramework != null)
            {
                projectDisplay += $" ({loadProgress.TargetFramework})";
            }

            Console.WriteLine($"{loadProgress.Operation,-15} {loadProgress.ElapsedTime,-15:m\\:ss\\.fffffff} {projectDisplay}");
        }
예제 #3
0
        public void Report(ProjectLoadProgress value)
        {
            var task = _tasks.GetOrAdd(FindInternalTypesStep.LoadSolution, _ =>
            {
                var t = _progressContext.AddTask(FindInternalTypesStep.LoadSolution.ToString());
                t.StartTask();
                return(t);
            });

            task.Increment(1);//we dont know in advance amount of steps, so just incrementing counter. Hope it wont exceed 100
        }
예제 #4
0
        private void LoadSolution_ProgressChanged(object sender, ProjectLoadProgress e)
        {
            switch (e.Operation)
            {
            case ProjectLoadOperation.Evaluate:
            case ProjectLoadOperation.Build:
                // Only log the final progress event
                break;

            case ProjectLoadOperation.Resolve:
                _console.Out.VerboseWriteLine($"Loaded project {Path.GetFileName(e.FilePath)}");
                break;
            }
        }
예제 #5
0
 private void UpdateProgress(IProgress <string> progress, ProjectLoadProgress plp)
 {
     Log.Debug($"{plp.Operation.ToString().PadLeft(8)} : {Path.GetFileName(plp.FilePath)}{ToFrameworkString(plp)}");
     progress?.Report($"{plp.Operation.ToString().PadLeft(8)} : {Path.GetFileName(plp.FilePath)}{ToFrameworkString(plp)}");
 }