Reputation: 95
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 is global int variable. I make the three cases in this case it's by using the keys CTRL + G
But I want that after three times if I make again CTRL + G it will start over again case 1 case 2 case3 ...
Now after the third case it's not doing anything.
Upvotes: 0
Views: 1742
Reputation: 3603
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;
}
}
Just set to 0 in the last case.
Upvotes: 1
Reputation: 151604
You could reset the counter after the last case:
case 3:
DoRequest();
clickNo = 0;
break;
Upvotes: 4