XAF进修二:在XAF中打开自定义的WinForm
在建造WinForm时须要加上一机关函数和Show办法
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.ExpressApp.Win;
using DevExpress.ExpressApp; namespace WinWjXAF.Module.Win
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form1(XafApplication app, DetailViewActionsObject post) : this() {
// We don""t currently have a singleton reference to the running
// app in Windows Forms -- will be changed.
// It would be possible to make changes to WinApplication.cs and
// a static property manually of course. In this case
// I want to keep changes in a single area for simplicity,
// so I""m taking the app reference as a parameter instead.
using (IObjectSpace os =app.ObjectSpaceProvider.CreateObjectSpace() ){
//app.ObjectSpaceProvider.CreateObjectSpace( )) {
int postCount = os.GetObjectsCount(typeof(DetailViewActionsObject), null); // Of course we can work with the post that has been passed in
//contentLabel.Text =
// String.Format("This post has the title ""{0}"". It""s one of {1} posts.",
// post.Title, postCount);
}
} public static void Show(XafApplication app, DetailViewActionsObject post) {
using (Form1 form = new Form1(app, post)) {
form.ShowDialog( );
}
}
}
} 二、建树ViewController,并在ViewController中添加simpleACtion来浮现它 public partial class CustomFormController : ViewController
{
public CustomFormController()
{
InitializeComponent();
RegisterActions(components);
} private void simpleAction1_Execute(object sender, SimpleActionuteEventArgs e)
{ Form1.Show(Application, (DetailViewActionsObject)e.CurrentObject);
}
}
XAF进修二:在XAF中打开自定义的WinForm的更多相关文章
- (二)scrapy 中如何自定义 pipeline 下载图片
这里以一个很简单的小爬虫为例,爬取 壹心理 网站的阅读页面第一页的所有文章及其对应的图片,文章页面如下: 创建项目 首先新建一个 scrapy 项目,安装好相关依赖(步骤可参考:scrapy 安装及新 ...
- 在类库或winform项目中打开另一个winform项目的窗体
假设类库或winform项目为A,另一个winform项目为B.那麽在A中添加一个接口,里面有一个Show方法,然后在B中写一个类b继承这个接口,并重写这个方法,具体内容为弹出某个窗体.然后在A中另一 ...
- Dojo初探之2:设置dojoConfig详解,dojoConfig参数详解+Dojo中预置自定义AMD模块的四种方式(基于dojo1.11.2)
Dojo中想要加载自定义的AMD模块,需要先设置好这个模块对应的路径,模块的路径就是这个模块的唯一标识符. 一.dojoConfig参数设置详解 var dojoConfig = { baseUrl: ...
- php中usort自定义排序如何使用
php中usort自定义排序如何使用 一.总结 一句话总结:多写一个规则函数,而这个函数的写法和普通函数一样,调用的时候规则函数用函数名的字符串. 1.用户自定义规则函数有哪三个? usort — 使 ...
- Expo大作战(十二)--expo中的自定义样式Custom font,以及expo中的路由Route&Navigation
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...
- 一张图搞定OAuth2.0 在Office应用中打开WPF窗体并且让子窗体显示在Office应用上 彻底关闭Excle进程的几个方法 (七)Net Core项目使用Controller之二
一张图搞定OAuth2.0 目录 1.引言 2.OAuth2.0是什么 3.OAuth2.0怎么写 回到顶部 1.引言 本篇文章是介绍OAuth2.0中最经典最常用的一种授权模式:授权码模式 非常 ...
- PhoneGap + Dreamweaver 5.5 无法在模拟器中打开的问题(二)
转载:http://blog.csdn.net/dupang/article/details/8248335 按照网上的教程搭建Dreamweaver CS5.5+PhoneGap移动开发环境,在进行 ...
- 浏览器中打开IOS应用并传参
原创文章,转载请注明 开发中遇到这么一个问题,就是动态地指定联接服务器地址,或其它数据.如果是其它数据还好说一些,可以通过在服务器上获得的方式来弄.但如果服务器地址都需要动态指定的话.那就得另想办法了 ...
- GridView控件中插入自定义删除按钮并弹出确认框
GridView控件中插入自定义删除按钮,要实现这个功能其实有多种方法,这里先记下我使用的方法,以后再添加其他方法. 一.实现步骤 1.在GridView中添加模板列(TemplateField). ...
随机推荐
- Linux 显示文件完整路径
原链接 http://blog.chinaunix.net/uid-25266990-id-3268759.html ls foo | sed "s:^:`pwd`/:"
- Sublime插件安装
来在Sublime text3上安装Package Control 使用Ctrl+`(ESC下边的那个~)快捷键或者通过View->Show Console菜单打开命令行,粘贴如下代码: imp ...
- temp_web
使用vs2010创建.发布.部署.调用 WebService http://blog.sina.com.cn/s/blog_45eaa01a0102vp8z.html c#简易Http服务器 http ...
- matlab clear
clear 删除工作空间中的项目,释放系统内存 语法: clear clear name clear name1 name2 name3... clear global name clear -reg ...
- sql 时间(datetime)计算
SELECT *FROM sc_sowu_orderreturnWHERE STATUS = '0'AND submit_time < DATE_ADD(now(), INTERVAL - 4 ...
- javascript运行模式:并发模型 与Event Loop
看了阮一峰老师的JavaScript 运行机制详解:再谈Event Loop和[朴灵评注]的文章,查阅网上相关资料,把自己对javascript运行模式和EVENT loop的理解整理下,不一定对,日 ...
- 多行SQL语句拼成一条数据
将多条数据组合到一行 ) set @sql='select ''roleinfo:''' ) declare cursor1 cursor for select id from Userrole wh ...
- 浅述python中argsort()函数的用法
由于想使用python用训练好的caffemodel来对很多图片进行批处理分类,学习过程中,碰到了argsort函数,因此去查了相关文献,也自己在python环境下进行了测试,大概了解了其相关的用处, ...
- 利用循环播放dataurl的视频来防止锁屏:NoSleep.js
mark下. 地址:http://www.open-open.com/lib/view/open1430796889882.html
- asp.net core实现SHA1withRSA
public sealed class SHA1withRSA { /// <summary> /// pem SHA1withRSA签名 /// </summary> /// ...