public void LoadFolderCenter(string dicParameters, int itemID, string itemName)
 {
     ListViewCollection.Clear();
     ModelManage.Space_Service.Function_Invoke(SpaceCodeEnterEntity.GetFileByExtention, dicParameters, SpaceCodeEnterEntity.LoginUserName, SpaceCodeEnterEntity.WebLoginPassword, SpaceCodeEnterEntity.UserDomain, new Action <Dictionary <string, object> >((dicResult) =>
     {
         try
         {
             string json = Convert.ToString(dicResult[SpaceCodeEnterEntity.Collection]);
             List <SPItemEntity> sPItemEntity_List = JsonManage.JsonToEntity <SPItemEntity>(json, ',');
             this.Dispatcher.BeginInvoke(new Action(() =>
             {
                 foreach (var item in sPItemEntity_List)
                 {
                     if (item.ContentType.Equals(File_Flg))
                     {
                         fileType fileExtension   = default(fileType);
                         bool isTransferSuccessed = Enum.TryParse <fileType>(item.DocIcon, out fileExtension);
                         if (isTransferSuccessed)
                         {
                             this.DataLoad_File(item);
                         }
                     }
                 }
                 this.HidenTip();
             }));
         }
         catch (Exception ex)
         {
             LogManage.WriteLog(this.GetType(), ex);
         }
         finally
         {
         }
     }));
 }
        public void LoadFolderCenter(string dicParameters, int itemID, string itemName)
        {
            ListViewCollection.Clear();
            ModelManage.Space_Service.Function_Invoke(SpaceCodeEnterEntity.GetCollection, dicParameters, SpaceCodeEnterEntity.LoginUserName, SpaceCodeEnterEntity.WebLoginPassword, SpaceCodeEnterEntity.UserDomain, new Action <Dictionary <string, object> >((dicResult) =>
            {
                //跨线程(异步委托)
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    try
                    {
                        this.SpaceListViewItemList.Clear();
                        this.NavicateListView3.IsEnabled = false;

                        string json = Convert.ToString(dicResult[SpaceCodeEnterEntity.Collection]);
                        List <SPItemEntity> sPItemEntity_List = JsonManage.JsonToEntity <SPItemEntity>(json, ',');
                        if (this.currentBreadLine == null || this.currentBreadLine.Folder == null)
                        {
                            SPVirtualFolder folder = new SPVirtualFolder();
                            //folder.Name = "文档";
                            if (itemID > 0)
                            {
                                folder.ID = itemID;
                            }
                            if (!string.IsNullOrEmpty(itemName))
                            {
                                folder.Name = itemName;
                            }
                            SPVirtualItemInit(folder, sPItemEntity_List);

                            //设置根目录(第一层面包线,文件夹为第一层文件夹【会议文件夹】)
                            this.BreadLineRoot.Folder = folder;
                            //设置当前所处的目录
                            this.currentBreadLine = this.BreadLineRoot;

                            base.Bread_LineRoot = this.BreadLineRoot;
                            //清除之前的那根线【第一个面包线是不需要那根线的】
                            this.BreadLineRoot.ClearBeforeLine();
                            //面包线点击事件
                            this.BreadLineRoot.LineClickEventCallBack = breadLine_LineClickEvent;
                        }
                        else
                        {
                            SPVirtualItemInit(this.currentBreadLine.Folder, sPItemEntity_List);
                        }
                        //刷新当前页面
                        this.RefleshSpaceData(this.currentBreadLine);
                    }
                    catch (Exception ex)
                    {
                        LogManage.WriteLog(this.GetType(), ex);
                    }
                    finally
                    {
                    }
                }));
            }));
        }
        private void NetworkActions()
        {
            /**
             * Загружает в VirtualRequestDirs список запросов и каталогов
             */
            LEditorNetworkActions.FirstLoad_ListViewCollection(this);

            /**
             * Обновляет строку с ссылкой
             */
            LEditorNetworkActions.LinkUpdate_Confirm(this);

            /**
             * Устанавливает новый метод в списке методов запроса
             */
            LEditorNetworkActions.MethodUpdate_Confirm(this);

            /**
             * Обновляет список параметров запроса
             */
            LEditorNetworkActions.RequestParamsUpdate_Confirm(this);

            LEditorNetworkActions.RequestParamsDelete_Confirm(this);
            LEditorNetworkActions.RequestParamsDeleteAll_Confirm(this);

            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                var MBinding = Package.Unpacking <MBinding_WebRequest>(ServerResponse.DataBytes);

                VirtualRequestDirs.Add(new ModelRequestDirectory
                {
                    Id            = MBinding.Directory.Id,
                    RequestTitle  = MBinding.Item.Title,
                    Title         = MBinding.Directory.Title,
                    RequestMethod = MBinding.Item.Method,
                    WebRequest    = MBinding.Item.Link,
                    WebRequestId  = MBinding.Item.Id
                });

                ListViewCollection.Refresh();
            }, Dispatcher, -1, "WebRequestItem.MBinding_WebRequest.Add", GeneralLogic.UserControl_Uid, true);

            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                var RequestItem = Package.Unpacking <WebRequestItem>(ServerResponse.DataBytes);

                var DirItem = Array.Find(VirtualRequestDirs.ToArray(), x => x.WebRequestId == RequestItem.Id);

                Debug.Log("Удаление каталога: " + DirItem.RequestTitle);

                VirtualRequestDirs.Remove(DirItem);
                ListViewCollection.Refresh();

                if (RequestDirectory != null && RequestDirectory.WebRequestId == RequestItem.Id)
                {
                    Debug.Log("Удаление Tab вкладки");
                    ProjectData.TabCollecton.Items.Remove(TabItemView);
                }
            }, Dispatcher, -1, "WebRequestDir.Delete.Confirm", GeneralLogic.UserControl_Uid, true);

            NetworkDelegates.Add(delegate(MResponse ServerResponse)
            {
                if (RequestDirectory == null)
                {
                    return;
                }

                var MRDir = Package.Unpacking <ModelRequestDirectory>(ServerResponse.DataBytes);

                for (int i = 0; i < VirtualRequestDirs.Count; i++)
                {
                    if (VirtualRequestDirs[i].Id == MRDir.Id)
                    {
                        VirtualRequestDirs[i].Title        = MRDir.Title;
                        VirtualRequestDirs[i].RequestTitle = MRDir.RequestTitle;
                        break;
                    }
                }
                ListViewCollection.Refresh();

                GeneralLogic.HeaderName = MRDir.RequestTitle;
                GeneralLogic.SetHeaderName(TabItemView);
            }, Dispatcher, -1, "WebRequestDir.RequestDirectory.Update.Confirm", GeneralLogic.UserControl_Uid, true);
        }
Beispiel #4
0
 public ListView()
 {
     Items = new ListViewCollection(this);
 }