Esempio n. 1
0
        private static void LogChanges(TreeChanges changes)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(string.Format("All: ({0}){1}", changes.ToList().Count, Environment.NewLine));
            changes.ToList().ForEach(x => { stringBuilder.Append(x.Path); stringBuilder.Append(Environment.NewLine);});

            stringBuilder.Append(string.Format("\nModified: ({0}){1}", changes.Modified.ToList().Count, Environment.NewLine));
            changes.Modified.ToList().ForEach(x => { stringBuilder.Append(x.Path); stringBuilder.Append(Environment.NewLine); });

            stringBuilder.Append(string.Format("\nDeleted: ({0}){1}", changes.Deleted.ToList().Count, Environment.NewLine));
            changes.Deleted.ToList().ForEach(x => { stringBuilder.Append(x.Path); stringBuilder.Append(Environment.NewLine); });

            stringBuilder.Append(string.Format("\nAdded: ({0}){1}", changes.Added.ToList().Count, Environment.NewLine));
            changes.Added.ToList().ForEach(x => { stringBuilder.Append(x.Path); stringBuilder.Append(Environment.NewLine); });

            stringBuilder.Append(string.Format("\nRenamed: ({0}){1}", changes.Renamed.ToList().Count, Environment.NewLine));
            changes.Renamed.ToList().ForEach(x => { stringBuilder.Append(string.Format("{0} -> {1}",x.OldPath, x.Path)); stringBuilder.Append(Environment.NewLine); });

            Logger.Instance.Log(stringBuilder.ToString());
        }
Esempio n. 2
0
        private static void PrintChanges(TreeChanges changes)
        {
            Printf("All:");
            changes.ToList().ForEach(x => Printf(x.Path));

            Printf("\nModified:");
            changes.Modified.ToList().ForEach(x => Printf(x.Path));

            Printf("\nDeleted:");
            changes.Deleted.ToList().ForEach(x => Printf(x.Path));

            Printf("\nAdded:");
            changes.Added.ToList().ForEach(x => Printf(x.Path));

            Printf("\nRenamed:");
            changes.Renamed.ToList().ForEach(x => Printf(string.Format("{0} -> {1}", x.OldPath, x.Path)));

            Printf();
        }