EAS.Net 在程序里配置组件
public class BeforStart
{
/// <summary>
/// 程序配置初始化
/// </summary>
public static void EASConfig()
{
#region 系统日志
ComponentInfo Log = new ComponentInfo();
Log.Name = "Logger";
Log.Type = "EAS.Services.TextLogger";
Log.Assembly = "EAS.MicroKernel";
Log.Lifestyle = EAS.Objects.Lifecycle.LifestyleType.Singleton;
ComponentConfig.Components.Add(Log.Name, Log);
#endregion #region 系统资源
ComponentInfo Component = new ComponentInfo();
Component.Name = "EAS.Explorer.Resource";
Component.Type = "System.Res.Resources";
Component.Assembly = "System.Res";
Component.Lifestyle = EAS.Objects.Lifecycle.LifestyleType.Singleton;
ComponentConfig.Components.Add(Component.Name, Component);
#endregion #region 服务桥
ComponentInfo ServiceBridger = new ComponentInfo();
ServiceBridger.Name = "ServiceBridger";
ServiceBridger.Type = "EAS.Distributed.ServiceBridger";
ServiceBridger.Assembly = "EAS.Distributed.Client";
ServiceBridger.Lifestyle = EAS.Objects.Lifecycle.LifestyleType.Thread;
PropertyInfo BridgerProperty = new PropertyInfo();
BridgerProperty.Name = "ServiceName";
BridgerProperty.Type = "string";
BridgerProperty.Expression = "EAS.RMIService.Service";
ServiceBridger.Properties.Add(BridgerProperty.Name, BridgerProperty);
ComponentConfig.Components.Add(ServiceBridger.Name, ServiceBridger);
#endregion #region 通用数据访问
ComponentInfo DataAccessor = new ComponentInfo();
DataAccessor.Name = "DataAccessor";
DataAccessor.Type = "EAS.Distributed.DataAccessor";
DataAccessor.Assembly = "EAS.Distributed.Client";
DataAccessor.Lifestyle = EAS.Objects.Lifecycle.LifestyleType.Thread;
PropertyInfo DataAccessorProperty = new PropertyInfo();
DataAccessorProperty.Name = "ServiceBridger";
DataAccessorProperty.Type = "object";
DataAccessorProperty.Expression = "ServiceBridger";
DataAccessor.Properties.Add(DataAccessorProperty.Name, DataAccessorProperty);
ComponentConfig.Components.Add(DataAccessor.Name, DataAccessor);
#endregion #region ORM访问组件
ComponentInfo OrmAccessor = new ComponentInfo();
OrmAccessor.Name = "OrmAccessor";
OrmAccessor.Type = "EAS.Distributed.OrmAccessor";
OrmAccessor.Assembly = "EAS.Distributed.Client";
OrmAccessor.Lifestyle = EAS.Objects.Lifecycle.LifestyleType.Thread; PropertyInfo OrmBridgerProperty = new PropertyInfo();
OrmBridgerProperty.Name = "ServiceBridger";
OrmBridgerProperty.Type = "object";
OrmBridgerProperty.Expression = "ServiceBridger";
OrmAccessor.Properties.Add(OrmBridgerProperty.Name, OrmBridgerProperty); PropertyInfo OrmDACProperty = new PropertyInfo();
OrmDACProperty.Name = "DataAccessor";
OrmDACProperty.Type = "object";
OrmDACProperty.Expression = "DataAccessor";
OrmAccessor.Properties.Add(OrmDACProperty.Name, OrmDACProperty);
ComponentConfig.Components.Add(OrmAccessor.Name, OrmAccessor);
#endregion
}
}
再程序执行前 执行BeforStart.EASConfig();
配置文件中只需要保留很少一部分信息
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="eas" type="EAS.ConfigHandler,EAS.MicroKernel" />
</configSections>
<!--SQLite运行必需-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<eas>
<configurations>
<item name="WorkstationUser" value="Administrator" />
<item name="LastUser" value="Administrator" />
</configurations>
<services>
<service name="EAS.RMIService.Service" service-type="WcfService" singleton="true" url="http://localhost:8888/eas/services/EAS.RMIService" />
</services>
</eas>
</configuration>
EAS.Net 在程序里配置组件的更多相关文章
- 微信小程序里自定义组件,canvas组件没有效果
methods: { /** * el:画圆的元素 * r:圆的半径 * w:圆的宽度 * 功能:画背景 */ drawCircleBg: function (el, r, w) { const ct ...
- 微信小程序-全局配置、组件、页面跳转、用户信息等
全局配置 三个页面 app.json pages字段 "pages":[ "pages/index/index", # 首页 "pages/home/ ...
- 在IIS7里配置 ISAPI,运行dll程序,总提示下载dll
在IIS7里配置 ISAPI,运行dll程序,总提示下载dll,只需要把对应站点应用程序池里面的高级设置里的启用32位应用程序,设为“true"即可.
- 微信小程序中的组件使用1
不管是vue还是react中,都在强调组件思想,同样,在微信小程序中也是使用组件思想来实现页面复用的,下面就简单介绍一下微信小程序中的组件思想. 组件定义与使用 要使用组件,首先需要有组件页面和使用组 ...
- 微信小程序简易table组件实现
前提:微信小程序自1.6.3基础库版本库开始支持简洁组件,之前的版本因不支持,故在引用组件处默认为空节点.关于微信小程序已有模板为何还需构建组件?一是因为组件可以更方便的自定义并绑定行为,二是在其他页 ...
- Log4.Net 在Winfrom、MVC、ashx程序里的使用,ashx程序里使用异步
最近做一个双11活动的,是一套相关的H5页面.本来以为难度不大,但是做下来几天还是遇到些问题.就总结一下吧,还是有收获的. 1.在H5页面中,有一个遮罩层,还是挺有意思的.直接用div+css控制遮罩 ...
- 微信小程序之swiper组件高度自适应
微信小程序之swiper组件高度自适应 要求: (顶部广告栏 ) 改变swiper组件的固定高度,使之随内部每张图片的高度做自适应 原理: 图片加载完之后,获取图片的原始宽高,根据宽高比,计算出适应后 ...
- 微信小程序day01-JSON配置
微信小程序 小程序代码构成 JSON配置WXML模板WXSS样式JS逻辑 1.JSON配置 小程序配置 app.json app.json: 是当前小程序的全局配置,包括了小程序的所有页面路径.界面表 ...
- 小程序解决方案 Westore - 组件、纯组件、插件开发
数据流转 先上一张图看清 Westore 怎么解决小程序数据难以管理和维护的问题: 非纯组件的话,可以直接省去 triggerEvent 的过程,直接修改 store.data 并且 update,形 ...
随机推荐
- PAT 甲级 1008 Elevator (20)(20 分)模拟水题
题目翻译: 1008.电梯 在我们的城市里,最高的建筑物里只有一部电梯.有一份由N个正数组成的请求列表.这些数表示电梯将会以规定的顺序在哪些楼层停下.电梯升高一层需要6秒,下降一层需要4秒.每次停下电 ...
- Carrying per-request context using the HttpRequestMessage.Properties
In a Web API application, I use Castle Windsor to supply services configured with PerWebRequest life ...
- [Delphi] 调用ocx
function RegisterDllServer(FileName: string): boolean; var nDllAddr: integer; bstr: string; ProcAddr ...
- 温故而知新-strtok函数
温故而知新-strtok函数 记得之前没见过这个函数,是把字符串分割成更小的字符串 来个例子就是比较鲜明了 $string = "Hello world. Beautiful day tod ...
- jQuery常用属性方法大全 attr(),val()
@@@@属性篇: 写作本篇文章的意义:jQuery的教程千千万,却没有英文版的API讲的系统.到位,一些话用中文翻译过来味道就变了,所以我将英文版的API的一些常用的方法单独提出来放在这里,并用自己的 ...
- 使用http-proxy-middleware 代理跨域
使用http-proxy-middleware 代理跨域 例如请求的url:“http://f.apiplus.cn/bj11x5.json” 1.打开config/index.js,在proxyTa ...
- 可视化库-Matplotlib-直方图(第四天)
1.plt.hist(array, bins, color) # array表示数值, bins表示的是bin的范围 data = np.random.normal(0, 20, 1000) # 画 ...
- 当前触发事件的两种方式(onclick) 和 ('id') 获取
1. <input type='text' onclick = 'Clickon(this)'> <script> function Clickon(num){ num.sty ...
- 2017面向对象程序设计(Java)第十五周学习总结
上周,老师要求同学们自学应用程序部署,并布置了相关的实验任务.此次实验的目的是掌握Java应用程序的打包操作:了解应用程序存储配置信息的两种方法: 了解Applet小应用程序的开发及应用方法:掌握基于 ...
- Grapher
[Grapher] You use Grapher to visualize and analyze implicit and explicit equations. You can graph eq ...