|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
本帖最后由 stonys 于 2010-11-24 11:45 编辑
- using System;
- using System.Collections.Generic;
- using System.Text;
- using UFIDA.U8.Portal.UAPFacade;
- using UFIDA.U8.Portal.Framework.Actions;
- using UFIDA.U8.Portal.Common.Core;
- namespace UFIDA.U8.UAP.Demo.ProjectManage
- {
- public class ProjectManage : IUserControl
- {
- #region IUserControl 成员
- /// <summary>
- /// control的关闭事件
- /// </summary>
- /// <returns>返回true则该对象关闭 否则不关闭</returns>
- bool IUserControl.CloseEvent()
- {
- System.Windows.Forms.MessageBox.Show("user control closed");
- //返回true则该对象关闭 否则不关闭
- return true;
- }
- /// <summary>
- /// 建立要显示的control对象
- /// </summary>
- /// <param name="login">u8登陆对象</param>
- /// <param name="MenuID">菜单ID</param>
- /// <param name="Paramters">菜单参数</param>
- /// <returns>要显示的usercontrol</returns>
- System.Windows.Forms.Control IUserControl.CreateControl(U8Login.clsLogin login, string MenuID, string Paramters)
- {
- //实例化一个usercontrol对象
- UFIDA.U8.UAP.Demo.ProjectManager control = new UFIDA.U8.UAP.Demo.ProjectManager();
- //返回该对象
- return control;
- }
- /// <summary>
- /// 建立要在门户中显示的toolbar
- /// </summary>
- /// <param name="login">u8登陆对象</param>
- /// <returns>toolbar button对象</returns>
- VoucherAction[] IUserControl.CreateToolbar(U8Login.clsLogin login)
- {
- //定义toolbar返回对象
- UFIDA.U8.Portal.UAPFacade.VoucherAction[] actions = new VoucherAction[2];
- //定义toolbar的处理事件
- UserActionDelegate actionDelegate = new UserActionDelegate();
- //实例化toolbar button对象
- actions[0] = new VoucherAction("确定", "", false, false, "btnOK", actionDelegate, VoucherActionType.Normal, 1, null, null);
- actions[1] = new VoucherAction("取消", "", false, false, "btnCancel", actionDelegate, VoucherActionType.Normal, 1, null, null);
- //返回要显示的toolbar
- return actions;
- }
- #endregion
- }
- /// <summary>
- /// 处理toolbar button事件
- /// </summary>
- internal class UserActionDelegate : IActionDelegate
- {
- public UserActionDelegate()
- {
-
- }
- public void Run(IAction action)
- {
- System.Windows.Forms.MessageBox.Show("你点击了"+action.Text+"按钮");
- }
- public void SelectionChanged(IAction action, ISelection selection)
- {
- }
- }
- }
复制代码 |
|