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,形 ...
随机推荐
- 【UVA】11825 Hackers' Crackdown(状压dp)
题目 传送门:QWQ 分析 $ n<= 16 $ 显然是状压 然后搞一搞(靠着蓝书yy一下) 代码 #include <bits/stdc++.h> using namespace ...
- Autofac Property Injection and Method Injection
While constructor parameter injection is the preferred method of passing values to a component being ...
- Struts2单例和多例
struts2中action是多例的,即一个session产生一个action如果是单例的话,若出现两个用户都修改一个对象的属性值,则会因为用户修改时间不同,两个用户访问得到的属性不一样,操作得出的结 ...
- 清除MAC 可清除空间
一.首先:查到了官方解释 https://support.apple.com/zh-cn/HT202867官方说 在 macOS Sierra 中,当您打开优化 Mac 储存空间时,会显示“可清除”内 ...
- Python/Java读取TXT文件
JAVA: public static void readTextFile(String filePath) { try { String encoding = "GBK"; Fi ...
- 值得推荐的开源C/C++框架和库
值得学习的C语言开源项目 - 1. Webbench Webbench是一个在linux下使用的非常简单的网站压测工具.它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工 ...
- protobuf's custom-options
[protobuf's custom-options] protobuf可以设置属性,就像__attribute__可以给函数设置属性一样,protobuf更牛的是可以设置自定义属性.实际就是属性对象 ...
- 读取指定路径的Properties文件
1.读取项目内的properties文件,项目内的properties文件一般都放在resource文件夹下面, 通过getClassLoader().getResourceAsStream()来获取 ...
- 关于ueditor与arcgis js api同用会报错的问题
在ueditor与arcgis js api共用时,需要将ueditor\third-party\zeroclipboard\ZeroClipboard.js中的 if (typeof define ...
- IoC和DI的区别
------------------siwuxie095 IoC 和 DI 的区别 1.区别 (1)Io ...