Example #1
0
        public static void Compile_Flowchart(System.Windows.Forms.TabControl.TabPageCollection tabpages)
        {
            _tpc = tabpages;
            Oval start = mainSubchart(tabpages).Start;

            foreach (Subchart sbchrt in allSubcharts(tabpages))
            {
                sbchrt.am_compiling = false;
            }
            mainSubchart(tabpages).am_compiling = true;
            Generate_IL gil = new Generate_IL("MyAssembly");

            try
            {
                Do_Compilation(start, gil, tabpages);
            }
            catch
            {
                foreach (Subchart sbchrt in allSubcharts(tabpages))
                {
                    sbchrt.am_compiling = false;
                }
                throw;
            }
            mainSubchart(tabpages).am_compiling = false;
        }
Example #2
0
        public static void Compile_Flowchart_To(Oval start, string directory, string filename)
        {
            Generate_IL gil = new Generate_IL(
                System.IO.Path.GetFileNameWithoutExtension(filename));

            Do_Compilation(start, gil, Runtime.parent.carlisle.TabPages);
            if (!System.IO.Directory.Exists(directory))
            {
                System.IO.Directory.CreateDirectory(directory);
            }
            string app_dir = System.IO.Path.GetDirectoryName(
                System.Windows.Forms.Application.ExecutablePath);

            System.IO.File.Copy(
                System.Windows.Forms.Application.ExecutablePath,
                System.IO.Path.Combine(directory, "raptor.dll"), true);
            System.IO.File.Copy(
                System.IO.Path.Combine(app_dir, "interpreter.dll"),
                System.IO.Path.Combine(directory, "interpreter.dll"), true);
            System.IO.File.Copy(
                System.IO.Path.Combine(app_dir, "dotnetgraph.dll"),
                System.IO.Path.Combine(directory, "dotnetgraph.dll"), true);
            System.IO.File.Copy(
                System.IO.Path.Combine(app_dir, "mgnat.dll"),
                System.IO.Path.Combine(directory, "mgnat.dll"), true);
            System.IO.File.Copy(
                System.IO.Path.Combine(app_dir, "mgnatcs.dll"),
                System.IO.Path.Combine(directory, "mgnatcs.dll"), true);
            string[] plugins    = Plugins.Get_Plugin_List();
            string[] assemblies = Plugins.Get_Assembly_Names();
            for (int j = 0; j < plugins.Length; j++)
            {
                System.IO.File.Copy(
                    plugins[j],
                    System.IO.Path.Combine(directory,
                                           assemblies[j]) + ".dll", true);
            }
            if (System.IO.File.Exists(System.IO.Path.Combine(directory, filename)))
            {
                System.IO.File.Delete(System.IO.Path.Combine(directory, filename));
            }
            gil.Save_Result(filename);
            System.IO.File.Move(filename,
                                System.IO.Path.Combine(directory, filename));
        }