Пример #1
0
        public override bool Run(StateProvider state)
        {
            log        = OpenWindow <LoggerWindow>().Rename("Info");
            properties = new List <string>();
            sorted     = new Dictionary <string, List <string> >();
            count      = 0;

            state.SetProgress(0);
            state.SetMaxProgress(files.Length);
            foreach (var file in from f in files where File.Exists(f) select new FileInfo(f))
            {
                ReadShader(file);

                state.AddProgress(1);
                state.SetStatus($"[{state.Progress}%] - Reading \"{file.Name}\"...");
            }

            state.SetMaxProgress(properties.Count);
            state.SetProgress(0);
            foreach (var prop in properties)
            {
                AddProperty(prop);
                state.AddProgress(1);
                state.SetStatus($"[{state.Progress}%] - Scanning...");
            }



            output = OpenWindow <LoggerWindow>().Rename("Output");

            state.SetMaxProgress(count);
            state.SetProgress(0);
            foreach (var group in sorted)
            {
                output.WriteLine(string.Format($"=== {group.Key} ==={nl}"));

                foreach (var prop in group.Value.OrderBy(s => s))
                {
                    output.WriteLine(prop);
                    state.AddProgress(1);
                    state.SetStatus($"[{state.Progress}%] - Displaying...");
                }

                output.WriteLine($"{nl}{nl}");
            }

            state.SetStatus($"Done!");

            log.Dispose();

            return(true);
        }