Ejemplo n.º 1
0
        private Habilidade getHabilidade(string abilityName)
        {
            if (abilityName == null || abilityName.Length == 0)
            {
                return(null);
            }
            Habilidade habilidade = Habilidades.getHabilidadeByMethodName(abilityName);

            try {
                if (habilidade.tipoClasse == Main.classe)
                {
                    if (habilidade.minLevel <= Main.atributos.Level)
                    {
                        return(habilidade);
                    }
                    ConsoleReport.Log("Seu nível é muito baixo para utilizar esta Habilidade", ConsoleType.BATTLE);
                }
                else
                {
                    ConsoleReport.Log("A classe " + Main.classe.ToString() + " não pode utilizar esta Habilidade!", ConsoleType.BATTLE);
                }
            } catch (NullReferenceException) {
                ConsoleReport.Log("Habilidade não encontrada!", ConsoleType.BATTLE);
            }
            return(null);
        }
Ejemplo n.º 2
0
        protected override Task <int> Execute()
        {
            var consoleReport = new ConsoleReport();
            var result        = consoleReport.Execute(_coverageLoadedFileOption.Result, _thresholdOption.Value);

            return(Task.FromResult(result));
        }
Ejemplo n.º 3
0
        public static void Report(DateTime startDate)
        {
            Console.WriteLine($"Since: {startDate}");
            foreach (var reportRows in GetReportData(startDate).GroupBy(x => x.FirstName))
            {
                var firstName = reportRows.Key;
                Console.WriteLine($"\n{firstName}\n");
                var table = new List <List <string> >()
                {
                    new List <string>()
                    {
                        "Job Name",
                        "Error Count",
                        "Last Finished",
                        "Last Failed",
                        "Last Error"
                    }
                };

                foreach (var row in reportRows)
                {
                    table.Add(new List <string>()
                    {
                        row.SurName,
                        row.ErrorCount.ToString(),
                        (row.LastSuccess.ToString() == "1/1/01 12:00:00 AM" ? "---" : row.LastSuccess.ToString()),
                        (row.LastFailure.ToString() == "1/1/01 12:00:00 AM" ? "---" : row.LastFailure.ToString()),
                        row.LastException.Split("\n").First() ?? ""
                    });
                }
                ConsoleReport.WriteTable(table);
            }
        }
Ejemplo n.º 4
0
        IEnumerable <IProcessor> _GetProcessors(Story story)
        {
            var runner = TestRunner.ConstructFor(story);

            if (runner != null)
            {
                yield return(runner);
            }

            var consoleReporter = ConsoleReport.ConstructFor(story);

            if (consoleReporter != null)
            {
                yield return(consoleReporter);
            }

            yield return(new ExceptionProcessor());

            var storyCache = StoryCache.ConstructFor(story);

            if (storyCache != null)
            {
                yield return(storyCache);
            }

            yield return(new Disposer());

            foreach (var addedProcessor in _addedProcessors)
            {
                yield return(addedProcessor());
            }
        }
Ejemplo n.º 5
0
        public virtual ConsoleReport ConsoleReport()
        {
            ConsoleReport report = new ConsoleReport(OutputFormatter(), PrimeGenerator());

            report.MaxNumber = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MaximumNumber"));
            return(report);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            //uncomment this next line to to use XML to assemble the container
            //IApplicationContext ctx = CreateContainerUsingXML();

            //uncomment this next line to to use CodeConfig to assemble the container
            IApplicationContext ctx = CreateContainerUsingCodeConfig();

            ConsoleReport report = ctx["ConsoleReport"] as ConsoleReport;

            report.Write();

            ctx.Dispose();

            Console.WriteLine("--- hit enter to exit --");
            Console.ReadLine();
        }
        public static void Report()
        {
            var reports = new List <Report>()
            {
                CheckForOrphanApplicationVideos()
            };

            foreach (var r in reports)
            {
                Console.WriteLine(r.Title);
                Console.WriteLine($"Status: {r.Status}");
                if (r.Status == ReportStatus.FAILED)
                {
                    Console.Write($"Description: {r.Description}");
                    Console.WriteLine();
                    ConsoleReport.WriteTable(r.Data);
                }
            }
        }
Ejemplo n.º 8
0
 private bool verificaDistancia(int maxDistancia, int minDistancia)
 {
     if (Distancia > maxDistancia)
     {
         ConsoleReport.Log("VOCÊ ESTÁ MUITO LONGE PARA ACERTAR! DISTANCIA: " + Distancia, ConsoleType.BATTLE);
         actionOrder.ActualOrder++;
         return(true);
     }
     if (Distancia < minDistancia)
     {
         ConsoleReport.Log("VOCÊ ESTÁ MUITO PERTO PARA ACERTAR! DISTANCIA: " + Distancia, ConsoleType.BATTLE);
         actionOrder.ActualOrder++;
         return(true);
     }
     if (Distancia < minDistancia)
     {
         ConsoleReport.Log("VOCÊ ESTÁ MUITO PERTO PARA ACERTAR! DISTANCIA: " + Distancia, ConsoleType.BATTLE);
         actionOrder.ActualOrder++;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 9
0
        static int Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;

            var commandLineApplication = new CommandLineApplication();

            commandLineApplication.Name        = "MiniCover";
            commandLineApplication.Description = "MiniCover - Code coverage for .NET Core via assembly instrumentation";

            commandLineApplication.Command("instrument", command =>
            {
                command.Description = "Instrument assemblies";

                var workDirOption           = CreateWorkdirOption(command);
                var includeAssembliesOption = command.Option("--assemblies", "Pattern to include assemblies [default: **/*.dll]", CommandOptionType.MultipleValue);
                var excludeAssembliesOption = command.Option("--exclude-assemblies", "Pattern to exclude assemblies", CommandOptionType.MultipleValue);
                var includeSourceOption     = command.Option("--sources", "Pattern to include source files [default: **/*]", CommandOptionType.MultipleValue);
                var excludeSourceOption     = command.Option("--exclude-sources", "Pattern to exclude source files", CommandOptionType.MultipleValue);
                var hitsFileOption          = command.Option("--hits-file", "Hits file name [default: coverage-hits.txt]", CommandOptionType.SingleValue);
                var coverageFileOption      = CreateCoverageFileOption(command);

                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    var workdir = UpdateWorkingDirectory(workDirOption);

                    var assemblies = GetFiles(includeAssembliesOption, excludeAssembliesOption, "**/*.dll");
                    if (assemblies.Length == 0)
                    {
                        throw new Exception("No assemblies found");
                    }

                    var sourceFiles = GetFiles(includeSourceOption, excludeSourceOption, "**/*.cs");
                    if (sourceFiles.Length == 0)
                    {
                        throw new Exception("No source files found");
                    }

                    var hitsFile     = GetHitsFile(hitsFileOption);
                    var coverageFile = GetCoverageFile(coverageFileOption);
                    var instrumenter = new Instrumenter(assemblies, hitsFile, sourceFiles, workdir);
                    var result       = instrumenter.Execute();
                    SaveCoverageFile(coverageFile, result);
                    return(0);
                });
            });

            commandLineApplication.Command("uninstrument", command =>
            {
                command.Description = "Uninstrument assemblies";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile = GetCoverageFile(coverageFileOption);
                    var result       = LoadCoverageFile(coverageFile);
                    Uninstrumenter.Execute(result);
                    return(0);
                });
            });

            commandLineApplication.Command("report", command =>
            {
                command.Description = "Outputs coverage report";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                var thresholdOption    = CreateThresholdOption(command);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile  = GetCoverageFile(coverageFileOption);
                    var threshold     = GetThreshold(thresholdOption);
                    var result        = LoadCoverageFile(coverageFile);
                    var consoleReport = new ConsoleReport();
                    return(consoleReport.Execute(result, threshold));
                });
            });

            commandLineApplication.Command("htmlreport", command =>
            {
                command.Description = "Write html report to folder";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                var thresholdOption    = CreateThresholdOption(command);
                var outputOption       = command.Option("--output", "Output folder for html report [default: coverage-html]", CommandOptionType.SingleValue);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile = GetCoverageFile(coverageFileOption);
                    var threshold    = GetThreshold(thresholdOption);
                    var result       = LoadCoverageFile(coverageFile);
                    var output       = GetHtmlReportOutput(outputOption);
                    var htmlReport   = new HtmlReport(output);
                    return(htmlReport.Execute(result, threshold));
                });
            });

            commandLineApplication.Command("xmlreport", command =>
            {
                command.Description = "Write an NCover-formatted XML report to folder";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                var thresholdOption    = CreateThresholdOption(command);
                var outputOption       = command.Option("--output", "Output file for NCover report [default: coverage.xml]", CommandOptionType.SingleValue);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile = GetCoverageFile(coverageFileOption);
                    var threshold    = GetThreshold(thresholdOption);
                    var result       = LoadCoverageFile(coverageFile);
                    var output       = GetXmlReportOutput(outputOption);
                    XmlReport.Execute(result, output, threshold);
                    return(0);
                });
            });

            commandLineApplication.Command("opencoverreport", command =>
            {
                command.Description = "Write an OpenCover-formatted XML report to folder";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                var thresholdOption    = CreateThresholdOption(command);
                var outputOption       = command.Option("--output", "Output file for OpenCover report [default: opencovercoverage.xml]", CommandOptionType.SingleValue);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile = GetCoverageFile(coverageFileOption);
                    var threshold    = GetThreshold(thresholdOption);
                    var result       = LoadCoverageFile(coverageFile);
                    var output       = GetOpenCoverXmlReportOutput(outputOption);
                    OpenCoverReport.Execute(result, output, threshold);
                    return(0);
                });
            });

            commandLineApplication.Command("reset", command =>
            {
                command.Description = "Reset hits count";

                var workDirOption      = CreateWorkdirOption(command);
                var coverageFileOption = CreateCoverageFileOption(command);
                command.HelpOption("-h | --help");

                command.OnExecute(() =>
                {
                    UpdateWorkingDirectory(workDirOption);

                    var coverageFile = GetCoverageFile(coverageFileOption);

                    if (File.Exists(coverageFile))
                    {
                        var result = LoadCoverageFile(coverageFile);

                        if (File.Exists(result.HitsFile))
                        {
                            File.Delete(result.HitsFile);
                        }
                    }

                    return(0);
                });
            });

            commandLineApplication.HelpOption("-h | --help");

            commandLineApplication.OnExecute(() =>
            {
                commandLineApplication.ShowHelp();
                return(0);
            });

            return(commandLineApplication.Execute(args));
        }
    static void Main()
    {
        Console.Write("Initializing...");

        var sb     = new StringBuilder();
        var report = new ConsoleReport <object>(sb);

        /*
         * Notes:
         * 1) ConcurrentBag seems to be PAINFULLY slow compared to ConcurrentQueue.
         * 2) The speed gap between an optimistic array and its interlocked couterpart grows large very quickly (as expected).
         * 3) A sync locked Queue is faster than a sync locked LinkedList.
         * 4) ConcurrentQueue seems to be the overall winner when dealing with pools larger than 100 but is the clear loser for very small sizes.
         */

        // Start with a baseline...
        //report.AddBenchmark("QueueObjectPool", // Note, that this one isn't far off from the following in peformance.
        //	count => () => QueueObjectPool.Create<object>((int)count * 2));

        report.AddBenchmark("Microsoft.Extensions.ObjectPool.DefaultObjectPool",
                            count => () => new DefaultObjectPool <object>(() => new object(), (int)count * 2));

        report.AddBenchmark("ConcurrentQueueObjectPoolSlim",
                            count => () => ConcurrentQueueObjectPoolSlim.Create <object>((int)count * 2));

        report.AddBenchmark("ConcurrentQueueObjectPool",
                            count => () => ConcurrentQueueObjectPool.Create <object>((int)count * 2));

        //report.AddBenchmark("ConcurrentStackObjectPool",
        //	count => () => ConcurrentStackObjectPool.Create<object>((int)count * 2));

        report.AddBenchmark("OptimisticArrayObjectPool",
                            count => () => OptimisticArrayObjectPool.Create <object>((int)count * 2));

        // Is ineveitably slower than the above but should be enabled for testing code changes.
        report.AddBenchmark("InterlockedArrayObjectPool",
                            count => () => InterlockedArrayObjectPool.Create <object>((int)count * 2));

        report.Pretest(200, 200);         // Run once through first to scramble/warm-up initial conditions.

        Console.SetCursorPosition(0, Console.CursorTop);

        const int loopMultiple = 12;

        report.Test(4, 8 * loopMultiple);
        report.Test(10, 8 * loopMultiple);
        report.Test(50, 12 * loopMultiple);
        report.Test(100, 16 * loopMultiple);
        report.Test(250, 32 * loopMultiple);
        //report.Test(2000, 64 * loopMultiple);

        File.WriteAllText("./BenchmarkResult.txt", sb.ToString());
        using (var fs = File.OpenWrite("./BenchmarkResult.csv"))
            using (var sw = new StreamWriter(fs))
                using (var csv = new CsvWriter(sw))
                {
                    csv.WriteRow(report.ResultLabels);
                    csv.WriteRows(report.Results);
                }

        Console.Beep();
        Console.WriteLine("(press any key when finished)");
        Console.ReadKey();
    }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            ConsoleKeyInfo cki;

            // Prevent example from ending if CTL+C is pressed.
            Console.TreatControlCAsInput = true;
            Console.ForegroundColor      = ConsoleColor.DarkMagenta;
            Console.WriteLine("Press any combination of CTL, ALT, and SHIFT, and a console key.");
            Console.WriteLine("Press the Escape (Esc) key to quit.");
            Console.WriteLine("Press the Enter to export the report.");
            Console.ResetColor();

            #region Threads
            Thread testTargetIP1Connecting   = new Thread(new ThreadStart(TestTargetIP1Connecting));
            Thread testTargetIP2Connecting   = new Thread(new ThreadStart(TestTargetIP2Connecting));
            Thread testTargetIP1Disconnected = new Thread(new ThreadStart(TestTargetIP1Disconnected));
            Thread testTargetIP2Disconnected = new Thread(new ThreadStart(TestTargetIP2Disconnected));
            #endregion



            try
            {
                #region Init
                log = LoggerManager.GetLogger(logger);

                log1 = LoggerManager.GetLogger(target1VLANLogger);
                log2 = LoggerManager.GetLogger(target2VLANLogger);

                targetIP1      = ConfigHelper.ReadConfigurationByKey(ConfigHelper.AppKeys.IP1);
                targetIP2      = ConfigHelper.ReadConfigurationByKey(ConfigHelper.AppKeys.IP2);
                localMachineIP = MachineUtil.GetMachineIP();

                ChangeLogFileName();
                DeleteOriginalLogFile(log1FileName);
                DeleteOriginalLogFile(log2FileName);

                log.Info(string.Format("Started Testing."));
                Console.WriteLine("{0} Started Testing: From {1} To {2} ...", DateTime.Now, localMachineIP, targetIP1);
                log1.Info(string.Format("Started Testing: From {0} To {1} ...", localMachineIP, targetIP1));

                Console.WriteLine("{0} Started Testing: From {1} To {2} ...", DateTime.Now, localMachineIP, targetIP2);
                log2.Info(string.Format("Started Testing: From {0} To {1} ...", localMachineIP, targetIP2));

                #endregion

                #region Threads
                testTargetIP1Connecting.Start();
                testTargetIP2Connecting.Start();
                testTargetIP1Disconnected.Start();
                testTargetIP2Disconnected.Start();
                #endregion

                #region End



                do
                {
                    cki = Console.ReadKey();

                    Console.ForegroundColor = ConsoleColor.DarkMagenta;
                    Console.WriteLine("Press the Enter to export the report.");

                    Console.Write(" --- You pressed ");
                    if ((cki.Modifiers & ConsoleModifiers.Alt) != 0)
                    {
                        Console.Write("ALT+");
                    }
                    if ((cki.Modifiers & ConsoleModifiers.Shift) != 0)
                    {
                        Console.Write("SHIFT+");
                    }
                    if ((cki.Modifiers & ConsoleModifiers.Control) != 0)
                    {
                        Console.Write("CTL+");
                    }

                    Console.WriteLine(cki.Key.ToString());

                    if (cki.Key == ConsoleKey.Enter)
                    {
                        List <TimePoint> currentTimePoints1 = timePoints1;
                        List <TimePoint> currentTimePoints2 = timePoints2;
                        currentTimePoints1.Add(new TimePoint(DateTime.Now, targetIP1lastStatus));
                        currentTimePoints2.Add(new TimePoint(DateTime.Now, targetIP2lastStatus));

                        #region Report
                        Console.ForegroundColor = ConsoleColor.Gray;

                        NetworkData networkData1 = NetworkSituationStatistic.Calculate(currentTimePoints1);
                        NetworkData networkData2 = NetworkSituationStatistic.Calculate(currentTimePoints2);
                        networkData1.IPAddress = targetIP1;
                        networkData2.IPAddress = targetIP2;
                        ConsoleReport consoleReport = new ConsoleReport();
                        consoleReport.Export(networkData1);
                        consoleReport.Export(networkData2);
                        LogFileReport logFileReport1 = new LogFileReport(log1);
                        LogFileReport logFileReport2 = new LogFileReport(log2);
                        logFileReport1.Export(networkData1);
                        logFileReport2.Export(networkData2);

                        #endregion
                    }
                    Console.ResetColor();

                    Thread.Sleep(500);
                }while (cki.Key != ConsoleKey.Escape);

                Console.TreatControlCAsInput = false;

                #endregion

                #region
            }
            catch (Exception ex)
            {
                log.Info("Error: \n" + ex.Message + "\r\n" + ex.StackTrace);
                Console.WriteLine("Error:\n" + ex.Message + "\r\n" + ex.StackTrace);
                Console.ReadKey();
            }
            finally
            {
                if (testTargetIP1Connecting != null)
                {
                    testTargetIP1Connecting.Abort();
                }
                if (testTargetIP2Connecting != null)
                {
                    testTargetIP1Connecting.Abort();
                }
                if (testTargetIP1Disconnected != null)
                {
                    testTargetIP1Connecting.Abort();
                }
                if (testTargetIP2Disconnected != null)
                {
                    testTargetIP1Connecting.Abort();
                }
                Console.WriteLine("{0} Testing Finished.", DateTime.Now);
                log1.Info("Testing Finished.");
                log2.Info("Testing Finished.");
            }
            #endregion
        }
Ejemplo n.º 12
0
        private IEnumerator attack(string abilityName, GameObject target, int order)
        {
            yield return(new WaitUntil(() => order == actionOrder.ActualOrder));

            if (Main.status.acao > 0 && Main.status.pontosAcao >= 5)
            {
                if (MainIsDead)
                {
                    ConsoleReport.Log("PERSONAGEM ATACANTE ESTÁ MORTO!", ConsoleType.BATTLE);
                    actionOrder.ActualOrder++;
                    yield break;
                }
                this.Target             = target.GetComponent <Player>();
                this.ModificadorEsquiva = Target.atributos.CA;
                if (TargetIsDead)
                {
                    ConsoleReport.Log("O ALVO SELECIONADO ESTÁ MORTO!", ConsoleType.BATTLE);
                    actionOrder.ActualOrder++;
                    yield break;
                }
                int        maxDistancia    = Main.atributos.DistAtqMax;
                int        minDistancia    = Main.atributos.DistAtqMin;
                int        bonusAcerto     = 0;
                int        custoPontosAcao = Main.atributos.CustoAtaqueBasico;
                Habilidade habilidade      = getHabilidade(abilityName);
                if (habilidade != null)
                {
                    ConsoleReport.LogBattle(habilidade.nome);
                    maxDistancia    = habilidade.maxDistancia;
                    minDistancia    = habilidade.minDistancia;
                    bonusAcerto     = habilidade.bonusAcerto;
                    custoPontosAcao = habilidade.custoPontoAcao;
                }
                else if (abilityName != null && abilityName.Length > 0)
                {
                    yield break;
                }
                if (verificaDistancia(maxDistancia, minDistancia))
                {
                    yield break;
                }
                if (habilidade != null && !Main.status.UseSp(habilidade.custoSp))
                {
                    ConsoleReport.Log("VOCÊ NÃO TEM SP SUFICIENTE PARA UTILIZAR ESTÁ HABILIDADE! SEU SP: " + Main.status.mana + " | SP NECESSÁRIA: " + habilidade.custoSp, ConsoleType.BATTLE);
                    actionOrder.ActualOrder++;
                    yield break;
                }
                this.Main.status.acao--;
                this.Main.status.pontosAcao -= custoPontosAcao;
                int  damage     = 0;
                bool isOfensiva = true;
                if (habilidade != null)
                {
                    isOfensiva = habilidade.IsOfensiva;
                    if (habilidade.tipoHabilidade.Equals(TipoHabilidades.HP))
                    {
                        this.Target.status.Heal(habilidade.Cura);
                    }
                    else if (habilidade.tipoHabilidade.Equals(TipoHabilidades.SP))
                    {
                        this.Target.status.Rejuvenate(habilidade.Rejuvenescer);
                    }
                    else if (habilidade.tipoHabilidade.Equals(TipoHabilidades.HPSP))
                    {
                        this.Target.status.Heal(habilidade.Cura);
                        this.Target.status.Rejuvenate(habilidade.Rejuvenescer);
                    }
                    else if (habilidade.tipoHabilidade.Equals(TipoHabilidades.OFENSIVA))
                    {
                        damage = habilidade.Dano;
                    }
                }
                if (isOfensiva)
                {
                    this.ModificadorAcerto = Main.atributos.AcertoBase + bonusAcerto;
                    if (hit)
                    {
                        if (damage.Equals(0))
                        {
                            damage = Main.atributos.Dano;
                        }
                        if (damage < 0)
                        {
                            damage = 0;
                        }
                        ConsoleReport.Log("ModificadorAcerto: " + ModificadorAcerto + "| ModificadorEsquiva: " + ModificadorEsquiva + "| DANO: " + damage, ConsoleType.BATTLE);
                        Main.status.attBarras();
                        this.Target.status.Damage(damage);
                    }
                    else
                    {
                        SoundManager.instance.Sfx("Miss");
                        ConsoleReport.Log("Errou", ConsoleType.BATTLE);
                        ConsoleReport.Log("ModificadorAcerto: " + ModificadorAcerto + "| ModificadorEsquiva: " + ModificadorEsquiva, ConsoleType.BATTLE);
                        Target.GetComponent <EffectsPlayer>().show(tipoEffect.DANO, "Errou", Target.GetComponent <Transform>().position);
                    }
                    Main.status.attBarras();
                }
            }
            actionOrder.ActualOrder++;
            yield break;
        }
Ejemplo n.º 13
0
            void CompileFiles()
            {
                //filePaths = filePaths.Where(x => File.Exists(x)).ToArray();

                CompilerParameters cp = new CompilerParameters();

                //options.GenerateExecutable = false;
                //options.GenerateInMemory = true;
                cp.ReferencedAssemblies.AddRange(assemblyReferences);
                //				cp.ReferencedAssemblies.Add("system.dll");
                //				cp.ReferencedAssemblies.Add("system.xml.dll");
                //				cp.ReferencedAssemblies.Add("system.data.dll");
                //				cp.ReferencedAssemblies.Add("system.windows.forms.dll");
                //				cp.ReferencedAssemblies.Add("system.drawing.dll");
                //#if UNITY_EDITOR
                //				cp.ReferencedAssemblies.Add(@"dll\UnityEngine.dll");
                //				cp.ReferencedAssemblies.Add(@"Assets\Plugins\GameLibrary.dll");
                //				cp.ReferencedAssemblies.Add(@"dll\UnityEngine.UI.dll");
                //				Debug.Log("Unity Editor");
                //#endif
                //#if UNITY_STANDALONE
                //				cp.ReferencedAssemblies.Add(@"BeginReality_Data\Managed\UnityEngine.dll");
                //				cp.ReferencedAssemblies.Add(@"BeginReality_Data\Managed\GameLibrary.dll");
                //				cp.ReferencedAssemblies.Add(@"BeginReality_Data\Managed\UnityEngine.UI.dll");
                //				Debug.Log("STANDALONE");
                //#endif

                cp.CompilerOptions    = "/t:library";
                cp.GenerateInMemory   = true;
                cp.GenerateExecutable = false;

                var compiler = new CodeCompiler();
                //CompilerResults cr = compiler.CompileAssemblyFromFileBatch(cp, filePaths.ToArray());
                CompilerResults cr = compiler.CompileAssemblyFromSource(cp, code.ToString());

                string errors = "";

                if (cr.Errors.HasErrors)
                {
                    foreach (CompilerError error in cr.Errors)
                    {
                        ConsoleReport.LogReport("Ocorreu um erro na linha " + (error.Line - 7).ToString() + " e coluna " + error.Column.ToString());
                        errors = errors + error.ErrorText + " linha: " + (error.Line - 7).ToString() + "\n";
                    }
                    throw new Exception(errors);
                }

                //foreach (var err in result.Errors) {
                //	manager.logWriter.WriteLine(err);
                //}

                this.assembly = cr.CompiledAssembly;
                object o = assembly.CreateInstance("CSCodeEvaler");

                Type t = assembly.GetType("CSCodeEvaler");

                if (t != null)
                {
                    MethodInfo mi = t.GetMethod("EvalCode");
                    mi.Invoke(o, null);
                }
            }