Probably it is pretty simple what I am looking for, but I can not find the answer.
I want to create a (custom) event in my add in using C#. With the even watcher I found the command I want to watch for is UserInputEvents.OnActivateCommand with command name "VaultCheckinTop". How do I create an events that watches this event?
Solved! Go to Solution.
Probably it is pretty simple what I am looking for, but I can not find the answer.
I want to create a (custom) event in my add in using C#. With the even watcher I found the command I want to watch for is UserInputEvents.OnActivateCommand with command name "VaultCheckinTop". How do I create an events that watches this event?
Solved! Go to Solution.
Solved by gert-leonvanlier. Go to Solution.
Hello
Just listen to the OnActivateCommand event and every time it fires, check if CommandName is "VaultCheckinTop". There's no specific event "VaultCheckinTop" you can listen to.
Hello
Just listen to the OnActivateCommand event and every time it fires, check if CommandName is "VaultCheckinTop". There's no specific event "VaultCheckinTop" you can listen to.
I created this method:
private void ui_OnActivateCommand(String CommandName, NameValueMap Context)
{
switch (CommandName)
{
case "VaultCheckin":
MessageBox.Show("VaultCheckin");
break;
case "VaultCheckinTop":
MessageBox.Show("VaultCheckinTop");
break;
}
}
I am now looking on how to trigger this method. ApplicationEvents are triggered by for example this:
Globals.invApp.ApplicationEvents.OnDocumentChange += onChange;
I can't find anything for UserInputEvents or OnActivateCommand.
I created this method:
private void ui_OnActivateCommand(String CommandName, NameValueMap Context)
{
switch (CommandName)
{
case "VaultCheckin":
MessageBox.Show("VaultCheckin");
break;
case "VaultCheckinTop":
MessageBox.Show("VaultCheckinTop");
break;
}
}
I am now looking on how to trigger this method. ApplicationEvents are triggered by for example this:
Globals.invApp.ApplicationEvents.OnDocumentChange += onChange;
I can't find anything for UserInputEvents or OnActivateCommand.
Found it!
The following is placed in the Activate method of the add in:
Globals.invApp.CommandManager.UserInputEvents.OnActivateCommand += UserInputEvents_OnActivateCommand;
And this is in my case the method for the OnActivateCommand:
private void UserInputEvents_OnActivateCommand(string CommandName, NameValueMap Context)
{
switch (CommandName)
{
case "VaultCheckin":
MessageBox.Show("VaultCheckin");
break;
case "VaultCheckinTop":
MessageBox.Show("VaultCheckinTop");
break;
}
}
Found it!
The following is placed in the Activate method of the add in:
Globals.invApp.CommandManager.UserInputEvents.OnActivateCommand += UserInputEvents_OnActivateCommand;
And this is in my case the method for the OnActivateCommand:
private void UserInputEvents_OnActivateCommand(string CommandName, NameValueMap Context)
{
switch (CommandName)
{
case "VaultCheckin":
MessageBox.Show("VaultCheckin");
break;
case "VaultCheckinTop":
MessageBox.Show("VaultCheckinTop");
break;
}
}
I just found out that this events works as some kind of before: when you click the button, the event is fired. At that point I can run some code and after that the check in window is shown. Although you can't choose for before or after, is there a way to have my code to run after the check in window is shown?
I just found out that this events works as some kind of before: when you click the button, the event is fired. At that point I can run some code and after that the check in window is shown. Although you can't choose for before or after, is there a way to have my code to run after the check in window is shown?
Hello
Thats right and that's why it is called "OnActivate".
You can check if the OnTerminateCommand (this should fire if the command is finished or aborted) is useable. Maybe it would be a better way to use the (Webservice)API of Vault server direct.
Hello
Thats right and that's why it is called "OnActivate".
You can check if the OnTerminateCommand (this should fire if the command is finished or aborted) is useable. Maybe it would be a better way to use the (Webservice)API of Vault server direct.
Can't find what you're looking for? Ask the community or share your knowledge.