From 90df693be709710819cd7b6e105e46b01d27ce6c Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 04 九月 2024 14:21:49 +0800 Subject: [PATCH] 1 --- DataLoader/MainWindow.xaml.cs | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/DataLoader/MainWindow.xaml.cs b/DataLoader/MainWindow.xaml.cs index 1fdbeb3..3b7ddd5 100644 --- a/DataLoader/MainWindow.xaml.cs +++ b/DataLoader/MainWindow.xaml.cs @@ -29,12 +29,14 @@ 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; @@ -44,6 +46,7 @@ LogOut.Info("************ 搴旂敤绋嬪簭鍚姩鎴愬姛锛� ************"); } + // 鑾峰彇鍏冩暟鎹被鍨� private List<MetaType> GetMetaTypes() { List<MetaType> list = new List<MetaType>(); @@ -134,28 +137,52 @@ 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) { -- Gitblit v1.9.3