Exemple #1
0
 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);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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());
        }
Exemple #5
0
 public virtual void AddNewThread(Post p)
 {
     MyThreads.Add(p);
 }
Exemple #6
0
 public virtual bool removeThread(Post p)
 {
     return(MyThreads.Remove(p));
 }