Example #1
0
        /// #NAME#: #DESCRIPTION#
        public void f_54b8eead_551e_428b_98e6_7d3e831d475d()
        {
            //INI CODE PRCGUID: 54b8eead-551e-428b-98e6-7d3e831d475d


            #region Variables

            // Inputs vars
            object I_Namespace_programa_activo = Input("Namespace programa activo", false);
            #endregion

            if (I_Namespace_programa_activo != null)
            {
                ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
                CStructModifications csmod = new CStructModifications(sys, App_globals);
                ArrayList            ar    = csmod.FindProgramReferences(I_Namespace_programa_activo.ToString());
                DataTable            dt    = new DataTable();
                dt.Columns.Add("Path");
                dt.Columns.Add("Program name");
                foreach (string s in ar)
                {
                    String cad = s.Replace(App_globals.AppDataSection(dPATH.CODE).FullName + "\\", "").Replace("\\", ".").Replace(".json", "");
                    dt.Rows.Add(new object[] { cad, cad });
                }

                Outputs("Tabla resultados", dt);
                Outputs("Num columna con path", 0);
            }

            //END CODE PRCGUID: 54b8eead-551e-428b-98e6-7d3e831d475d
        }
Example #2
0
        /// #NAME#: #DESCRIPTION#
        public void f_d7c92550_523c_4cb7_9223_c8da10a35e3d()
        {
            //INI CODE PRCGUID: d7c92550-523c-4cb7-9223-c8da10a35e3d

            ARQODE_UI.GestorProcesos.CVentanaProcesos CVentanaProcesos = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);
            if (CVentanaProcesos.TV_Processes.SelectedNode != null)
            {
                TreeNode NProcActivo = CVentanaProcesos.TV_Processes.SelectedNode;

                ARQODE_UI.ARQODE_UI.CInputDialog CInputDialog = new ARQODE_UI.ARQODE_UI.CInputDialog(vm);
                CInputDialog.InputDialog.AcceptButton = CInputDialog.BAceptar;
                CInputDialog.InputDialog.CancelButton = CInputDialog.BCancelar;

                CInputDialog.InputDialog.Text = "Renombrar carpeta";
                CInputDialog.Label1.Text      = "Nombre de la carpeta";
                CInputDialog.textBox1.Text    = NProcActivo.Text;

                vm.Cancel_events = false;
                DialogResult dr = CInputDialog.InputDialog.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);

                    String di_antiguo = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, NProcActivo.FullPath);
                    String di_nuevo   = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName,
                                                     NProcActivo.FullPath.Substring(0, NProcActivo.FullPath.LastIndexOf("\\")));

                    if (di_antiguo.EndsWith(".json"))
                    {
                        String nombre_f = (CInputDialog.textBox1.Text.ToLower().EndsWith(".json")) ? CInputDialog.textBox1.Text : CInputDialog.textBox1.Text + ".json";

                        String from_path = NProcActivo.FullPath.Replace(dPROCESS.FOLDER + "\\", "").Replace("\\", ".").Replace(".json", "");
                        String to_path   = from_path.Substring(0, from_path.IndexOf(".") + 1) + nombre_f.Replace(".json", "");

                        CStructModifications csmod = new CStructModifications(sys, App_globals);
                        csmod.MoveProcess_byNamespace(from_path, to_path);

                        di_nuevo = Path.Combine(di_nuevo, nombre_f);
                        File.Move(di_antiguo, di_nuevo);
                        NProcActivo.Text = nombre_f;
                    }
                    else
                    {
                        di_nuevo = Path.Combine(di_nuevo, CInputDialog.textBox1.Text);
                        if (Directory.Exists(di_antiguo))
                        {
                            DirectoryInfo di_ant = new DirectoryInfo(di_antiguo);
                            di_ant.MoveTo(di_nuevo);
                        }
                        else
                        {
                            Directory.CreateDirectory(di_nuevo);
                        }
                        NProcActivo.Text = CInputDialog.textBox1.Text;
                    }
                }
            }

            //END CODE PRCGUID: d7c92550-523c-4cb7-9223-c8da10a35e3d
        }
Example #3
0
        /// #NAME#: #DESCRIPTION#
        public void f_773923b8_4e21_4dc6_afea_6191de56ef68()
        {
            //INI CODE PRCGUID: 773923b8-4e21-4dc6-afea-6191de56ef68
            ARQODE_UI.GestorProcesos.CVentanaProcesos   CVentanaProcesos  = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);
            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            if ((CVentanaProcesos.LProcess.Items.Count > 0) && (CVentanaProcesos.LProcess.SelectedIndex >= 0))
            {
                CStructModifications csmod = new CStructModifications(sys, App_globals);
                JToken JProc           = ((KeyValuePair <String, JToken>)CVentanaProcesos.LProcess.SelectedItem).Value;
                String prc_active_guid = JProc["Guid"].ToString();

                ArrayList ar = csmod.FindProcessInPrograms(prc_active_guid);

                DataTable dt = new DataTable();
                dt.Columns.Add("Path");
                dt.Columns.Add("Program name");
                foreach (string s in ar)
                {
                    String cad = s.Replace(App_globals.AppDataSection(dPATH.CODE).FullName + "\\", "").Replace("\\", ".").Replace(".json", "");
                    dt.Rows.Add(new object[] { cad, cad });
                }

                Outputs("Tabla resultados", dt);
                Outputs("Num columna con path", 0);
            }

            //END CODE PRCGUID: 773923b8-4e21-4dc6-afea-6191de56ef68
        }
Example #4
0
        /// #NAME#: #DESCRIPTION#
        public void f_b2c47523_858c_4555_b656_dc06c3f1690a()
        {
            //INI CODE PRCGUID: b2c47523-858c-4555-b656-dc06c3f1690a

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            if ((CVentanaProgramas.ListaProcesos.Rows.Count > 0) && (CVentanaProgramas.ListaProcesos.SelectedCells.Count > 0))
            {
                CStructModifications csmod = new CStructModifications(sys, App_globals);
                int       filaactiva       = CVentanaProgramas.ListaProcesos.SelectedCells[0].RowIndex;
                String    prc_active_guid  = CVentanaProgramas.ListaProcesos.Rows[filaactiva].Cells["Guid"].Value.ToString();
                ArrayList ar = csmod.FindProcessInPrograms(prc_active_guid);
                DataTable dt = new DataTable();
                dt.Columns.Add("Path");
                dt.Columns.Add("Program name");
                foreach (string s in ar)
                {
                    String cad = s.Replace(Globals.AppDataSection(dPATH.CODE).FullName + "\\", "").Replace("\\", ".").Replace(".json", "");
                    dt.Rows.Add(new object[] { cad, cad });
                }

                Outputs("Tabla resultados", dt);
                Outputs("Num columna con path", 0);
            }

            //END CODE PRCGUID: b2c47523-858c-4555-b656-dc06c3f1690a
        }
        /// #NAME#: #DESCRIPTION#
        public void f_Renombrar_programa()
        {
            //INI CODE PRCGUID: Renombrar programa

            TreeView ArbolProgramas   = (TreeView)view.getCtrl("ArbolProgramas");
            TreeNode N_ProgramaActivo = ArbolProgramas.SelectedNode;

            ARQODE_UI.ARQODE_UI.CInputDialog CInputDialog = new ARQODE_UI.ARQODE_UI.CInputDialog(vm);
            CInputDialog.InputDialog.AcceptButton = CInputDialog.BAceptar;
            CInputDialog.InputDialog.CancelButton = CInputDialog.BCancelar;
            CInputDialog.InputDialog.Text         = "Renombrar carpeta";
            CInputDialog.Label1.Text   = "Nombre de la carpeta";
            CInputDialog.textBox1.Text = N_ProgramaActivo.Text;

            vm.Cancel_events = false;
            DialogResult dr = CInputDialog.InputDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
                CInputDialog.textBox1.Text = CInputDialog.textBox1.Text.Replace("\r\n", "");
                String di_antiguo = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, N_ProgramaActivo.FullPath);
                String di_nuevo   = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName,
                                                 N_ProgramaActivo.FullPath.Substring(0, N_ProgramaActivo.FullPath.LastIndexOf("\\")));

                if (N_ProgramaActivo.Text.EndsWith(".json"))
                {
                    String nombre_f = (CInputDialog.textBox1.Text.ToLower().EndsWith(".json")) ? CInputDialog.textBox1.Text : CInputDialog.textBox1.Text + ".json";
                    di_nuevo = Path.Combine(di_nuevo, nombre_f);

                    CStructModifications csmod = new CStructModifications(sys, App_globals);
                    String from_path           = N_ProgramaActivo.FullPath.Replace(dPROGRAM.FOLDER + "\\", "").Replace("\\", ".").Replace(".json", "");
                    String to_path             = Path.Combine(N_ProgramaActivo.FullPath.Substring(0, N_ProgramaActivo.FullPath.LastIndexOf("\\")), nombre_f).Replace(dPROGRAM.FOLDER + "\\", "").Replace("\\", ".").Replace(".json", "");
                    csmod.MoveProgram(from_path, to_path);

                    File.Move(di_antiguo, di_nuevo);
                    N_ProgramaActivo.Text = nombre_f;
                }
                else
                {
                    di_nuevo = Path.Combine(di_nuevo, CInputDialog.textBox1.Text);
                    if (di_nuevo != di_antiguo)
                    {
                        if (Directory.Exists(di_antiguo))
                        {
                            DirectoryInfo di_ant = new DirectoryInfo(di_antiguo);
                            di_ant.MoveTo(di_nuevo);
                        }
                        else
                        {
                            Directory.CreateDirectory(di_nuevo);
                        }
                        N_ProgramaActivo.Text = CInputDialog.textBox1.Text;
                    }
                }
            }
            //END CODE PRCGUID: Renombrar programa
        }
Example #6
0
        /// #NAME#: #DESCRIPTION#
        public void f_61bb9810_2b5a_49d2_9a05_3705c8785181()
        {
            //INI CODE PRCGUID: 61bb9810-2b5a-49d2-9a05-3705c8785181

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            String cadBusqueda = CVentanaProgramas.MenuTop.Items[7].Text;

            CStructModifications csmod             = new CStructModifications(sys, App_globals);
            List <KeyValuePair <JToken, int> > res = csmod.Find_all_in_processes(cadBusqueda);

            DataTable dt = null;

            object I_Datasource = Input("Tabla resultados anterior", false);

            if (I_Datasource != null)
            {
                dt = (DataTable)I_Datasource;
            }
            else
            {
                dt = new DataTable();
                dt.Columns.Add("Path");
                dt.Columns.Add("Ruta");
                dt.Columns.Add("Proceso");
                dt.Columns.Add("Guid");
            }

            int max = 0;

            foreach (KeyValuePair <JToken, int> s in res)
            {
                if (max == 0)
                {
                    max = s.Value;
                }
                if (s.Value > max - 2)
                {
                    String programa  = s.Key["Process"].ToString();
                    String proceso   = s.Key["Process name"].ToString();
                    String proc_guid = s.Key["Process guid"].ToString();
                    String cad       = programa.Replace(App_globals.AppDataSection(dPATH.CODE).FullName + "\\", "").Replace("\\", ".").Replace(".json", "");
                    dt.Rows.Add(new object[] { cad, cad, proceso, proc_guid });
                }
                else
                {
                    break;
                }
            }

            Outputs("Tabla resultados", dt);
            Outputs("Num columna con path", 0);

            //END CODE PRCGUID: 61bb9810-2b5a-49d2-9a05-3705c8785181
        }
Example #7
0
        /// #NAME#: #DESCRIPTION#
        public void f_0a2c9e12_f50d_4299_802c_0de96791a182()
        {
            //INI CODE PRCGUID: 0a2c9e12-f50d-4299-802c-0de96791a182
            ARQODE_UI.GestorProcesos.CVentanaProcesos   CVentanaProcesos  = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);
            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            if ((CVentanaProcesos.TV_Processes.SelectedNode != null) && (CVentanaProcesos.TV_Processes.SelectedNode.Text.EndsWith(".json")))
            {
                if (MessageBox.Show("¿Desea eliminar el proceso: '" + CVentanaProcesos.TV_Processes.SelectedNode.Text + "'?",
                                    "Confirmar acción",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    String prc_namespace                = CVentanaProcesos.TV_Processes.SelectedNode.FullPath.Replace(dPROCESS.FOLDER + "\\", "").Replace("\\", ".").Replace(".json", "");
                    CStructModifications csmod          = new CStructModifications(sys, App_globals);
                    ArrayList            prc_references = csmod.FindProcessFileInPrograms(prc_namespace);

                    if (prc_references.Count <= 0)
                    {
                        String proceso = Path.Combine(
                            App_globals.AppDataSection(dPATH.CODE).FullName,
                            CVentanaProcesos.TV_Processes.SelectedNode.FullPath);
                        File.Delete(proceso);
                        CVentanaProcesos.TV_Processes.SelectedNode.Remove();
                    }
                    else
                    {
                        String        message = "";
                        DirectoryInfo pprog   = App_globals.AppDataSection(dPATH.PROGRAM);
                        foreach (String reference in prc_references)
                        {
                            message += reference.Replace(pprog.FullName + "\\", "") + "\r\n";
                        }
                        MessageBox.Show("Antes de eliminar el fichero de procesos debes eliminar las siguientes referencias en los programas:\r\n" + message);
                    }
                }
            }
            else
            {
                String        dir_path = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, CVentanaProcesos.TV_Processes.SelectedNode.FullPath);
                DirectoryInfo di       = new DirectoryInfo(dir_path);
                if (di.GetFiles().Count() == 0)
                {
                    di.Delete();
                }
                else
                {
                    MessageBox.Show("La carpeta no se puede eliminar mientras no esté vacía");
                }
            }

            //END CODE PRCGUID: 0a2c9e12-f50d-4299-802c-0de96791a182
        }
Example #8
0
        /// #NAME#: #DESCRIPTION#
        public void f_439a02f9_bfb8_467a_8443_6607ca19b912()
        {
            //INI CODE PRCGUID: 439a02f9-bfb8-467a-8443-6607ca19b912

            String I_Fichero_importaciones = Input_str("Fichero importaciones");

            Ionic.Zip.ZipFile zf          = new Ionic.Zip.ZipFile(I_Fichero_importaciones);
            JToken            ImportConvs = null;

            foreach (Ionic.Zip.ZipEntry ze in zf.Entries)
            {
                #region get import convs data
                if (ze.FileName.Contains("ImportConvs.json"))
                {
                    MemoryStream ms = new MemoryStream();
                    ze.Extract(ms);
                    byte[] entry_data   = ms.ToArray();
                    String file_content = System.Text.Encoding.Default.GetString(entry_data);
                    ms.Close();
                    ImportConvs = JArray.Parse(file_content);
                }
                #endregion
                #region Extract progrmas & processes
                else
                {
                    ze.Extract(App_globals.AppDataSection(dPATH.CODE).FullName);
                }
                #endregion
            }

            #region Update imported programs namespaces

            if (ImportConvs != null)
            {
                CStructModifications csmod = new CStructModifications(sys, App_globals);
                foreach (JObject jImp in ImportConvs as JArray)
                {
                    JProperty jprop = (JProperty)jImp.First;
                    csmod.MoveProgram(jprop.Name,
                                      jprop.Value.ToString()
                                      .Replace("\\", ".")
                                      .Replace(dPROGRAM.FOLDER + ".", ""));
                }
            }
            MessageBox.Show("Program imported successfully");

            #endregion

            //END CODE PRCGUID: 439a02f9-bfb8-467a-8443-6607ca19b912
        }
Example #9
0
        /// #NAME#: #DESCRIPTION#
        public void f_e0724caf_1ddf_4e3b_82ec_52f91b944f62()
        {
            //INI CODE PRCGUID: e0724caf-1ddf-4e3b-82ec-52f91b944f62

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            ARQODE_UI.GestorProcesos.CVentanaProcesos   CVentanaProcesos  = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);

            String Origin_path = Clipboard.GetText();

            if (Origin_path.StartsWith("{"))
            {
                if (CVentanaProcesos.TV_Processes.SelectedNode.FullPath.EndsWith(".json"))
                {
                    JObject JPrcMove            = JObject.Parse(Origin_path);
                    String  Origin_process_path = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, JPrcMove["Process path"].ToString());
                    String  Origin_process_guid = JPrcMove["Process guid"].ToString();

                    // open orign file
                    JSonFile jOriginFile = new JSonFile(Origin_process_path);
                    JToken   JOriginPrc  = jOriginFile.getNode(String.Format("$.processes[?(@.Guid == '{0}')]", Origin_process_guid));

                    // open target file
                    String   Target_process_namespace = CVentanaProcesos.TV_Processes.SelectedNode.FullPath.Replace(dPROCESS.FOLDER + "\\", "").Replace(".json", "").Replace("\\", ".");
                    String   Target_process_path      = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, CVentanaProcesos.TV_Processes.SelectedNode.FullPath);
                    JSonFile JTargetFile = new JSonFile(Target_process_path);
                    if (JTargetFile.getNode(String.Format("$.processes[?(@.Guid == '{0}')]", Origin_process_guid)) == null)
                    {
                        CStructModifications csmod = new CStructModifications(sys, App_globals);
                        csmod.MoveProcess_byGuid(Origin_process_guid, Target_process_namespace);

                        (JTargetFile.jActiveObj["processes"] as JArray).Add(JOriginPrc);
                        JTargetFile.Write();

                        JOriginPrc.Remove();
                        jOriginFile.Write();
                    }
                    else
                    {
                        MessageBox.Show("Ya existe un proceso con el Guid " + Origin_process_guid + " en el fichero de procesos " + CVentanaProcesos.TV_Processes.SelectedNode.FullPath);
                    }
                }
                else
                {
                    MessageBox.Show("Debes seleccionar un fichero del árbol de procesos donde mover el proceso seleccionado.");
                }
            }

            //END CODE PRCGUID: e0724caf-1ddf-4e3b-82ec-52f91b944f62
        }
Example #10
0
        /// #NAME#: #DESCRIPTION#
        public void f_b6e71095_5f94_49c4_a330_9950b390d963()
        {
            //INI CODE PRCGUID: b6e71095-5f94-49c4-a330-9950b390d963

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            String cadBusqueda = CVentanaProgramas.MenuTop.Items[7].Text;

            CStructModifications csmod             = new CStructModifications(sys, App_globals);
            List <KeyValuePair <JToken, int> > res = csmod.Find_all_in_programs(cadBusqueda);

            DataTable dt = new DataTable();

            dt.Columns.Add("Path");
            dt.Columns.Add("Ruta");
            dt.Columns.Add("Proceso");
            dt.Columns.Add("Guid");
            int max = 0;

            foreach (KeyValuePair <JToken, int> s in res)
            {
                if (max == 0)
                {
                    max = s.Value;
                }
                if (s.Value > max - 2)
                {
                    String programa  = s.Key["Program"].ToString();
                    String proceso   = s.Key["Process name"].ToString();
                    String proc_guid = s.Key["Process guid"].ToString();

                    String cad = programa.Replace(App_globals.AppDataSection(dPATH.CODE).FullName + "\\", "").Replace("\\", ".").Replace(".json", "");
                    dt.Rows.Add(new object[] { cad, cad, proceso, proc_guid });
                }
                else
                {
                    break;
                }
            }

            Outputs("Tabla resultados", dt);
            Outputs("Num columna con path", 0);

            //END CODE PRCGUID: b6e71095-5f94-49c4-a330-9950b390d963
        }
Example #11
0
        /// #NAME#: #DESCRIPTION#
        public void f_4e18d420_853d_4652_9f0f_dd41587094d4()
        {
            //INI CODE PRCGUID: 4e18d420-853d-4652-9f0f-dd41587094d4

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            String active_app = (CVentanaProgramas.MenuTop.Items[5].Text != "") ?
                                CVentanaProgramas.MenuTop.Items[5].Text :
                                dGLOBALS.SYSTEM_APP;
            CStructModifications csmod = new CStructModifications(sys, App_globals);
            ArrayList            ar    = csmod.CheckProcessIntegrityInPrograms();

            CVentanaProgramas.MenuTop.Items[12].BackColor = (ar.Count > 0) ?
                                                            System.Drawing.Color.Red :
                                                            System.Drawing.Color.FromName("Control");

            Outputs("Errores reportados", ar);

            //END CODE PRCGUID: 4e18d420-853d-4652-9f0f-dd41587094d4
        }
        /// #NAME#: #DESCRIPTION#
        public void f_Eliminar_programa()
        {
            //INI CODE PRCGUID: Eliminar programa
            TreeView ArbolProgramas = (TreeView)view.getCtrl("ArbolProgramas");

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            if (ArbolProgramas.SelectedNode.FullPath.EndsWith(".json"))
            {
                CStructModifications csmod          = new CStructModifications(sys, App_globals);
                ArrayList            listaProgramas = csmod.SearchProgramCalls_IOC(ArbolProgramas.SelectedNode.FullPath.Replace(dPROGRAM.FOLDER + "\\", "").Replace("\\", ".").Replace(".json", ""));
                if (listaProgramas.Count <= 0)
                {
                    DirectoryInfo di = App_globals.AppDataSection(dPATH.CODE);

                    File.Delete(Path.Combine(di.FullName, ArbolProgramas.SelectedNode.FullPath));
                }
                else
                {
                    String        mensaje = "";
                    DirectoryInfo pprog   = App_globals.AppDataSection(dPATH.PROGRAM);
                    foreach (String programa in listaProgramas)
                    {
                        mensaje += programa.Replace(pprog.FullName + "\\", "") + "\r\n";
                    }
                    MessageBox.Show("No se puede eliminar el programa hasta que no se eliminen las siguientes referencias: \r\n" + mensaje);
                }
            }
            else
            {
                String        di_path = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, ArbolProgramas.SelectedNode.FullPath);
                DirectoryInfo di      = new DirectoryInfo(di_path);
                if (di.GetFiles().Count() <= 0)
                {
                    di.Delete();
                    ArbolProgramas.SelectedNode.Remove();
                }
                else
                {
                    MessageBox.Show("El directorio debe estar vacío para poder ser eliminado");
                }
            }
            //END CODE PRCGUID: Eliminar programa
        }
Example #13
0
        /// #NAME#: #DESCRIPTION#
        public void f_e0ac24cc_d14e_4e0c_bb6b_da7a4942a916()
        {
            //INI CODE PRCGUID: e0ac24cc-d14e-4e0c-bb6b-da7a4942a916

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            ARQODE_UI.GestorProcesos.CVentanaProcesos   CVentanaProcesos  = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);

            String Origin_path = Clipboard.GetText();

            if ((!Origin_path.StartsWith("{")) && (CVentanaProcesos.TV_Processes.SelectedNode.FullPath.Contains(dPROCESS.FOLDER + "\\")))
            {
                DirectoryInfo pprocs           = App_globals.AppDataSection(dPATH.PROCESSES);
                String        Origin_full_path = Path.Combine(pprocs.FullName, Origin_path.Replace(".", "\\") + ".json");

                if (File.Exists(Origin_full_path))
                {
                    FileInfo fi = new FileInfo(Origin_full_path);
                    String   Target_full_path = Path.Combine(Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, CVentanaProcesos.TV_Processes.SelectedNode.FullPath), fi.Name);
                    String   Target_path      = (CVentanaProcesos.TV_Processes.SelectedNode.FullPath.Replace(dPROCESS.FOLDER + "\\", "") + "." + fi.Name).Replace(".json", "").Replace("\\", ".");

                    // Replace old program path ocurrencies
                    CStructModifications csmod = new CStructModifications(sys, App_globals);
                    csmod.MoveProcess_byNamespace(Origin_path, Target_path);

                    // File move
                    File.Move(Origin_full_path, Target_full_path);

                    CVentanaProcesos.contextMenu_Procesos.Items[2].Enabled = false;
                }
                else
                {
                    MessageBox.Show("Debe cortar un programa del árbol de programas antes de pegarlo");
                }
            }
            else
            {
                MessageBox.Show("Debe pegar el programa dentro del árbol de programas");
            }

            //END CODE PRCGUID: e0ac24cc-d14e-4e0c-bb6b-da7a4942a916
        }
        /// #NAME#: #DESCRIPTION#
        public void f_1ff83da1_817c_4c05_bf34_579e43091bb0()
        {
            //INI CODE PRCGUID: 1ff83da1-817c-4c05-bf34-579e43091bb0

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);

            if (CVentanaProgramas.ArbolProgramas.SelectedNode.FullPath.Contains(dPROGRAM.FOLDER + "\\"))
            {
                String        Origin_path      = Clipboard.GetText();
                DirectoryInfo pprog            = App_globals.AppDataSection(dPATH.PROGRAM);
                String        Origin_full_path = Path.Combine(pprog.FullName, Origin_path.Replace(".", "\\") + ".json");

                if (File.Exists(Origin_full_path))
                {
                    FileInfo fi = new FileInfo(Origin_full_path);
                    String   Target_full_path = Path.Combine(Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, CVentanaProgramas.ArbolProgramas.SelectedNode.FullPath), fi.Name);
                    String   Target_path      = (CVentanaProgramas.ArbolProgramas.SelectedNode.FullPath.Replace(dPROGRAM.FOLDER + "\\", "") + "." + fi.Name).Replace(".json", "").Replace("\\", ".");

                    // Replace old program path ocurrencies
                    CStructModifications csmod = new CStructModifications(sys, App_globals);
                    csmod.MoveProgram(Origin_path, Target_path);

                    // File move
                    File.Move(Origin_full_path, Target_full_path);

                    CVentanaProgramas.contextMenu_Programas.Items[2].Enabled = false;
                }
                else
                {
                    MessageBox.Show("Debe cortar un programa del árbol de programas antes de pegarlo");
                }
            }
            else
            {
                MessageBox.Show("Debe pegar el programa dentro del árbol de programas");
            }


            //END CODE PRCGUID: 1ff83da1-817c-4c05-bf34-579e43091bb0
        }
Example #15
0
        /// #NAME#: #DESCRIPTION#
        public void f_246c3776_b78e_4702_b593_78ce31b6fef7()
        {
            //INI CODE PRCGUID: 246c3776-b78e-4702-b593-78ce31b6fef7

            ARQODE_UI.GestorProcesos.CVentanaProcesos CVentanaProcesos = new ARQODE_UI.GestorProcesos.CVentanaProcesos(vm);

            JToken JProc = ((KeyValuePair <String, JToken>)CVentanaProcesos.LProcess.SelectedItem).Value;

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            CStructModifications csmod = new CStructModifications(sys, App_globals);
            String    prc_guid         = JProc["Guid"].ToString();
            ArrayList program_refs     = csmod.FindProcessInPrograms(prc_guid);

            if (program_refs.Count <= 0)
            {
                // Remove process
                String   prc_path = Path.Combine(App_globals.AppDataSection(dPATH.CODE).FullName, CVentanaProcesos.TV_Processes.SelectedNode.FullPath);
                JSonFile jProcess = new JSonFile(prc_path);
                JToken   jPrc     = jProcess.getNode(String.Format("$.processes[?(@.Guid == '{0}')]", prc_guid));
                if (jPrc != null)
                {
                    jPrc.Remove();
                    jProcess.Write();
                }
            }
            else
            {
                //String message = "";
                //DirectoryInfo pprog = App_globals.DataSection(dPATH.PROGRAM);
                //foreach (String program in program_refs) { message += program.Replace(pprog.FullName + "\\", "") + "\r\n"; }
                //MessageBox.Show("Antes de eliminar este proceso debe eliminar las siguientes referencias en programas: \r\n" + message);

                String call_buscar_referencias = Config_str("Call a buscar referencias");
                vm.CallProgram(event_desc, call_buscar_referencias);
            }

            //END CODE PRCGUID: 246c3776-b78e-4702-b593-78ce31b6fef7
        }
Example #16
0
        /// #NAME#: #DESCRIPTION#
        public void f_df797af7_6e48_40b0_96c3_7278d4d71ab7()
        {
            //INI CODE PRCGUID: df797af7-6e48-40b0-96c3-7278d4d71ab7

            ARQODE_UI.GestorProcesos.CFormProceso CFormProceso = new ARQODE_UI.GestorProcesos.CFormProceso(vm);
            JToken JProc = (JToken)CFormProceso.Proceso;

            JProc["Description"] = CFormProceso.TBDescription.Text;

            // Load inputs
            JArray JInputs = new JArray();

            foreach (String input in CFormProceso.TBInputs.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                JInputs.Add(input.Trim());
            }
            JProc["Inputs"] = JInputs;

            // Load outputs
            JArray JOutputs = new JArray();

            foreach (String output in CFormProceso.TBOutputs.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                JOutputs.Add(output.Trim());
            }
            JProc["Outputs"] = JOutputs;

            // Load configuration
            JArray JConfiguration = new JArray();

            foreach (String config in CFormProceso.TBConfiguration.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                JConfiguration.Add(config.Trim());
            }
            JProc["Configuration"] = JConfiguration;

            // Load configuration
            JArray JDefault_Configuration = new JArray();

            foreach (String def_config in CFormProceso.TBDefault_Configuration.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (def_config.Contains(":"))
                {
                    String[] name_value = def_config.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                    JDefault_Configuration.Add(new JObject(new JProperty(name_value[0].Trim(), name_value[1].Trim())));
                }
                else
                {
                    MessageBox.Show("Error in Default config format. Correct samples: default operator: sum, allow null: false, max intents: 4");
                }
            }
            JProc["Default_Configuration"] = JDefault_Configuration;

            // Process info
            if ((JProc["Name"].ToString() != CFormProceso.TBName.Text) && (!CFormProceso.TBName.Text.Trim().Equals("")))
            {
                JProc["Name"] = CFormProceso.TBName.Text;
            }

            ARQODE_UI.GestorProgramas.CVentanaProgramas CVentanaProgramas = new ARQODE_UI.GestorProgramas.CVentanaProgramas(vm);
            CStructModifications csmod = new CStructModifications(sys, App_globals);

            csmod.SaveProcess(JProc as JObject);

            //Replace process
            JSonFile JProcesses = new JSonFile(CFormProceso.FicheroProceso.ToString());
            JToken   JOld_prce  = JProcesses.getNode(String.Format("$.processes[?(@.Guid == '{0}')]", JProc["Guid"].ToString()));

            JOld_prce.Replace(JProc);
            JProcesses.Write();


            //END CODE PRCGUID: df797af7-6e48-40b0-96c3-7278d4d71ab7
        }