コード例 #1
0
 /// <summary>
 /// 根据FileInfo更新节点
 /// </summary>
 /// <param name="node"></param>
 /// <param name="fileInfo"></param>
 public static RadTreeNode UpdateFileNode(this RadTreeNode node, NFileInfo fileInfo)
 {
     node.ToolTipText = fileInfo.ToUITipString();
     node.Text        = fileInfo.DisplayName;
     node.SetImageIcon(fileInfo.LocalPath, NavigateTree.ThumbImgSize, NavigateTree.ThumbImgSize);
     if ((node.Tag as NFileInfo).Operation != EOperType.eADD)
     {
         fileInfo.Operation = EOperType.eUPD;
     }
     fileInfo.FileNO = (node.Tag as NFileInfo).FileNO;
     node.Tag        = fileInfo;
     return(node);
 }
コード例 #2
0
        /// <summary>
        /// 创建来自本地采集文件的节点,根据BatchInfo的LastNo生成FileNo
        /// </summary>
        /// <param name="parentNode"></param>
        /// <param name="fileInfo"></param>
        /// <param name="contextMenu"></param>
        /// <param name="batchInfo"></param>
        /// <returns></returns>
        public RadTreeNode CreateFileNodeFromLocal(RadTreeNode parentNode, NFileInfo fileInfo, NBatchInfo batchInfo)
        {
            fileInfo.BatchNO = batchInfo.BatchNO;
            batchInfo.LastNO++;
            fileInfo.FileNO = batchInfo.LastNO.ToString();

            RadTreeNode fileNode = parentNode.Nodes.Add(fileInfo.DisplayName);

            fileNode.SetImageIcon(fileInfo.LocalPath, ThumbImgSize, ThumbImgSize);
            //node2.Image = ImageHelper.LoadSizedImage(info.LocalPath, this.GetSetting().ThumbImgSize, this.GetSetting().ThumbImgSize);
            fileNode.Tag           = fileInfo;
            fileNode.Selected      = true;
            fileNode.ToolTipText   = fileInfo.ToUITipString();
            fileNode.ContextMenu   = fileContextMenu;
            fileNode.ItemHeight    = ThumbImgSize;
            fileNode.Checked       = true;
            fileNode.TextAlignment = ContentAlignment.MiddleCenter;

            return(fileNode);
        }