/// <summary> /// Loads the completion definitions from an xml file /// </summary> /// <param name="cFile"></param> public void LoadCompletions(string cFile) { if (cFile == null || cFile.Trim() == "") return; Data.CompletionDS ds = new Data.CompletionDS(); if (File.Exists(cFile)) { try { ds.ReadXml(cFile); envs.Clear(); CompletionTriggers = ""; foreach (Data.CompletionDS.TriggersRow tr in ds.Triggers.Rows) { CompletionTriggers = CompletionTriggers + tr.Trigger; } foreach (Data.CompletionDS.EnvironmentsRow r in ds.Environments.Rows) { envs.Add(new CodeEnvironment(r)); } //ds.WriteXml(cFile); } catch (Exception e) { MessageBox.Show("Error reading Completion data... is the file (" + cFile + ") corrupt?\r\n" + e.Message); } } else { MessageBox.Show("Completion data not found (File: " + cFile +")"); } }
/// <summary> /// Loads the completion definitions from an xml file /// </summary> /// <param name="cFile"></param> public void LoadCompletions(string cFile) { Data.CompletionDS ds = new Data.CompletionDS(); if (File.Exists(cFile)) { try { ds.ReadXml(cFile); envs.Clear(); CompletionTriggers = ""; foreach (Data.CompletionDS.TriggersRow tr in ds.Triggers.Rows) { CompletionTriggers = CompletionTriggers + tr.Trigger; } foreach (Data.CompletionDS.EnvironmentsRow r in ds.Environments.Rows) { envs.Add(new CodeEnvironment(r)); } //ds.WriteXml(cFile); } catch (Exception e) { MessageBox.Show("Error reading Completion data... is the file (" + cFile + ") corrupt?\r\n" + e.Message); } } else { MessageBox.Show("Completion data not found (File: " + cFile + ")"); } }