From f66b854335942c9f8e65428a2348fa4084fd2655 Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 27 Sep 2022 15:47:16 +0800 Subject: [PATCH] 1 --- BeDesignerSCADA/Controls/MainCanvasPanel.xaml | 2 +- BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml index 3046c53b..d5a18961 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml @@ -148,7 +148,7 @@ - diff --git a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs index 8d6e6bc4..89825231 100644 --- a/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs +++ b/BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs @@ -39,7 +39,7 @@ namespace BeDesignerSCADA.Controls /// 布局文件路径 /// public string Path = string.Empty; - + List controls = new List(); MainViewModelNew viewModel = new MainViewModelNew(); public MainCanvasPanel(string _Path) { @@ -50,7 +50,8 @@ namespace BeDesignerSCADA.Controls viewModel.Loaded(cav, runCanvas); //控件加载 Assembly assembly = Assembly.LoadFile($"{System.AppDomain.CurrentDomain.BaseDirectory}\\BPASmartClient.SCADAControl.dll"); //Assembly.GetExecutingAssembly(); - var controls = assembly.GetTypes().Where(t => t.GetInterface("IExecutable") != null).OrderBy(o => o.Name); + controls = assembly.GetTypes().Where(t => t.GetInterface("IExecutable") != null).OrderBy(o => o.Name)?.ToList(); + //controls.Add(new Line().GetType()); CtlList.ItemsSource = controls; //读取文件 FileRead(_Path); @@ -588,12 +589,5 @@ namespace BeDesignerSCADA.Controls // communication?.CommunicationDevices?.ToList().ForEach(x => { viewModel.DevNameList.Add(x.DeviceName); }); //} #endregion - - private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) - { - - } } - - }