コード例 #1
0
        /*
         * TODO fields:
         * 0 = TODO
         * 1 = task name
         * 2 = allocated
         * 3 = effort
         * 4 = priority
         * 5 = descr
         * */
        private static void ProcessFile(string f)
        {
            int linecnt = 1;

            string[] lines = System.IO.File.ReadAllLines(f);

            foreach (string line in lines)
            {
                int idx = CheckTodoLine(line);

                if (idx >= 0)
                {
                    string   temp       = line.Substring(idx);
                    string[] tempfields = temp.Split(new char[] { ':' }, 6);
                    if (tempfields.GetLength(0) != 6)
                    {
                        Console.WriteLine(line);
                        throw new Exception("TODO entry not in correct format: line " + linecnt.ToString() + ", file: " + f);
                    }
                    Console.Write("TODO ");
                    Console.Write("Task: {0}, ", tempfields[1]);
                    Console.Write("Allocated: {0}, ", tempfields[2]);
                    Console.Write("Effort: {0}, ", tempfields[3]);
                    Console.Write("Priority: {0}, ", tempfields[4]);
                    Console.WriteLine(" Descr: {0}", tempfields[5]);

                    WriteTaskJugglerTask(1, tempfields, true, true, true);

                    TodoEntry tde = new TodoEntry();
                    tde.name      = tempfields [1];
                    tde.allocated = tempfields [2];
                    tde.effort    = tempfields [3];
                    tde.priority  = tempfields [4];
                    tde.descr     = tempfields [5];

                    TodoEntries.Add(tde);
                    todocount++;
                }
                linecnt++;
            }
        }
コード例 #2
0
        /*
         * TODO fields:
         * 0 = TODO
         * 1 = task name
         * 2 = allocated
         * 3 = effort
         * 4 = priority
         * 5 = descr
         * */
        private static void ProcessFile(string f)
        {
            int linecnt = 1;

            string[] lines = System.IO.File.ReadAllLines (f);

            foreach (string line in lines)
            {
                int idx = CheckTodoLine (line);

                if (idx >= 0)
                {
                    string temp = line.Substring (idx);
                    string[] tempfields = temp.Split (new char[] { ':' },6);
                    if (tempfields.GetLength (0) != 6)
                    {
                        Console.WriteLine (line);
                        throw new Exception ("TODO entry not in correct format: line "+linecnt.ToString() + ", file: " + f);
                    }
                    Console.Write ("TODO ");
                    Console.Write ("Task: {0}, ",tempfields[1]);
                    Console.Write ("Allocated: {0}, ",tempfields[2]);
                    Console.Write ("Effort: {0}, ",tempfields[3]);
                    Console.Write ("Priority: {0}, ",tempfields[4]);
                    Console.WriteLine(" Descr: {0}",tempfields[5]);

                    WriteTaskJugglerTask (1,tempfields,true,true,true);

                    TodoEntry tde = new TodoEntry ();
                    tde.name = tempfields [1];
                    tde.allocated = tempfields [2];
                    tde.effort = tempfields [3];
                    tde.priority = tempfields [4];
                    tde.descr = tempfields [5];

                    TodoEntries.Add (tde);
                    todocount++;
                }
                linecnt++;
            }
        }