private static void Progress( string section, string item, ProgressEventType progressEventType = ProgressEventType.Adding, object addedObject = null) { if (progress != null) { NCldrBuilderProgressEventArgs args = new NCldrBuilderProgressEventArgs(); args.Section = section; args.Item = item; args.ProgressEventType = progressEventType; args.AddedObject = addedObject; progress(null, args); } }
private void Progress(object sender, NCldrBuilderProgressEventArgs args) { if (args.ProgressEventType != ProgressEventType.Added) { if (args.Section != previousSection) { Console.WriteLine(String.Empty); if (args.ProgressEventType == ProgressEventType.Adding) { Progress(args.Section + "s..."); } else { Progress(args.Section + "..."); } } previousSection = args.Section; Application.DoEvents(); } }
private static void Progress( string section, string item, ProgressEventType progressEventType = ProgressEventType.Adding, object addedObject = null) { if (progress != null) { NCldrBuilderProgressEventArgs args = new NCldrBuilderProgressEventArgs(); args.Section = section; args.Item = item; args.ProgressEventType = progressEventType; args.AddedObject = addedObject; progress(null, args); } }
private static void Progress(object sender, NCldrBuilderProgressEventArgs args) { if (args.ProgressEventType == ProgressEventType.Added) { if (displayMode == DisplayMode.Diagnostics) { long objectSize = GetObjectSize(args.AddedObject); Console.WriteLine(String.Format(": {0} bytes", objectSize)); sectionTotalObjectSizes += objectSize; } } else { if (args.Section != previousSection) { if (displayMode == DisplayMode.Diagnostics && previousSection != null) { Console.WriteLine(string.Format("Total size: {0} bytes", sectionTotalObjectSizes)); } Console.WriteLine(String.Empty); if (args.ProgressEventType == ProgressEventType.Adding) { Console.WriteLine(args.Section + "s"); } else { Console.WriteLine(args.Section); } sectionTotalObjectSizes = 0; } if (displayMode == DisplayMode.Diagnostics) { Console.Write(" " + args.Item); } else if (displayMode == DisplayMode.Verbose) { Console.WriteLine(" " + args.Item); } else { Console.Write("."); } previousSection = args.Section; } }