예제 #1
0
파일: NCldrBuilder.cs 프로젝트: pifta/NCLDR
 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);
     }
 }
예제 #2
0
        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();
            }
        }
예제 #3
0
파일: NCldrBuilder.cs 프로젝트: hmvs/NCLDR
 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);
     }
 }
예제 #4
0
파일: Program.cs 프로젝트: srl295/NCLDR
        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;
            }
        }