Ejemplo n.º 1
0
        /// <summary>
        /// 更新插件信息
        /// </summary>
        public void UpdatePluginClass(PluginClassInfo pluginClass, int id)
        {
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();

                var manager = new PluginClassManager();
                var entity  = manager.QueryPluginClassById(id);

                if (entity == null)
                {
                    throw new Exception("插件信息未被查询到");
                }
                entity.AssemblyFileName = pluginClass.AssemblyFileName;
                entity.ClassName        = pluginClass.ClassName;
                entity.EndTime          = pluginClass.EndTime;
                entity.InterfaceName    = pluginClass.InterfaceName;
                entity.IsEnable         = pluginClass.IsEnable;
                entity.OrderIndex       = pluginClass.OrderIndex;
                entity.StartTime        = pluginClass.StartTime;

                manager.UpdatePluginClass(entity);

                biz.CommitTran();
            }
            BusinessHelper.ClearPlugin();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除插件信息
        /// </summary>
        public void DeletePluginClass(int id)
        {
            var manager = new PluginClassManager();
            var entity  = manager.QueryPluginClassById(id);

            manager.DeletePluginClass(entity);
            BusinessHelper.ClearPlugin();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加插件类信息
        /// </summary>
        public void AddPluginClass(PluginClassInfo pluginClass)
        {
            using (var biz = new GameBizBusinessManagement())
            {
                biz.BeginTran();

                var manager = new PluginClassManager();
                var entity  = new PluginClass()
                {
                    AssemblyFileName = pluginClass.AssemblyFileName,
                    ClassName        = pluginClass.ClassName,
                    EndTime          = pluginClass.EndTime,
                    InterfaceName    = pluginClass.InterfaceName,
                    IsEnable         = pluginClass.IsEnable,
                    OrderIndex       = pluginClass.OrderIndex,
                    StartTime        = pluginClass.StartTime,
                };
                manager.AddPluginClass(entity);

                biz.CommitTran();
            }

            BusinessHelper.ClearPlugin();
        }