Пример #1
0
        /// <summary>
        /// 生成文件夹
        /// </summary>
        /// <param name="folderList">文件夹目录</param>
        /// <param name="row1Height">行1高</param>
        /// <param name="fileHeigth">文件高</param>
        /// <param name="fileWidth">文件宽</param>
        private void DataLoad_Directory(List <SP.Folder> folderList, double row1Height, double fileHeigth, double fileWidth)
        {
            try
            {
                //生成书本形式的文件夹
                foreach (var folderItem in folderList)
                {
                    UCBook ucBook = new UCBook(folderItem.Name, "/Image/TypeImage/folder.png")
                    {
                        Date = DateTime.Now.ToShortTimeString(), BookType = BookType.Folder, Width = fileWidth, Height = fileHeigth, Row1Height = row1Height
                    };
                    this.Items_Add(ucBook);

                    //创建一个面包线(目前在这里创建和根面包线【书架自带】)
                    BreadLine breadLine = new BreadLine()
                    {
                        Folder = folderItem, Title = folderItem.Name
                    };
                    //关联指定生成的面包线()
                    ucBook.BreadLine = breadLine;
                    //删除文件
                    ucBook.FileDeleteCallBack = ucBook_DeleteFile;
                    //面包线点击事件
                    breadLine.LineClickEventCallBack = breadLine_LineClickEvent;
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Пример #2
0
 /// <summary>
 /// 面包线初始化
 /// </summary>
 public void SpaceLineInit()
 {
     try
     {
         //等待提示
         this.ShowTip();
         ThreadPool.QueueUserWorkItem((o) =>
         {
             try
             {
                 //获取会议根目录
                 var mettingList = SpaceCodeEnterEntity.ClientContextManage.GetFolders(listName);
                 //获取相关会议的所有文档
                 var mettingF = mettingList.Where(Item => Item.Name.Equals(folderName)).ToList <SP.Folder>();
                 //跨线程(异步委托)
                 this.Dispatcher.BeginInvoke(new Action(() =>
                 {
                     try
                     {
                         if (mettingF.Count > 0)
                         {
                             //设置根目录(第一层面包线,文件夹为第一层文件夹【会议文件夹】)
                             this.BreadLineRoot.Folder = mettingF[0];
                             //设置当前所处的目录
                             this.currentBreadLine = this.BreadLineRoot;
                             //清除之前的那根线【第一个面包线是不需要那根线的】
                             this.BreadLineRoot.ClearBeforeLine();
                             //面包线点击事件
                             this.BreadLineRoot.LineClickEventCallBack = breadLine_LineClickEvent;
                             //刷新当前页面
                             this.RefleshSpaceData(this.currentBreadLine);
                         }
                         else
                         {
                             //刷新当前页面
                             this.RefleshSpaceData(this.currentBreadLine);
                             //等待提示
                             this.HidenTip();
                         }
                     }
                     catch (Exception ex)
                     {
                         LogManage.WriteLog(this.GetType(), ex);
                     };
                 }));
             }
             catch (Exception ex)
             {
                 LogManage.WriteLog(this.GetType(), ex);
             }
         });
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
 }
Пример #3
0
        /// <summary>
        /// 数据刷新
        /// </summary>
        /// <param name="folder"></param>
        public void RefleshSpaceData(BreadLine bread_Line)
        {
            try
            {
                //面包线是否为null
                if (bread_Line == null)
                {
                    return;
                }
                if (bread_Line.Folder != null)
                {
                    //等待提示
                    this.ShowTip();

                    TimerJob.StartRun(new Action(() =>
                    {
                        //清除书架
                        this.Items_Clear();
                        //获取文件夹
                        SP.Folder folder = bread_Line.Folder;

                        ThreadPool.QueueUserWorkItem((o) =>
                        {
                            try
                            {
                                //加载当前会议文件夹
                                SpaceCodeEnterEntity.ClientContextManage.LoadMethod(folder.Folders);
                                //获取当会议文件夹
                                List <SP.Folder> folderList = folder.Folders.ToList <SP.Folder>();

                                //加载当前所有文件
                                SpaceCodeEnterEntity.ClientContextManage.LoadMethod(folder.Files);
                                //获取当前所有文件
                                List <SP.File> fileList = folder.Files.ToList <SP.File>();

                                DataLoad_All(folderList, fileList);
                            }
                            catch (Exception ex)
                            {
                                LogManage.WriteLog(this.GetType(), ex);
                            }
                        });
                    }));
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
        }
Пример #4
0
 /// <summary>
 /// 根面包线点击事件
 /// </summary>
 /// <param name="breadLine"></param>
 void breadLine_LineClickEvent(BreadLine breadLine)
 {
     try
     {
         //清空面包线之后的子项
         breadLine.BreadLineChild = null;
         //设置当前的目录
         this.currentBreadLine = breadLine;
         //刷新当前页面
         this.RefleshSpaceData(this.currentBreadLine);
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
 }