将导出脚本添加到文档类时,RunUI 方法会被触发并显示设置表单。删除脚本时也会发生这种情况。我想阻止它,因为没有必要。
在我的ActionEvent
方法中,我可以为KfxActionValue
.
我不想在删除脚本时显示 UI,但我想在添加脚本或编辑它时显示它。
如您在此处看到的,该文档不是很有帮助
我采用了 Sharepoint 示例和 KCEC Text 示例并创建了这个
public KfxReturnValue ActionEvent(KfxActionValue actionID, string data1, string data2)
{
try
{
bool showUI = false;
switch (actionID)
{
case KfxActionValue.KFX_REL_INDEXFIELD_INSERT:
case KfxActionValue.KFX_REL_INDEXFIELD_DELETE:
case KfxActionValue.KFX_REL_BATCHFIELD_INSERT:
case KfxActionValue.KFX_REL_BATCHFIELD_DELETE:
showUI = true;
break;
//case KfxActionValue.KFX_REL_UNDEFINED_ACTION:
//case KfxActionValue.KFX_REL_DOCCLASS_RENAME:
//case KfxActionValue.KFX_REL_BATCHCLASS_RENAME:
//case KfxActionValue.KFX_REL_INDEXFIELD_RENAME:
//case KfxActionValue.KFX_REL_BATCHFIELD_RENAME:
//case KfxActionValue.KFX_REL_RELEASESETUP_DELETE:
//case KfxActionValue.KFX_REL_IMPORT:
//case KfxActionValue.KFX_REL_UPGRADE:
//case KfxActionValue.KFX_REL_PUBLISH_CHECK:
//case KfxActionValue.KFX_REL_START:
//case KfxActionValue.KFX_REL_END:
//case KfxActionValue.KFX_REL_FOLDERCLASS_INSERT:
//case KfxActionValue.KFX_REL_FOLDERCLASS_RENAME:
//case KfxActionValue.KFX_REL_FOLDERCLASS_DELETE:
//case KfxActionValue.KFX_REL_TABLE_DELETE:
//case KfxActionValue.KFX_REL_TABLE_INSERT:
//case KfxActionValue.KFX_REL_TABLE_RENAME:
//default:
// break;
}
if (showUI)
{
return RunUI();
}
return KfxReturnValue.KFX_REL_SUCCESS;
}
catch (Exception e)
{
setupData.LogError(e.ToString());
throw e;
}
}
但我不确定这是否正确。有用。但是我在哪里可以获得更多关于它的信息?