二开案例.表单插件.打印表单插件

【应用场景】
运行时查看动态表单上当前正在使用的表单插件。
当怀疑某些插件不工作,或者怀疑后台注入了未知插件,可通过此方法观察某个动态表单上当前正在使用的表单插件。
【实现步骤】
<1>编写表单插件,代码如下。
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Util;
using System;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace Jac.XkDemo.BOS.Business.PlugIn
{
/// <summary>
/// 【表单插件】打印表单插件
/// </summary>
[Description("【表单插件】打印表单插件"), HotUpdate]
public class ShowFormPlugInFormPlugIn : AbstractDynamicFormPlugIn
{
public override void AfterBindData(EventArgs e)
{
base.AfterBindData(e);
var eventsProxyProperty = this.View.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic).FirstOrDefault(o => o.Name == "EventsProxy");
if (eventsProxyProperty != null)
{
var eventsProxy = eventsProxyProperty.GetValue(this.View, null) as DynamicFormViewPlugInProxy;
if (eventsProxy != null)
{
var msg = string.Join("\r\n", eventsProxy.PlugIns.Select(o =>
{
var type = o.GetType();
if (type == typeof(PythonPlugIn))
{
var scriptStringField = type.GetFields(
二开案例.表单插件.打印表单插件
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



