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 | 36 ++++++++++++++++++++++++++++++------ 1 files changed, 30 insertions(+), 6 deletions(-) diff --git a/DataLoader/MainWindow.xaml.cs b/DataLoader/MainWindow.xaml.cs index f1bc0fa..3b7ddd5 100644 --- a/DataLoader/MainWindow.xaml.cs +++ b/DataLoader/MainWindow.xaml.cs @@ -35,8 +35,9 @@ CommonProp.Owner = this; CommonProp.Init(); - //this.btnLoad.IsEnabled = false; - //this.btnImport.IsEnabled = false; + this.btnLoad.IsEnabled = false; + this.btnDel.IsEnabled = false; + this.btnImport.IsEnabled = false; lvView.DataContext = viewDatas; lvView.SetBinding(ListView.ItemsSourceProperty, new Binding()); @@ -136,29 +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, CommonProp.SourcePath); + 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