Пример #1
0
        public void TelTreeDisp()
        {
            _TelerikLib.RadTree tree = new _TelerikLib.RadTree();


            if (TelTree != null)
            {
                // Loop through list of started threads for current status, update display

                if (ThreadList != null)
                {
                    int threadCount = ThreadCount(); // number of "Running" threads

                    string threadStatusMsg = "Running Thread Count : " + threadCount + " | " + DateTime.Now.ToShortDateString();


                    // assemble output to display thread status / messages

                    foreach (Thread thread in ThreadList)
                    {
                        string line = "Name: " + thread.Name + " | State: " + thread.ThreadState.ToString() + " | ID: " + thread.ManagedThreadId;


                        // Check to see if thread details dictionary contains entry for this thread, if so add to display
                        if (ThreadDetails.ContainsKey(thread.ManagedThreadId))
                        {
                            line = line + "\n" + ThreadDetails[thread.ManagedThreadId];
                        }



                        //if (ThreadMsg != "") { line = line + "\n" + ThreadMsg; } // add optional text passed in param



                        if (thread.ThreadState.ToString() != "Aborted")  // add line to display message if not previously aborted
                        {
                            threadStatusMsg = threadStatusMsg + line + "\n";
                        }


                        if (txtThreadStatus != null)
                        {
                            tel.Update(txtThreadStatus, threadStatusMsg);
                        }

                        RadTreeNode node = new RadTreeNode();
                        node.Text = line;
                        tree.AddNode(TelTree._RadTREE, node);
                    }
                }
            }
        }
Пример #2
0
        public void ComedianTree(RadTreeView radtree, string rootDir = "S:\\", bool NewThread = true)
        {
            _AHK        ahk = new _AHK();
            _Lists      lst = new _Lists();
            _TelerikLib tel = new _TelerikLib();

            _TelerikLib.RadTree tree = new _TelerikLib.RadTree();

            if (NewThread)
            {
                Thread imdbTVParseThread = new Thread(() => ComedianTree(radtree, rootDir, false));
                imdbTVParseThread.Start();
            }
            else
            {
                //string rootDir = "S:\\";

                List <string> Comedians = lst.DirList(rootDir, "*.*", false, false);

                Comedians = lst.SortList(Comedians); // alpha sort list

                foreach (string com in Comedians)
                {
                    string first = ahk.FirstCharacters(com, 1); if (first == "_")
                    {
                        continue;
                    }                                                                             // skip folders starting with "_"

                    // add node for comedian
                    RadTreeNode comNode = new RadTreeNode();
                    comNode.Text = com; comNode.Tag = rootDir + "\\" + com;
                    //radtree.Nodes.Add(comNode);
                    tree.AddNode(radtree, comNode);

                    // list of shows under comedian dir
                    List <string> shows = lst.DirList(rootDir + "\\" + com, "*.*", false, false);

                    shows = lst.SortList(shows); // alpha sort list

                    foreach (string show in shows)
                    {
                        RadTreeNode showNode = new RadTreeNode();
                        showNode.Text = show; showNode.Tag = rootDir + "\\" + com + "\\" + show;
                        //comNode.Nodes.Add(showNode);
                        tree.AddSubNode(comNode, showNode, radtree);
                    }
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Add TreeNode to TreeView (From Any Thread)
 /// </summary>
 /// <param name="radTree"></param>
 /// <param name="node"></param>
 public static void AddNode(this RadTreeView radTree, RadTreeNode node)
 {
     sharpAHK_Dev._TelerikLib.RadTree tree = new _TelerikLib.RadTree();
     tree.AddNode(radTree, node);
 }