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,形 ...
随机推荐
- web攻击之一:XSS跨站脚本
一.浏览器安全 同源策略 影响源的因素:host,子域名,端口,协议 a.com通过以下代码: <script scr=http://b.com/b.js> 加载了b.com上的b.js, ...
- 使用libssh2连接到远程服务器
libssh2-1.7.0.tar.gz 示例代码:libssh2-1.7.0.tar.gz\libssh2-1.7.0\example 官网示例 https://www.libssh2.org/e ...
- 1021 docker常用命令和Jenkins搭建
docker常用命令 1.镜像管理 docker pull (镜像名) # 默认拉取最新版本的镜像 docker pull (镜像名:版本号) #拉取指定版本的镜像 docker push (镜像名) ...
- javascript中 关于eval的那些事
javascript中的eval是一个非常灵活,但是灵活是伴随着风险的. 一.下面我们来看看那使用eval声明变量的问题. function test(x){ eval("var a=x;& ...
- KVC & KVO 入门
KVC: 简介: 全称 Key-Value Coding .KVC是一种间接访问对象属性(用字符串表征)的机制,而不是直接调用对象的accessor(setter/getter)方法或是直接访问成员对 ...
- Django学习---信号
Django学习之信号 如果我想对所有在数据库创建数据的时候记录一条日志. 比如我们在django中往数据库中增加一条数据,希望生成一条操作日志,或者在数据保存和数据保存之后都保存一条操作日志,那我们 ...
- selenium webdriver——JS滚动到最底部
JS控制滚动条的位置: window.scrollTo(x,y); 竖向滚动条置顶 window.scrollTo(0,0); 竖向滚动条置底 window.scrollTo(0,document.b ...
- VBS 创建快捷方式
Dim Shell,DesktopPath,link Set Shell = CreateObject("WScript.Shell") DesktopPath = Shell.S ...
- spring mvc请求参数中文乱码解决方案
POST 请求 在web.xml中加上增加过滤器 <filter> <filter-name>encodingFilter</filter-name> <fi ...
- java关于密码的加密解密
密码的加密方法有多种,常见的为Aes.Md5 Aes加密,可逆. 其中,Md5加密是采用了散列算法,也就是哈希算法,可以进行多次散列加密.Md5加密是不可逆的,无法解密. MD5是不可逆的单向加密方式 ...