U8门户开发手册 联系客服

发布时间 : 星期一 文章U8门户开发手册更新完毕开始阅读96a1b30551e79b8969022676

4.2继承门户中类NetLoginable

在该项目中添加以下DLL的引用 Windows.Form.dll

U8安装路径\\Framework\\UFSoft.U8.Framework.Login.UI.dll U8安装路径\\Interop\\Interop.U8Login.dll

U8安装路径\\Interop\\ Interop.UFPortalProxyInterface.dll U8安装路径\\Portal\\UFIDA.U8.Portal.Framework.dll U8安装路径\\Portal\\UFIDA.U8.Portal.Proxy.dll

U8安装路径\\Portal\\UFIDA.U8.Portal.Common.dll

在项目中新建一个类,该类需要继承类NetLoginable,并重写其中的两个方法,示例如下: public override object CallFunction(string cMenuId, string cMenuName, string cAuthId, string cCmdLine) {

INetUserControl mycontrol = new MyNetUserControl(); mycontrol.Title = \;

base.ShowEmbedControl(mycontrol, cMenuId, true); return null; }

public override bool SubSysLogin() {

Return true; }

4.3 实现接口INetUserControl

在项目中再新建一个类,该类实现接口INetUserControl,INetUserControl接口有三个属性(EditorPart、EditorInput、Title)和三个方法(CreatControl、CreatToolbar、CloseEvent),详细说明:

4.3.1 EditorPart

属性原型声明:NetEditor EditorPart { get;set;} 对于二次开发人员 ,这个是只读属性,严禁为该属性赋值。 通过这个属性,二次开发人员可以访问UAP表单在门户中显示的页签对象,可以执行页签关闭等操作。

4.3.2 EditorInput

属性原型声明:NetFormInput EditorInput { get;set;}

对于二次开发人员 ,这个是只读属性,严禁为该属性赋值。 通过这个属性,二次开发人员可以访问门户工具栏上的按钮。

4.3.3 Title

属性原型声明:string Title{ get;set;}

对于二次开发人员 ,可以设置这个属性,设置该属性后,属性值即打开单据后相应的页签标题。

4.3.4 CreateControl

方法原型: ///

/// 创建UserControl对象 ///

/// ///

/// /// 显示的usercontrol

System.Windows.Forms.Control CreateControl(U8Login.clsLogin login, string MenuID, string Paramters);

功能描述: 该方法创建要显示的usercontrol

参数描述: login u8登陆对象,该对象不能转换成u8Login.clsLoginClass. MenuID: 打开的菜单ID

Paramters 菜单的参数描述,它是一个XML字符串 其定义格式如下:

dllpath:dll的路径,要用u8soft的相对路径,最好放在uap目录下; id:UserContrl唯一标识,其值自定;

type:属性值必须为\,区分大小写;

parameters:需要给程序(UserControl)传送的数据,格式自定。 返回值 要显示的usercontrol 用法:

要在门户中显示自定义的窗体,必须在此函数内实例化一个从control继承过来的对象 ,并且返回该对象

4.3.5CreateToolbar

方法原型: ///

/// 创建toolbar对象 ///

/// 返回对象

VoucherAction[] CreateToolbar(U8Login.clsLogin login); 功能描述:在u8门户上创建Toolbar对象 参数描述: login 当前的u8登陆对象 返回值 toolbar对象数组

VoucherAction对象是一个toolbar button的描述其用法如下 其参数描述如下:public VoucherAction(string text, string toolTip, bool isSystemButton, bool isHavePopedom, string id, IActionDelegate dele, VoucherActionType typeName, int sortNo, string parentKey, string authID);

Text:button的名称 toolTip:提示名称

isSystemButton:是否系统按钮

isHavePopedom:是否需要权限控制

id:toobar button的ID,该ID不允许重复,如果重复则后添加的对象无效 dele:action的代理对象,在该代理内实现toolbar的具体操作

typeName: toolbar button共分四种类型,类型相同的toolbar button显示在同一组中 sortNo:排序号

parentKey:父键,如果没有则为null authID:权限ID 用法:

//定义toolbar返回对象

UFIDA.U8.Portal.UAPFacade.VoucherAction[] actions = new VoucherAction[2]; //定义toolbar的处理事件

UserActionDelegate actionDelegate = new UserActionDelegate(); //实例化toolbar button对象

actions[0] = new VoucherAction(\确定\\false, false, \actionDelegate, VoucherActionType.Normal, 1, null, null);

actions[0] = new VoucherAction(\取消\\false, false, \actionDelegate, VoucherActionType.Normal, 1, null, null); //返回要显示的toolbar return actions;

4.3.6 CloseEvent

方法原型: ///

/// 关闭事件 ///

///

bool CloseEvent();

功能描述:usercontrol的关闭事件

参数描述: 返回值 是否关闭当前窗体,如果是true则关闭 否则保持当前状态

4.4 编译该控件输出DLL

编译出的DLL推荐拷贝到u8soft\%uap\\runtime目录下

4.5示例源程序代码

示例源程序:。