Пример #1
0
        private static void IncrementWork(float cant, string accion)
        {
            f_Work += cant;
            if (f_Work > 100f)
            {
                f_Work = 100f;
            }

            FormUpdater.UpdateText(accion);
            FormUpdater.UpdateProgress((int)f_Work);
        }
Пример #2
0
        public static void Parse(string rutaxml, string @namespace, string destination)
        {
            f_value = 0;

            s_namespace   = @namespace;
            s_destination = destination;

            xdoc = new XmlDocument();
            xdoc.Load(rutaxml);

            ((MainForm)Application.OpenForms[0]).toolStripStatusLabel2.Text = "Parseando Archivo xml de Vulkan.";

            //EL MEOLLO YA AQUÍ

            #region Lectura
            Tools.DefineTypes(xdoc);
            HandleParser.Parse(xdoc);
            APIConstantsParser.Parse(xdoc);
            IntPtrsParser.Parse(xdoc);
            EnumParser.Parse(xdoc);
            EnumParser.ExtParse(xdoc);
            ExtensionsParser.ParseExtendedEnumValues(xdoc);             //EXTENSIONES
            FuncPointerParser.Parse(xdoc);
            StructParser2.Parse(xdoc);
            UnionParser.Parse(xdoc);
            CommandParser.Parse(xdoc);
            VersionParser.Parse(xdoc);
            #endregion

            #region Escritura
            CreaterConstCS.CreateConstCS();
            //CreaterIntPtrsCS.CreateIntPtrsCS(); //IntPtrs & Handles
            CreaterEnumCS.CreateEnumCS();
            CreaterStructsCS.CreateStructsCS();
            CreaterUnionCS.CreateUnionCS();

            //CreaterMethodsCS.CreateMethodsCS();
            //CreaterMethodsCS2.CreateMethodsCS();
            CreaterMethodsCS3.CreateMethodsCS();
            //CreaterMethodsICS.CreateMethodsICS();
            //CreaterMethodsDCS.CreateMethodsDCS();

            if (((MainForm)Application.OpenForms[0]).checkvkdevices.Checked)
            {
                VKDeviceMaker.VKDeviceMake();
                VKDelegatesMaker.VKDelegatesMake();
                VKDelegatorMaker.VKDelegatorMake();
            }


            #endregion

            #region Compile DLL
            if (((MainForm)Application.OpenForms[0]).checkBox1.Checked)
            {
                string   nombrearchivo = ((MainForm)Application.OpenForms[0]).textBox1.Text;
                string[] files         = System.IO.Directory.GetFiles(s_destination, "*.cs");
                //delegate delmethod = new dele
                string retornado = DLLCompiler.CompileDLL(files, s_destination + nombrearchivo);

                FormUpdater.UpdateCompilerText(retornado);
            }
            #endregion

            //EL MEOLLO YA AQUÍ


            if (((MainForm)Application.OpenForms[0]).checkBox2.Checked)
            {
                string[] archivos = System.IO.Directory.GetFiles(s_destination, "*.cs");
                for (int i = 0; i < archivos.Length; i++)
                {
                    System.IO.File.Delete(archivos[i]);
                }
            }
            //((MainForm)Application.OpenForms[0]).SetValue((int)100); //Casca sin un invoke por ejecutarse desde otro hilo.

            ((MainForm)Application.OpenForms[0]).toolStripStatusLabel2.Text = "Archivo xml de Vulkan Parseado.";

            if (System.Windows.Forms.MessageBox.Show("El Archivo XML de Vulkan ha sido Parseado correctamente", "Trabajo Terminado!") == DialogResult.OK)
            {
            }

            ((MainForm)Application.OpenForms[0]).Invoke(finish);
            //((MainForm)Application.OpenForms[0]).Habilitar(true, true);
            System.Threading.Thread.CurrentThread.Abort();
        }