Browse Source

冲突解决

Lishi
pry 2 years ago
parent
commit
dd997ae318
3 changed files with 10 additions and 26 deletions
  1. +2
    -2
      HKCardOUT/HKCardOUT.csproj
  2. +6
    -22
      HKCardOUT/ViewModels/RootViewModel.cs
  3. +2
    -2
      HKCardOUT/Views/AdWindow.xaml.cs

+ 2
- 2
HKCardOUT/HKCardOUT.csproj View File

@@ -14,9 +14,9 @@
<AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.0.0.0</AssemblyVersion>
<Platforms>AnyCPU;x86</Platforms> <Platforms>AnyCPU;x86</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<!--<PropertyGroup>
<ApplicationManifest>App.manifest</ApplicationManifest> <ApplicationManifest>App.manifest</ApplicationManifest>
</PropertyGroup>
</PropertyGroup>-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;Core</DefineConstants> <DefineConstants>TRACE;Core</DefineConstants>
</PropertyGroup> </PropertyGroup>


+ 6
- 22
HKCardOUT/ViewModels/RootViewModel.cs View File

@@ -37,7 +37,6 @@ namespace HKCardOUT.ViewModels
this.Closed += RootViewModel_Closed; this.Closed += RootViewModel_Closed;
ProcessCard(); ProcessCard();
InsertData(); InsertData();
LtensenScreen();
} }


/// <summary> /// <summary>
@@ -165,7 +164,7 @@ namespace HKCardOUT.ViewModels
} }
#endregion #endregion


#region 网络检查
#region 屏幕检查
private void AdOpen() private void AdOpen()
{ {
App.Current.Dispatcher.Invoke(new Action(() => App.Current.Dispatcher.Invoke(new Action(() =>
@@ -173,6 +172,11 @@ namespace HKCardOUT.ViewModels
try try
{ {
var SC = System.Windows.Forms.Screen.AllScreens.Count(); var SC = System.Windows.Forms.Screen.AllScreens.Count();
while (SC<3)
{
SC = System.Windows.Forms.Screen.AllScreens.Count();
Thread.Sleep(1000);
}
for (int i = 0; i < SC; i++) for (int i = 0; i < SC; i++)
{ {
var win = new AdWindow(Ad[i].Ad, i); var win = new AdWindow(Ad[i].Ad, i);
@@ -290,25 +294,5 @@ namespace HKCardOUT.ViewModels
private static ConcurrentQueue<SaleLogDto> Stacks = new ConcurrentQueue<SaleLogDto>(); private static ConcurrentQueue<SaleLogDto> Stacks = new ConcurrentQueue<SaleLogDto>();
#endregion #endregion


#region 屏幕监听
private void LtensenScreen()
{
ThreadManage.GetInstance().StartLong(() =>
{
var scCount = System.Windows.Forms.Screen.AllScreens.Count();
if (scCount >= 3)
{
var pc = Process.GetProcesses().Where(t => t.ProcessName.Equals("HKLinsten")).FirstOrDefault();
if (pc == null)
{
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HKLinsten.exe");
Process.Start(path);
App.Current.Dispatcher.Invoke(() => App.Current.Shutdown(0));
}
}
Thread.Sleep(10000);
}, "屏幕监听", true);
}
#endregion
} }
} }

+ 2
- 2
HKCardOUT/Views/AdWindow.xaml.cs View File

@@ -41,8 +41,8 @@ namespace HKCardOUT.Views
if (BindScreen != -1) if (BindScreen != -1)
{ {
int[] NotchNum = new int[2]; int[] NotchNum = new int[2];
if (bindScreen == 1) { NotchNum[0] = 1; NotchNum[1] = 2; }
if (bindScreen == 0) { NotchNum[0] = 5; NotchNum[1] = 6; }
if (bindScreen == 0) { NotchNum[0] = 1; NotchNum[1] = 2; }
if (bindScreen == 1) { NotchNum[0] = 5; NotchNum[1] = 6; }
if (bindScreen == 2) { NotchNum[0] = 3; NotchNum[1] = 4; } if (bindScreen == 2) { NotchNum[0] = 3; NotchNum[1] = 4; }
(this.DataContext as AdWindowViewModel).InitData(NotchNum); (this.DataContext as AdWindowViewModel).InitData(NotchNum);




Loading…
Cancel
Save