public bool LoadGrammar() { //char[] delimiterChars = { ' ', ',', '.', ':', '(', ')', '{', '}', '\t', '\n' }; try { Console.WriteLine("iniciando carga de Gramatica"); char[] delimiterSentece = { '\n' }; char[] delimiterWord = { ';' }; string PathFile = Helpers.OpenFile(); Console.WriteLine("cargando file"); string ContentFile = Helpers.ReadFile(PathFile); string[] ArrayGrammar = ContentFile.Split(delimiterSentece); foreach (var w in ArrayGrammar) { Console.WriteLine(w); string[] Grammar = w.Split(delimiterWord); RequestDB.NewGrammar(Grammar[0], Grammar[1]); } MessageBox.Show(ContentFile, "File Content at path: " + PathFile, MessageBoxButtons.OK); } catch (Exception e) { Console.WriteLine("Exception: " + e.Message); } finally { Console.WriteLine("Executing finally block."); } return(true); }
public void CreateKeyWords() { var DataKeyWords = RequestDB.GetKeyWords(); KeyWordList = DataKeyWords.Tables[0].AsEnumerable().Select( dataRow => new KeyWord { Mkeyword = dataRow.Field <string>("palabra"), Mtype = dataRow.Field <string>("tipo_palabra"), MwordCs = dataRow.Field <string>("palabracs"), }).ToList(); }
private void RequestProyectData(int idpro) { var data = RequestDB.GetProyectId(idpro); var name = Convert.ToString(data.Tables[0].Rows[0][0]); Ltitleproyect.Text = name; Gnameproyect = name; string path = Environment.rootDir + name; treeView1.Nodes.Add(Helpers.GenerateTreeView(path)); PrintLogProcess("-> Cargando proyecto: " + name); }
private void BtnCreateProyect_Click(object sender, EventArgs e) { string ProyectName = TxbNameProyect.Text; string SolutionName = TxtBSolution.Text; RequestDB.CreateNewProyect(ProyectName, SolutionName); CreateFile.NewFolder(ProyectName); CreateFile.NewFile(ProyectName, SolutionName); int lastId = RequestDB.GetLastId(); Ide ide = new Ide(lastId); ide.Show(); this.Hide(); }
public static bool LoadKeyword() { //char[] delimiterChars = { ' ', ',', '.', ':', '(', ')', '{', '}', '\t', '\n' }; char[] delimiterSentece = { '\n' }; char[] delimiterWord = { '|' }; string PathFile = Helpers.OpenFile(); string ContentFile = Helpers.ReadFile(PathFile); string[] ArrayKeywords = ContentFile.Split(delimiterSentece); foreach (var w in ArrayKeywords) { string[] kw = w.Split(delimiterWord); RequestDB.NewKeyWord(kw[0], kw[1], kw[2]); } MessageBox.Show(ContentFile, "File Content at path: " + PathFile, MessageBoxButtons.OK); return(true); }
private void StatusKeyWord() { int Result = RequestDB.GetCountKeyWord(); if (Result > 0) { LKeyWords.Text = "😄 Listo..!!"; LKeyWords.ForeColor = Color.FromArgb(0, 122, 204); BtnKeyWords.ForeColor = Color.FromArgb(0, 122, 204); BtnKeyWords.FlatAppearance.BorderColor = Color.FromArgb(0, 122, 204); StatusKeyWords = true; } else { LKeyWords.Text = "😪 Falta ...!!"; LKeyWords.ForeColor = Color.FromArgb(245, 83, 133); BtnKeyWords.ForeColor = Color.FromArgb(245, 83, 133); BtnKeyWords.FlatAppearance.BorderColor = Color.FromArgb(245, 83, 133); } }
private void StatusGrammar() { int Result = RequestDB.GetCountGrammar(); if (Result > 0) { LGramatica.Text = "😄 Listo..!!"; LGramatica.ForeColor = Color.FromArgb(0, 122, 204); BtnGramatica.ForeColor = Color.FromArgb(0, 122, 204); BtnGramatica.FlatAppearance.BorderColor = Color.FromArgb(0, 122, 204); StatusGramatica = true; } else { LGramatica.Text = "😪 Falta ...!!"; LGramatica.ForeColor = Color.FromArgb(245, 83, 133); BtnGramatica.ForeColor = Color.FromArgb(245, 83, 133); BtnGramatica.FlatAppearance.BorderColor = Color.FromArgb(245, 83, 133); } }
private void BtnDeleteGrammar_Click(object sender, EventArgs e) { RequestDB.DeleteGrammar(); StatusGramatica = false; StatusGrammar(); }
private void BtnDeleteKeyWord_Click(object sender, EventArgs e) { RequestDB.DeleteKeyWord(); StatusKeyWords = false; StatusKeyWord(); }
private void LoadProyects() { dataGridView1.DataSource = RequestDB.GetProyects(); }