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). ...
随机推荐
- ubuntu下使用visual studio code来编译和调试C++
最近想在linux上编译c++代码,自己却一直习惯window上的IDE.以前公司要我写Linux代码的时候,我一般都是用eclipse + CDT,而eclipse这东西吧,我个人感觉因为加载组件太 ...
- JAVA 多线程和并发学习笔记(三)
Java并发编程中使用Executors类创建和管理线程的用法 1.类 Executors Executors类可以看做一个“工具类”.援引JDK1.6 API中的介绍: 此包中所定义的 Execut ...
- Salesforce 使用Js 调用Webservice实例
1,创建 Custom Button 在页面上 2, 创建CustomJs 代码调用Webservice <!--参数名区分大小写,对于跨层object直接在Object名后直接加参字段名即可- ...
- nginx相关的一些记录
http redirect to https: if ($http_cf_visitor ~ '"scheme":"http"'){ rewrite ^/(.* ...
- lnmp下启动mysql报错 The server quit without updating PID file
启动时候错误代码:Starting MySQL[FAIL.] The server quit without updating PID file (/var/run/mysqld/mysqld.pid ...
- C#正则提取html图片等
去除html标记,比较实用,分享给大家. /// <summary> /// 去除HTML标记 /// </summary> /// <par ...
- android入门:第一天
android是什么? 是一个基于linux开源的操作系统,主要适用于智能设备,如智能手机,平板,智能电视,智能手表,谷歌眼镜,智能家居,由google开发,2008年开发出第一个版本 android ...
- frp内网穿透配置
frps配置 --------------------------------------------------------------------------------------------- ...
- ASP.NET Misconfiguration: Missing Error Handling
Abstract: An ASP .NET application must enable custom error pages in order to prevent attackers from ...
- Android之TextView灵活使用(转载)
在项目中有无遇到过这样一种程况,例如文字"王明今年10岁了", 但是数字10是从网络返回的数据, 而你又想把这个文字写在xml中, 过往我的做法是分成3个TextView, 实现愚 ...