Inheritance: AnimationIndicator
Esempio n. 1
0
        public static ProgressIndicator CreateProgressIndicator(int maxValue)
        {
            Random            rand = new Random();
            int               r    = rand.Next();
            ProgressIndicator progrssIndicator;

            switch (r % 4)
            {
            case 0:
                progrssIndicator = new BatsFlyingAnimation(maxValue);
                break;

            case 1:
                progrssIndicator = new BikeGuyRidingAnimation(maxValue);
                break;

            case 2:
                progrssIndicator = new ExecutiveDeskToyAnimation(maxValue);
                break;

            default:
                progrssIndicator = new BarIndicator(maxValue);
                break;
            }
            return(progrssIndicator);
        }
        public static ProgressIndicator CreateProgressIndicator(int maxValue)
        {
            Random rand = new Random();
            int r = rand.Next();
            ProgressIndicator progrssIndicator;

            switch (r % 4)
            {
                case 0:
                    progrssIndicator = new BatsFlyingAnimation(maxValue);
                    break;
                case 1:
                    progrssIndicator = new BikeGuyRidingAnimation(maxValue);
                    break;
                case 2:
                    progrssIndicator = new ExecutiveDeskToyAnimation(maxValue);
                    break;
                default:
                    progrssIndicator = new BarIndicator(maxValue);
                    break;
            }
            return progrssIndicator;
        }
Esempio n. 3
0
        private static void WPGotoAnalysis(Arguments arguments, Config configuration)
        {
            var v = Stopwatch.StartNew();
            var folders = Directory.GetDirectories(@"G:\WP");
            int counter = 0;

            var progress = new BikeGuyRidingAnimation(folders.Count());

            var locker = new object();

            Parallel.ForEach(folders, new ParallelOptions() { MaxDegreeOfParallelism = 7 },
                folder =>
                {
                    int myNumber = Interlocked.Increment(ref counter);
                    arguments.Target = Path.Combine(arguments.Target, folder);
                    if (!Directory.Exists(arguments.Target))
                        return;

                    var projectParser = new ProjectParser(arguments.Target, configuration.PHPSettings);
                    ParseResult parseResult = projectParser.ParseProjectFiles();

                    foreach (var parsedFile in parseResult.ParsedFiles)
                    {
                        //Console.WriteLine("File: " + parsedFile.Key);
                        var traverser = new XmlTraverser();
                        var metricVisitor = new MetricVisitor();
                        traverser.AddVisitor(metricVisitor);
                        traverser.Traverse(parsedFile.Value);

                        if (metricVisitor.Gotos > 0)
                        {
                            lock (locker)
                            {
                                System.IO.File.AppendAllLines(@"C:/pluginDLMessages.txt", new [] { "Goto found in " + parsedFile.Key});
                            }
                        }
                    }

                    //Console.WriteLine(folder);

                    if ((myNumber % 250) == 0)
                    {
                        Console.WriteLine(myNumber + " plugins scanned..");
                    }
                });
            Console.WriteLine(v.Elapsed);
            Environment.Exit(1);
        }