void Add_event(string value) { ini ireader = new ini(); List <string> getAllSection = ireader.GetAllSection(ininame); for (int i = 0; i < getAllSection.Count; i++) { if (value.Contains(string.Format("pin{0}=", getAllSection[i]))) { string pins = getAllSection[i]; string Status = ireader.IniReadValue(getAllSection[i], "Status", ininame); string IO = ireader.IniReadValue(getAllSection[i], "IO", ininame); string Function = ireader.IniReadValue(getAllSection[i], "Function", ininame); string Returns = ireader.IniReadValue(getAllSection[i], "Returns", ininame); Slide slide = new Slide(pins, Status, IO, Function, Returns); if (slide.Check()) { if (slide.Returns.Contains("[time]")) { slide.Returns = slide.Returns.Replace("[time]", "[" + DateTime.Now.ToString() + "]"); } string[] var = value.Split(new string[] { "=" }, StringSplitOptions.RemoveEmptyEntries); if (slide.Returns.Contains("[var]")) { slide.Returns = slide.Returns.Replace("[var]", "[" + var[var.Length - 1].Trim('\r') + "]"); } Pin_Queue.Add(slide); if (quecount > 0) { quecount--; } } } } }
private void RefreshPins() { try { ini ireader = new ini(); List <string> Get = ireader.GetAllSection(ininame); bunifuDropdown3.Items = Get.ToArray(); } catch { } }
int getEvent() { int p = 0; ini ireader = new ini(); List <string> getAllSection = ireader.GetAllSection(ininame); for (int i = 0; i < getAllSection.Count; i++) { string pins = getAllSection[i]; string Status = ireader.IniReadValue(getAllSection[i], "Status", ininame); string IO = ireader.IniReadValue(getAllSection[i], "IO", ininame); string Function = ireader.IniReadValue(getAllSection[i], "Function", ininame); string Returns = ireader.IniReadValue(getAllSection[i], "Returns", ininame); Slide slide = new Slide(pins, Status, IO, Function, Returns); if (slide.Check()) { p++; } } return(p); }
private List <Slide> refreshSlideView() { List <Slide> slide = new List <Slide>(); ini ireader = new ini(); List <string> getAll = ireader.GetAllSection(ininame); for (int i = 0; i < getAll.Count; i++) { Slide newslide; string pins = getAll[i]; string Status = ireader.IniReadValue(getAll[i], "Status", ininame); string IO = ireader.IniReadValue(getAll[i], "IO", ininame); string Function = ireader.IniReadValue(getAll[i], "Function", ininame); string Returns = ireader.IniReadValue(getAll[i], "Returns", ininame); newslide = new Slide(pins, Status, IO, Function, Returns); if (newslide.Check()) { slide.Add(newslide); } } return(slide); }