Example #1
0
        public void ProcessModel(string input, string name)
        {
            string         txtFile     = "";
            string         output      = "";
            string         err         = "";
            EAPModelReader modelReader = new EAPModelReader(ref txtFile, name, output);
            EAPModels      eapModels   = modelReader.CollectClasses(input, ref err);

            if (eapModels == null)
            {
                t1.Abort();
                LogTB = "Invalid file format!";
                return;
            }
            FileWritter fw = new FileWritter();

            EAPModel[] eapObjModels = eapModels.Models.ToArray();


            GenerateCode(eapObjModels[0]);
            fw.WriteFiles("1.0.0", FilesComplete, DestPath, false);
            fw.WriteFiles("1.0.0", FilesForDb, DestPath, true);
            t1.Abort();
            var path = DestPath + "\\classes";

            Process.Start(@path);
            LogTB = "\nFINISHED!";
        }
Example #2
0
        static void Main(string[] args)
        {
            string      path        = @"C:\Users\oleksandr.papirnyk\Desktop\BubbleSort_Papirnyk\BubbleSort_Papirnyk\bin\Debug\results.txt";
            int         arrayLength = 20000;
            Randomizer  randomizer  = new Randomizer();
            List <int>  nums        = new List <int>();
            IList <int> arrayToSort = randomizer.Randomize(nums, arrayLength);

            BubbleSort bubbleSorter = new BubbleSort();
            Stopwatch  stopwatch    = new Stopwatch();

            stopwatch.Start();
            IEnumerable <int> answer = bubbleSorter.BubbleSortAlgorithm(arrayToSort);

            stopwatch.Stop();

            FileWritter fileWritter = new FileWritter();

            fileWritter.WriteToFile(path, stopwatch.ElapsedMilliseconds, arrayLength);
            Console.WriteLine(stopwatch.ElapsedMilliseconds);
            Console.WriteLine("Solution completed");

            Console.ReadKey();
        }