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 在程序里配置组件的更多相关文章

  1. 微信小程序里自定义组件,canvas组件没有效果

    methods: { /** * el:画圆的元素 * r:圆的半径 * w:圆的宽度 * 功能:画背景 */ drawCircleBg: function (el, r, w) { const ct ...

  2. 微信小程序-全局配置、组件、页面跳转、用户信息等

    全局配置 三个页面 app.json pages字段 "pages":[ "pages/index/index", # 首页 "pages/home/ ...

  3. 在IIS7里配置 ISAPI,运行dll程序,总提示下载dll

    在IIS7里配置 ISAPI,运行dll程序,总提示下载dll,只需要把对应站点应用程序池里面的高级设置里的启用32位应用程序,设为“true"即可.

  4. 微信小程序中的组件使用1

    不管是vue还是react中,都在强调组件思想,同样,在微信小程序中也是使用组件思想来实现页面复用的,下面就简单介绍一下微信小程序中的组件思想. 组件定义与使用 要使用组件,首先需要有组件页面和使用组 ...

  5. 微信小程序简易table组件实现

    前提:微信小程序自1.6.3基础库版本库开始支持简洁组件,之前的版本因不支持,故在引用组件处默认为空节点.关于微信小程序已有模板为何还需构建组件?一是因为组件可以更方便的自定义并绑定行为,二是在其他页 ...

  6. Log4.Net 在Winfrom、MVC、ashx程序里的使用,ashx程序里使用异步

    最近做一个双11活动的,是一套相关的H5页面.本来以为难度不大,但是做下来几天还是遇到些问题.就总结一下吧,还是有收获的. 1.在H5页面中,有一个遮罩层,还是挺有意思的.直接用div+css控制遮罩 ...

  7. 微信小程序之swiper组件高度自适应

    微信小程序之swiper组件高度自适应 要求: (顶部广告栏 ) 改变swiper组件的固定高度,使之随内部每张图片的高度做自适应 原理: 图片加载完之后,获取图片的原始宽高,根据宽高比,计算出适应后 ...

  8. 微信小程序day01-JSON配置

    微信小程序 小程序代码构成 JSON配置WXML模板WXSS样式JS逻辑 1.JSON配置 小程序配置 app.json app.json: 是当前小程序的全局配置,包括了小程序的所有页面路径.界面表 ...

  9. 小程序解决方案 Westore - 组件、纯组件、插件开发

    数据流转 先上一张图看清 Westore 怎么解决小程序数据难以管理和维护的问题: 非纯组件的话,可以直接省去 triggerEvent 的过程,直接修改 store.data 并且 update,形 ...

随机推荐

  1. Bootstrap-CL:略缩图

    ylbtech-Bootstrap-CL:略缩图 1.返回顶部 1. Bootstrap 缩略图 本章将讲解 Bootstrap 缩略图.大多数站点都需要在网格中布局图像.视频.文本等.Bootstr ...

  2. thinkPHP使用函数时字符串中不能含有管道符”|“,否则报错;

    如 {$data.name|str_repeat="|",###}报错!!!

  3. HDFS文件系统

    Hadoop 附带了一个名为 HDFS(Hadoop分布式文件系统)的分布式文件系统,专门存储超大数据文件,为整个Hadoop生态圈提供了基础的存储服务. 本章内容: 1) HDFS文件系统的特点,以 ...

  4. uva-110-没有for循环的排序

    题意:看输出就懂了,暴力枚举题,字符串最大长度是8,所有长度等于8的长度是8!=1x2x3x4x5x6x7x8=40320,数据量比较小的.只是枚举的方向比较怪异,如下,长度等于3的串 a ab,ba ...

  5. django2.0实现数据详情页展示的流程

    思路整理 1 先在urls.py中,定义路由获取的格式 url(r'^detail/(\d+)/$', views.blog_detail), 2 然后在views.py,定义数据获取的方法 def ...

  6. react之引用echarts

    react之引用echarts npm: npm install echarts --save 代码: import React, { Component } from 'react'; // 引入 ...

  7. JAXB--@XmlElementWrapper注解(二)

    在JAXB标准中,@XmlElementWrapper注解表示生成一个包装 XML 表示形式的包装器元素. 此元素主要用于生成一个包装集合的包装器 XML 元素.因此,该注释支持以下两种形式的序列化. ...

  8. 【C】常用的字符串函数

    1. strcpy 函数名:strcpy 用法:char *strcpy(char *destin, char *cource) 功能:将一个字符串从一个拷贝到另外一个 程序示例: #include ...

  9. 介绍MVC编程架构模式

    MVC(Model/View/Controller)模式是国外用得比较多的一种框架模式,最早是在Smaltalk中出现.MVC包括三类对象. Model——是应用对象 View——是它在屏幕上的表示 ...

  10. 01-E-1: 迭代与递归