| | |
| | | this.DataContext = this; |
| | | } |
| | | |
| | | // 窗口加载完成 |
| | | private void Window_Loaded(object sender, RoutedEventArgs e) |
| | | { |
| | | CommonProp.Owner = this; |
| | | CommonProp.Init(); |
| | | |
| | | this.btnLoad.IsEnabled = false; |
| | | this.btnDel.IsEnabled = false; |
| | | this.btnImport.IsEnabled = false; |
| | | |
| | | lvView.DataContext = viewDatas; |
| | |
| | | LogOut.Info("************ 应用程序启动成功! ************"); |
| | | } |
| | | |
| | | // 获取元数据类型 |
| | | private List<MetaType> GetMetaTypes() |
| | | { |
| | | List<MetaType> list = new List<MetaType>(); |
| | |
| | | MessageBox.Show("请选择资源目录!", "提示"); |
| | | return; |
| | | } |
| | | |
| | | CommonProp.SourcePath = this.tbSource.Text.Trim(); |
| | | if (string.IsNullOrEmpty(CommonProp.SourcePath) || !Directory.Exists(CommonProp.SourcePath)) |
| | | { |
| | | MessageBox.Show("请选择数据目录或数据目录不存在!", "提示"); |
| | | return; |
| | | } |
| | | |
| | | CommonProp.TargetPath = this.tbTarget.Text.Trim(); |
| | | if (string.IsNullOrEmpty(CommonProp.TargetPath) || !Directory.Exists(CommonProp.TargetPath)) |
| | | { |
| | | MessageBox.Show("请选择入库目录或入库目录不存在!", "提示"); |
| | | return; |
| | | } |
| | | CommonProp.SensorType = this.tbSensorType.Text.Trim(); |
| | | ContentControl cc = this.cbMetaType.SelectedItem as ContentControl; |
| | | CommonProp.MetaType = null == cc || "请选择" == cc.Content.ToString() ? string.Empty : cc.Content.ToString(); |
| | | |
| | | ContentControl ccSensor = this.tbSensorType.SelectedItem as ContentControl; |
| | | int.TryParse(ccSensor.Tag.ToString(), out CommonProp.SensorType); |
| | | |
| | | ContentControl ccMeta = this.cbMetaType.SelectedItem as ContentControl; |
| | | int.TryParse(ccMeta.Tag.ToString(), out CommonProp.MetaType); |
| | | |
| | | CommonProp.AcqTime = this.dpAcqTime.SelectedDate; |
| | | |
| | | this.isBusy = true; |
| | | this.viewDatas.Clear(); |
| | | Importor.GetFiles(viewDatas); |
| | | Importor.Loading(viewDatas); |
| | | this.isBusy = false; |
| | | } |
| | | |
| | | // 删除 |
| | | private void Del_MouseLeftButtonDown(object sender, RoutedEventArgs e) |
| | | { |
| | | if (null == this.viewDatas || this.viewDatas.Count == 0) return; |
| | | |
| | | int i = 0; |
| | | while (i < this.viewDatas.Count) |
| | | { |
| | | if (this.viewDatas[i] != null && this.viewDatas[i].Checked) |
| | | { |
| | | this.viewDatas.RemoveAt(i); |
| | | continue; |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | // 导入 |
| | | private void Import_MouseLeftButtonDown(object sender, RoutedEventArgs e) |
| | | { |