В Ribbon.xml
Код: Выделить всё
Код: Выделить всё
public string GetWorkflows(Office.IRibbonControl control)
{
string menuItem = "";
List workflows = FetchWorkflows(); //there were few lines above for fetch workflows. This part works fine.
if (workflows != null && workflows.Count > 0)
{
int count = 1;
foreach (string workflowPath in workflows)
{
string[] paths = workflowPath.Split('/');
var name = paths[paths.Count() - 1].Replace(".abc_workflow", "");
var id = "Workflows" + count.ToString();
menuItem = menuItem + "";
count++;
}
menuItem = menuItem + "";
}
return menuItem;
}
public void TPS_WorkflowProcessing(Office.IRibbonControl control)
{
string workflowPath = control.Tag;
using (MyApplication app = new MyApplication())
{
app.Tools.RunDocumentProcessing(workflowPath);
}
}
Код: Выделить всё
public void RunDocumentProcessing(string workflowPath)
{
if (this.IsActiveDocumentReady)
{
string outputFileExtesion = Constants.EXTENTION_DOCX;
this.RunJob(workflowPath, outputFileExtesion);
}
}
private async void RunJob(string workflowPath, string outputExtension)
{
//Noting from inside is getting executed
}
Этот код отлично выполняется при запуске через Visual Studio. Но когда мы собираем установщик и запускаем его, он выполняется до строки outputFileExtesion = Constants.EXTENTION_DOCX; в функции Tools.RunDocumentProcessing. RunJob() не достигает. Почему это? Как это исправить?
Подробнее здесь: https://stackoverflow.com/questions/798 ... bon-button