I need to activate the Mark Done Button in the ToolbarInteractionBarRegion after a given time. For example, if the agent doesn’t click on it in 20 seconds, it must “click itself”.
I already know how to handle the timer elapsed event but I can’t find any solutions for the button activation.
Thank you, @hsujdik. It quite seems what I needed but it didn’t really do the trick. When I run the command the interaction related views don’t close the same way as when I push the MarkDone button manually.
So, in case someone is wondering, I was able to come up with a solution for the “click itself” thing. There is a keyboard shortcut for pressing the MarkDone button, it’s CTRL + E.
I found this NuGet package called InputSimulator v1.0.4 by Michael Noonan (https://archive.codeplex.com/?p=inputsimulator). Using it I managed to simulate this shortcut programmatically.
After installing the package, first you need to add these namespaces:
using WindowsInput.Native;
using WindowsInput;
Then, where or when you want to activate the keyboard shortcut you must insert this:
InputSimulator inputSimulator = new InputSimulator();
inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_E);
Command chain must be working. you don’t need to use workarounds and simulate click
I did it like that:
private IInteractionManager ixnManager;
ixnManager = _container.Resolve();
//if you are in interaction view just take current interaction from case
IInteraction ixn = ixnManager.GetInteractionByEntrepriseId(interactionId);
IDictionary<string, object> parameters = new Dictionary<string, object>();
//maybe bundle will be part of case depending from which view are you using
parameters.Add(“CommandParameter”, ixnManager.GetBundleById(ixn.BundleId));
//execute command chain with correct parameters and it will work
container.Resolve().GetChainOfCommandByName(“BundleClose”).Execute(parameters);