/// <summary>
 /// 删除某个提取项数据
 /// </summary>
 private void DoDeleteDataCommond(object item)
 {
     if (item == null)
     {
         return;
     }
     if (ShowMessageBox(string.Format(Languagekeys.DeleteNotice, item)))
     {
         Task.Factory.StartNew(() =>
         {
             AsyncOperator.Execute(() => { CurrentOperation = Languagekeys.DeletingData; IsFiltering = true; });
             string path = Path.Combine(_currentDevicePath, item.ToString());
             BaseUtility.Helper.FileHelper.RemoveDirectoryReadOnly(path);
             Directory.Delete(path, true);
             AsyncOperator.Execute(() =>
             {
                 IsFiltering = false;
                 var d       = DataList.FirstOrDefault(e => e.Text == item.ToString());
                 DataList.Remove(d);
                 HasDataList = DataList != null && DataList.Count > 0;
                 if (!SelectDefaultNode(DataList))
                 {
                     LayoutViewItems        = new ObservableCollection <object>();
                     SelectedLayoutViewItem = null;
                     HasData = SelectedLayoutViewItem != null;
                 }
             });
         });
     }
 }
        private void LoadData(string devicePath)
        {
            Task.Factory.StartNew(() =>
            {
                IsFiltering = true;

                _currentDevicePath = devicePath;

                //DetectionManager.Instance.Detect(devicePath);
                var dataList = DeviceExternsion.LoadDeviceData(devicePath);
                foreach (var item in dataList)
                {
                    item.BuildParent();
                }
                AsyncOperator.Execute(() =>
                {
                    DataList = dataList;

                    //重置数据
                    MessageAggregation.SendGeneralMsg(new GeneralArgs <ObservableCollection <DataExtactionItem> >(MessageKeys.SetDataListKey)
                    {
                        Parameters = DataList
                    });

                    IsFiltering = false;
                    HasDataList = DataList != null && DataList.Count > 0;

                    SelectDefaultNode(DataList);
                });
            });
        }
        private void LoadData(string devicePath)
        {
            if (IsFiltering)
            {
                return;
            }
            IsFiltering = true;
            Task.Factory.StartNew(() =>
            {
                try
                {
                    //AsyncOperator.Execute(() => IsFiltering = true);

                    //devicePath = @"C:\Users\fhjun\Desktop\默认案例_20171115[081055]\默认案例_20171115[081055]\R7007_20171115[081055]";
                    _currentDevicePath = devicePath;
                    var dataList       = DeviceExternsion.LoadDeviceData(devicePath);
                    foreach (var item in dataList)
                    {
                        item.BuildParent();
                    }
                    AsyncOperator.Execute(() =>
                    {
                        DataList = dataList;

                        //重置数据
                        MessageAggregation.SendGeneralMsg(new GeneralArgs <ObservableCollection <DataExtactionItem> >(MessageKeys.SetDataListKey)
                        {
                            Parameters = DataList
                        });

                        IsFiltering = false;
                        HasDataList = DataList != null && DataList.Count > 0;

                        SelectDefaultNode(DataList);
                    });
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    AsyncOperator.Execute(() =>
                    {
                        IsFiltering = false;
                        MessageAggregation.SendGeneralMsg(new GeneralArgs <object>(MessageKeys.DataLoadedCompletedKey)
                        {
                            Parameters = true
                        });
                    });
                }
            });
        }
        /// <summary>
        /// 设置查询状态
        /// </summary>
        /// <param name="obj"></param>
        private void StartFilter(GeneralArgs <bool> obj)
        {
            AsyncOperator.Execute(() =>
            {
                CurrentOperation = Languagekeys.Searching;
                IsFiltering      = obj.Parameters;

                if (!IsFiltering)
                {
                    SelectDefaultNode(DataList);
                }
            });
        }