Browse Source

trychath

Lishi
xxe 2 years ago
parent
commit
287caed4e2
1 changed files with 19 additions and 4 deletions
  1. +19
    -4
      HKCardOUT/ViewModels/RootViewModel.cs

+ 19
- 4
HKCardOUT/ViewModels/RootViewModel.cs View File

@@ -141,12 +141,26 @@ namespace HKCardOUT.ViewModels

private void AdOpen()
{
var SC = System.Windows.Forms.Screen.AllScreens.Count();
try
{
var SC = System.Windows.Forms.Screen.AllScreens.Count();

for (int i = 0; i < SC; i++)
for (int i = 0; i < SC; i++)
{
var win = new AdWindow(Ad[i].Ad);
var rectangle = System.Windows.Forms.Screen.AllScreens[i].WorkingArea;
win.Height = rectangle.Height;
win.Width = rectangle.Width;
win.Top = 0;
win.Left = rectangle.Left;
win.Owner = this.Main;
win.Show();
}
}
catch
{
var win = new AdWindow(Ad[i].Ad);
var rectangle = System.Windows.Forms.Screen.AllScreens[i].WorkingArea;
var win = new AdWindow("暂无广告");
var rectangle = System.Windows.Forms.Screen.AllScreens[0].WorkingArea;
win.Height = rectangle.Height;
win.Width = rectangle.Width;
win.Top = 0;
@@ -154,6 +168,7 @@ namespace HKCardOUT.ViewModels
win.Owner = this.Main;
win.Show();
}
}

#endregion


Loading…
Cancel
Save