public void Console(List<Keys> keys)
{
clickNo ++;
start = DateTime.Now;
progressBar1.Maximum = 1;
progressBar1.Step = 1;
progressBar1.Value = 0;
switch (clickNo)
{
case 1:
DoRequest(ScreenshotRequest.DannysCommands.NormalOperation); break;
case 2:
DoRequest(ScreenshotRequest.DannysCommands.Displayoverlays); break;
case 3:
DoRequest(ScreenshotRequest.DannysCommands.Dontdisplayoverlays); break;
}
}
clickNo是全局int变量。 在这种情况下,我通过使用键来制作三种情况 CTRL + G
但如果我再做一次,我想要三次 CTRL + G 它将重新开始案例1案例2案例3 ...
现在在第三种情况之后,它没有做任何事情。
答案 0 :(得分:3)
您可以在最后一种情况后重置计数器:
case 3:
DoRequest();
clickNo = 0;
break;
答案 1 :(得分:1)
public void Console(List<Keys> keys)
{
clickNo ++;
start = DateTime.Now;
progressBar1.Maximum = 1;
progressBar1.Step = 1;
progressBar1.Value = 0;
switch (clickNo)
{
case 1:
DoRequest(ScreenshotRequest.DannysCommands.NormalOperation);
break;
case 2:
DoRequest(ScreenshotRequest.DannysCommands.Displayoverlays);
break;
case 3:
DoRequest(ScreenshotRequest.DannysCommands.Dontdisplayoverlays);
clickNo = 0;
break;
}
}
在最后一种情况下设置为0。