public virtual Post GetThreadByBody(String body) { for (int i = 0; i < this.MyThreads.Count; i++) { Post p = IsCommentof(body, MyThreads.ElementAt(i)); if (p != null) { return(p); } } return(null); }
public virtual bool IsContain(Post p) { bool found = false; for (int i = 0; i < MyThreads.Count(); i++) { if (MyThreads.ElementAt(i).isContain(p)) { found = true; } } return(found); }
private void init() { this.serialPort1 = new SerialPort(); this.portList = SerialPort.GetPortNames(); this.commandLine = new CommandLine(this); this.home = new Home(this); this.schnittModus = new SchnittModus(this); this.einzelSchritt = new EinzelSchritt(this); this.halbAuto = new HalbAuto(this); this.auto = new Auto(this); this.wartung = new Wartung(this); this.myThreads = new MyThreads(this); }
public virtual bool removePost(Post p) { bool b = false; if (MyThreads.Contains(p)) { b = MyThreads.Remove(p); } else { Post par = null; foreach (Post thread in MyThreads) { par = IsParentOf(p, thread); if (par != null) { b = par.comments.Remove(p); break; } } } return(b && p.kill()); }
public virtual void AddNewThread(Post p) { MyThreads.Add(p); }
public virtual bool removeThread(Post p) { return(MyThreads.Remove(p)); }