From 0fd87c07d569ba39fb6b0c943b49352b05b4c9a9 Mon Sep 17 00:00:00 2001 From: "747575620@qq.com" <747575620@qq.com> Date: Sat, 24 Sep 2022 14:35:27 +0800 Subject: [PATCH] 1 --- HKCardOUT/ViewModels/RootViewModel.cs | 54 ++++++++++++++++----------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/HKCardOUT/ViewModels/RootViewModel.cs b/HKCardOUT/ViewModels/RootViewModel.cs index 53c740b..57bcac5 100644 --- a/HKCardOUT/ViewModels/RootViewModel.cs +++ b/HKCardOUT/ViewModels/RootViewModel.cs @@ -44,7 +44,7 @@ namespace HKCardOUT.ViewModels { Result = new ObservableCollection(this.Container.Get().PullDaySaleLog()); Thread.Sleep(500); - }, "消费记录查询",false); + }, "消费记录查询", false); //广告初始化 var Init = DataBus.StoreInfo?.Devices.Join(DataBus.StoreInfo?.Stalls, t => t.GateId, x => x.Id, (t, x) => new AdDTO { @@ -126,7 +126,7 @@ namespace HKCardOUT.ViewModels return; else { - var res = UHF_RS485_Helper.GetInstance().ReadCard(item.Address.AsInt()).Result; + var res = UHF_RS485_Helper.GetInstance().ReadCard(item.Address.AsInt()).Result; if (res != null) { if (!res.ResData.IsMatch(new Regex("0{20}"))) @@ -139,29 +139,41 @@ namespace HKCardOUT.ViewModels } - private void AdOpen() + private void AdOpen() { var SC = System.Windows.Forms.Screen.AllScreens.Count(); Rectangle[] rectangle = new Rectangle[SC]; - List wins = new List(); - - for (int i = 0; i < Ad.Count; i++) - { - wins.Add(new Views.AdWindow(Ad[i].Ad)); - } - for (int i = 0; i < wins.Count; i++) - { - rectangle[i] = System.Windows.Forms.Screen.AllScreens[i].WorkingArea; - wins[i].Height = rectangle[i].Height; - wins[i].Width = rectangle[i].Width; - wins[i].Top = rectangle[i].Top; - wins[i].Left = rectangle[i].Left; - wins[i].Show(); - //wins[i].Owner = this.Main; - } - wins[0].Owner = this.Main; - wins[1].Owner = this.Main; + var win = new Views.AdWindow(Ad[0].Ad); + var rectangles = System.Windows.Forms.Screen.AllScreens[0].WorkingArea; + win.Height = rectangles.Height; + win.Width = rectangles.Width; + win.Top = 0; + win.Left = rectangles.Left; + win.Owner = this.Main; + win.Show(); + + + var win1 = new Views.AdWindow(Ad[1].Ad); + var rectangless = System.Windows.Forms.Screen.AllScreens[1].WorkingArea; + win1.Height = rectangless.Height; + win1.Width = rectangless.Width; + win1.Top = 0; + win1.Left = rectangless.Left; + win1.Owner = this.Main; + win1.Show(); + + //for (int i = 0; i < Ad.Count; i++) + //{ + // var win = new Views.AdWindow(Ad[i].Ad); + // var rectangles = System.Windows.Forms.Screen.AllScreens[i].WorkingArea; + // win.Height = rectangles.Height; + // win.Width = rectangles.Width; + // win.Top = rectangles.Top; + // win.Left = rectangles.Left; + // win.Show(); + // win.Owner = this.Main; + //} }