Exemple #1
0
 private void buildColleagueTreeRecursive(int iParentID, Colleague colleague, TreeNodeCollection nodeCollection)
 {
     IEnumerable<Folder> listColleagueFolders = Globals.ThisAddIn.user.LoadColleagueFolders(colleague.ServerAddress, colleague.UserID, iParentID);
     foreach (Folder folder in listColleagueFolders)
     {
         TreeNode nodeFolder = new TreeNode();
         nodeFolder.Name = "colleaguefolder_" + folder.ID;
         nodeFolder.Text = folder.Name;
         nodeFolder.Tag = colleague;
         nodeFolder.ImageKey = nodeFolder.SelectedImageKey = getMappedFolderImage(folder.Type);
         nodeCollection.Add(nodeFolder);
         buildColleagueTreeRecursive(folder.ID, colleague, nodeFolder.Nodes);
     }
 }
Exemple #2
0
        private void loadItems(bool bFiltering, string filter, bool bFromColleague, Colleague colleague, string strFolderID)
        {
            try
            {
                if (selectedFolder != null || bFromColleague)
                {
                    if (bFiltering)
                    {
                        if (masterThread.IsAlive  && masterThread.Name == "loadingitems")
                            masterThread.Abort();

                        ParameterizedThreadStart threadStart = new ParameterizedThreadStart(masterControlThread.FilterItems);
                        masterThread = new Thread(threadStart);
                        masterThread.Name = "loadingitems";
                        Dictionary<string, object> data = new Dictionary<string, object>();
                        data["ItemList"] = itemList;
                        data["Filter"] = filter;
                        masterThread.Start(data);
                    }
                    else
                    {
                        if (masterThread.IsAlive && masterThread.Name == "loadingitems")
                            masterThread.Abort();
                        inputSearch.Enabled = false;
                        prepareLoadingItemsLabel();
                        if (bFromColleague)
                        {
                            ParameterizedThreadStart threadStart = new ParameterizedThreadStart(masterControlThread.LoadColleagueItems);
                            masterThread = new Thread(threadStart);
                            masterThread.Name = "loadingitems";
                            Dictionary<string, object> data = new Dictionary<string, object>();
                            data["Colleague"] = colleague;
                            data["FolderID"] = strFolderID;
                            masterThread.Start(data);
                        }
                        else
                        {
                            ParameterizedThreadStart threadStart = new ParameterizedThreadStart(masterControlThread.LoadItems);
                            masterThread = new Thread(threadStart);
                            masterThread.Name = "loadingitems";
                            masterThread.Start(selectedFolder.ID);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.WriteLine(LogType.Error, "MasterControl::loadItems", ex.ToString());
            }
        }