您的位置:首页 > 编程语言

动态创建对象演示代码MenuFunction ClassFactory FormRun ReportRun

2011-12-21 15:22 567 查看
// Changed on 20 May 2006 at 07:02:15 by ZYJ
// 论坛:www.qiuhao.com
// 博客:http://www.qiuhao.com/boke.asp?maxfara.index.html
// 邮箱:Zhouyujie238@hotmail.com

//BestPractice:
//优先使用MenuFunction 来调用对象;
//在不能使用MenuFunction的时候,使用classFactory进行调用;
//不能使用classFactory的时候,再考虑直接使用new FormRun/ReportRun ;
static void menuFunction(Args _args)
{

Args args = new Args();
;

//访问Form;
new MenuFunction(menuItemDisplayStr('Unit'),MenuItemType::Display).run(args);

//访问类
//new MenuFunction(menuItemActionStr('Calculator'),MenuItemType::Action).run(args);

//访问报表
//new MenuFunction(menuItemOutputStr('Currency'),MenuItemType::Output).run(args);

}

static void classFactory (Args _args)
{
Args args = new Args();
FormRun formRun;
;
//调用Form的例子
args = new Args(FormStr('Unit'));
formRun = classFactory.formRunClass(args);
//报表:reportRun = classFactory.reportRunClass(<args object>);
formRun.init();
formRun.run() ;
formRun.wait();

}

static void formRun(Args _args)
{
Args args = new Args();
FormRun formRun;
;
//调用Form的例子
args = new Args(FormStr('Unit'));
formRun = new FormRun(args) ;
//报表:reportRun = new ReportRun(args) ;
formRun.init();
formRun.run() ;
formRun.wait();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: