当前位置: 首页>>代码示例>>C#>>正文


C# TreeView.Update方法代码示例

本文整理汇总了C#中System.Windows.Forms.TreeView.Update方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.Update方法的具体用法?C# TreeView.Update怎么用?C# TreeView.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TreeView的用法示例。


在下文中一共展示了TreeView.Update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DisplayTo

 public static void DisplayTo( TreeView tree )
 {
     tree.BeginUpdate();
     tree.Nodes.Clear();
     Recurse( tree.Nodes, Config.GetUserDirectory( "Macros" ) );
     tree.EndUpdate();
     tree.Refresh();
     tree.Update();
 }
开发者ID:herculesjr,项目名称:razor,代码行数:9,代码来源:MacroManager.cs

示例2: writeContentsToCustomizeTreeView

 private void writeContentsToCustomizeTreeView(string[] levels, TreeView tv)
 {
     foreach (string level in levels)
     {
         if (level != "")
         {
             tv.Nodes.Add(level);
         }
     }
     tv.Update();
 }
开发者ID:v02zk,项目名称:Mycoding,代码行数:11,代码来源:TermSelectedForm.cs

示例3: ProcessTorrentFile


//.........这里部分代码省略.........

            if (bti == null) // single file torrent
            {
                bti = infoDict.GetItem("name");
                if ((bti == null) || (bti.Type != BTChunk.kString))
                    return false;

                BTString di = (BTString) (bti);
                string nameInTorrent = di.AsString();

                BTItem fileSizeI = infoDict.GetItem("length");
                Int64 fileSize = ((BTInteger) fileSizeI).Value;

                this.NewTorrentEntry(torrentFile, -1);
                if (this.DoHashChecking)
                {
                    byte[] torrentPieceHash = torrentPieces.StringTwentyBytePiece(0);

                    FileInfo fi = this.FindLocalFileWithHashAt(torrentPieceHash, 0, pieceSize, fileSize);
                    if (fi != null)
                        this.FoundFileOnDiskForFileInTorrent(torrentFile, fi, -1, nameInTorrent);
                    else
                        this.DidNotFindFileOnDiskForFileInTorrent(torrentFile, -1, nameInTorrent);
                }
                this.FinishedTorrentEntry(torrentFile, -1, nameInTorrent);

                // don't worry about updating overallPosition as this is the only file in the torrent
            }
            else
            {
                Int64 overallPosition = 0;
                Int64 lastPieceLeftover = 0;

                if (bti.Type != BTChunk.kList)
                    return false;

                BTList fileList = (BTList) (bti);

                // list of dictionaries
                for (int i = 0; i < fileList.Items.Count; i++)
                {
                    this.Prog(100 * i / fileList.Items.Count);
                    if (fileList.Items[i].Type != BTChunk.kDictionary)
                        return false;

                    BTDictionary file = (BTDictionary) (fileList.Items[i]);
                    BTItem thePath = file.GetItem("path");
                    if (thePath.Type != BTChunk.kList)
                        return false;
                    BTList pathList = (BTList) (thePath);
                    // want the last of the items in the list, which is the filename itself
                    int n = pathList.Items.Count - 1;
                    if (n < 0)
                        return false;
                    BTString fileName = (BTString) (pathList.Items[n]);

                    BTItem fileSizeI = file.GetItem("length");
                    Int64 fileSize = ((BTInteger) fileSizeI).Value;

                    int pieceNum = (int) (overallPosition / pieceSize);
                    if (overallPosition % pieceSize != 0)
                        pieceNum++;

                    this.NewTorrentEntry(torrentFile, i);

                    if (this.DoHashChecking)
                    {
                        byte[] torrentPieceHash = torrentPieces.StringTwentyBytePiece(pieceNum);

                        FileInfo fi = this.FindLocalFileWithHashAt(torrentPieceHash, lastPieceLeftover, pieceSize, fileSize);
                        if (fi != null)
                            this.FoundFileOnDiskForFileInTorrent(torrentFile, fi, i, fileName.AsString());
                        else
                            this.DidNotFindFileOnDiskForFileInTorrent(torrentFile, i, fileName.AsString());
                    }

                    this.FinishedTorrentEntry(torrentFile, i, fileName.AsString());

                    int sizeInPieces = (int) (fileSize / pieceSize);
                    if (fileSize % pieceSize != 0)
                        sizeInPieces++; // another partial piece

                    lastPieceLeftover = (lastPieceLeftover + (Int32) ((sizeInPieces * pieceSize) - fileSize)) % pieceSize;
                    overallPosition += fileSize;
                } // for each file in the torrent
            }

            if (tvTree != null)
            {
                tvTree.BeginUpdate();
                btFile.Tree(tvTree.Nodes);
                tvTree.ExpandAll();
                tvTree.EndUpdate();
                tvTree.Update();
            }

            this.Prog(0);

            return true;
        }
开发者ID:mudboy,项目名称:tvrename,代码行数:101,代码来源:BT.cs

示例4: writeRegSpecipicationToListBox

 private void writeRegSpecipicationToListBox(Dictionary<string, List<string>> result, TreeView tv)
 {
     tv.Nodes.Clear();
     foreach (KeyValuePair<string, List<string>> kvp in result)
     {
         TreeNode ChapterNode = tv.Nodes.Add(kvp.Key);
         List<string> list = kvp.Value;
         foreach (string s in list)
         {
             ChapterNode.Nodes.Add(s);
         }
     }
     tv.Update();
     tv.ExpandAll();
     tv.Nodes[0].EnsureVisible();
 }
开发者ID:v02zk,项目名称:Mycoding,代码行数:16,代码来源:Form1.cs

示例5: writeContentsToTreeView

        private void writeContentsToTreeView(string[] levels,TreeView tv)
        {

            foreach (string level in levels)
            {
                TreeNode first = tv.Nodes.Add(level);

                StringBuilder temp = new StringBuilder(500);
                GetPrivateProfileString("section", level, "", temp, 500, filePath.TERMFILEPATH);
                
                string[] terms = convertToStrings(temp);
                foreach (string term in terms)
                {

                    TreeNode tn = first.Nodes.Add(term);
                    temp = new StringBuilder(200);
                    GetPrivateProfileString("section", term, "", temp, 500, filePath.TERMFILEPATH);
                    
                    terms = convertToStrings(temp);
                    foreach (string s in terms)
                    {
                        if (s == "")
                            tn.Nodes.Add("无下层分类");
                        else
                            tn.Nodes.Add(s);
                    }

                }
                tv.Update();
            }
        }
开发者ID:v02zk,项目名称:Mycoding,代码行数:31,代码来源:TermSelectedForm.cs

示例6: generateTestSpecificationTreeView

 /// <summary>
 /// 生成说明书文档目录结构
 /// </summary>
 /// <param name="result"></param>
 /// <param name="tv"></param>
 /// <param name="regTreeView"></param>
 /// <returns></returns>
 public Dictionary<string, int> generateTestSpecificationTreeView(Dictionary<string, List<TermContainer>> result, TreeView tv, TreeView regTreeView)
 {
     Dictionary<string, int> dict = new Dictionary<string,int>();
     generateSpecificationTreeView(result, tv);
     dict = colorSpecificationTreeView(tv, regTreeView);
     tv.Update();
     tv.ExpandAll();
     tv.Nodes[0].EnsureVisible();
     return dict;
 }
开发者ID:v02zk,项目名称:Mycoding,代码行数:17,代码来源:TableOfContents.cs

示例7: generateTestTextTreeView

 /*
  * generate table of contents in tree view component in test document
  */
 public Dictionary<string, int> generateTestTextTreeView(Dictionary<string, List<TermContainer>> result, TreeView tv, TreeView regTreeView,Dictionary<string, List<string>> dictionaryList)
 {
     Dictionary<string, int> dict;
     generateTreeView(result, tv);
     dict = colorTreeView(tv,regTreeView,dictionaryList);
     tv.Update();
     tv.ExpandAll();
     tv.Nodes[0].EnsureVisible();
     regTreeView.Update();
     regTreeView.ExpandAll();
     regTreeView.Nodes[0].EnsureVisible();
     return dict;
 }
开发者ID:v02zk,项目名称:Mycoding,代码行数:16,代码来源:TableOfContents.cs

示例8: generateRegTreeView

  /*
 * generate table of contents in tree view component in regulation document
 */
  public void generateRegTreeView(Dictionary<string, List<TermContainer>> result, TreeView tv)
  {
      generateTreeView(result, tv);
      tv.Update();
      tv.ExpandAll();
      tv.Nodes[0].EnsureVisible();
  }
开发者ID:v02zk,项目名称:Mycoding,代码行数:10,代码来源:TableOfContents.cs

示例9: PopulateSignatureTree

        private void PopulateSignatureTree(SizeBasedCompleteSignature sig, Dictionary<TreeNode, List<BlockSignature>> sigDict, TreeView sigTV)
        {
            sigTV.Nodes.Clear();

            bool isLeftTree;
            if (sigTV.Name == "sigTreeView")
            {
                isLeftTree = true;
            }
            else
            {
                isLeftTree = false;
            }

            bothFilesShared = 0;

            PopulateSignatureTreeByOffset(sigTV, sig, sigDict);
            sharedSize.Text = bothFilesShared.ToString("N0");
            newSize.Text = (file2Size - bothFilesShared).ToString("N0");

            if (isLeftTree)
            {
                file1TotalSize.Text = file1Size.ToString("N0");
                sigTV.Update();
            }
            else
            {
                file2TotalSize.Text = file2Size.ToString("N0");
                sigTV.Update();
            }
        }
开发者ID:kpfaulkner,项目名称:sigexplorer,代码行数:31,代码来源:SignatureExplorerForm.cs


注:本文中的System.Windows.Forms.TreeView.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。