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. html页面转换成pdf

    一般页面都是.jsp页面,所以要把.jsp转换成html,在生成pdf,在网上找了好多方法,只有用一个插件,wkhtmltopdf-0.8.3.exe,生成的pdf会相对的好看. 先附上我做的.jsp ...

  2. 常见报表的JS代码

    1.合并单元格 这个表格在报表里面算是比较典型的 1.里面的表格的列标题现在是写死的,其实这些可以通过配置进行 2.至于如果表头要进行合并(这种需求比较少,也比较容易实现) 3.至于统计:最好在后台按 ...

  3. leetcode290

    public class Solution { public bool WordPattern(string pattern, string str) { var list = str.Split(' ...

  4. C++Builder 也有StringBuilder

    System::Sysutils::TStringBuilder *sb = new TStringBuilder;    sb->Append("ww");    sb-& ...

  5. AndroidStudio 中怎样查看获取MD5和SHA1值(应用签名)

    曾经在Eclipse中我们获取MD5和SHA1非常easy就找到了例如以下图所看到的: 就能够在Eclipse中看到所须要调试的MD5和SHA1.可是在AndroidStudio中我找了一圈也没有发现 ...

  6. FP扣损耗逻辑代码

    芯片172没有扣减损耗, 取数:SAP_STPO的AUSCH   IN_BOM_DETAILS:耗损比例COMPONENT_YIELD_UOM   存储过程FP_MO2SAP:supplydmdpeg ...

  7. solr dismax与edismax的参数列表

    dismax q.alt qf (Query Fields) mm (Minimum 'Should' Match) pf (Phrase Fields) ps (Phrase Slop) qs (Q ...

  8. jquey下eq()的使用注意事项

    写在开始的话: 今天在公司路经同事工位,发现在写jquery代码,刚好遇见一个bug,于是驻足看了一会,发现了jq遍历方法中eq()的使用的一个容易犯错的地方. 同事的代码大概意思是这样的: < ...

  9. 4-memset函数总结

    头文件:cstring 或 memory 一般用处: memset(arr, 0, sizeof(aar));    //初始化为0 memset(arr, -1, sizeof(aar));   / ...

  10. 禁止进入activity自动弹出键盘

    禁止进入activity自动弹出键盘 在Manifest.xml中设定activity的属性 android:windowSoftInputMode="stateHidden|stateUn ...