Exemple #1
0
        public void removeByName(string name)
        {
            process tmp = head;

            if (size() == 1)
            {
                head = null;
                return;
            }
            else if (tmp.get_processName() == name)
            {
                head = tmp.get_next();
                return;
            }
            else
            {
                tmp = tmp.get_next();
                while (tmp.get_processName() != name && tmp.get_next() != null)
                {
                    tmp = tmp.get_next();
                }
                process tmp2 = tmp.get_next();
                tmp.set_next(tmp2.get_next());
            }
        }
Exemple #2
0
        public process findByName(string i)
        {
            process tmp = head;

            while (tmp.get_processName() != i)
            {
                tmp = tmp.get_next();
            }
            return(tmp);
        }
        public void printPro()
        {
            mPro.sort(0);
            process pro  = mPro.get_hProcess();
            int     size = mPro.size();

            for (int i = 0; i < size; i++)
            {
                string proName = pro.get_processName();
                int    start   = pro.get_start();
                int    end     = pro.get_end();
                listBox2.Items.Add(proName + "    from    " + start + "    to    " + end);
                pro = pro.get_next();
            }
            printHoles();
        }