Beispiel #1
0
        // 通用基础模块
        public static void BuildBaseComponents()
        {
            BC <NetCore>();  // 网络
            BC <UserPort>(); // 消息端口
            UserConnectionExt.ClientMessageHandler = "ServerPort";

            // 动态编译组件
            var css = new CsScriptShell <ScriptObject>();
            var dsp = new DynamicScriptProvider <ScriptObject>();

            dsp.AddNamespace("SCM");
            dsp.AddNamespace("Server");
            dsp.AddAssembly(System.Reflection.Assembly.GetExecutingAssembly().Location);
            dsp.AddNamespace("MySql");
            dsp.AddNamespace("MySql.Data");
            dsp.AddNamespace("MySql.Data.MySqlClient");
            dsp.AddAssembly(System.Reflection.Assembly.GetAssembly(typeof(MySql.Data.MySqlClient.MySqlConnection)).Location);
            dsp.AddNamespace("System.Data");
            dsp.AddAssembly(System.Reflection.Assembly.GetAssembly(typeof(System.Data.IDbConnection)).Location);
            dsp.CsScriptShell = css;
            css.DSP           = dsp;
            srv.Add("CsScriptShell", css);
        }