예제 #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();
        }
예제 #2
0
        /// <summary>
        /// 删除插件信息
        /// </summary>
        public void DeletePluginClass(int id)
        {
            var manager = new PluginClassManager();
            var entity  = manager.QueryPluginClassById(id);

            manager.DeletePluginClass(entity);
            BusinessHelper.ClearPlugin();
        }
예제 #3
0
 /// <summary>
 /// 查询插件列表
 /// </summary>
 public PluginClassInfo_Collection QueryPluginClassList(int pageIndex, int pageSize)
 {
     using (var manage = new PluginClassManager())
     {
         PluginClassInfo_Collection colleciton = new PluginClassInfo_Collection();
         int totalCount;
         colleciton.PluginClassList = manage.QueryPluginClassList(pageIndex, pageSize, out totalCount);
         colleciton.TotalCount      = totalCount;
         return(colleciton);
     }
 }
예제 #4
0
        /// <summary>
        /// 查询某个插件信息
        /// </summary>
        public PluginClassInfo PluginClassInfoById(int id)
        {
            var entity = new PluginClassManager().QueryPluginClassById(id);

            if (entity == null)
            {
                throw new Exception("插件信息未被查询到");
            }
            return(new PluginClassInfo()
            {
                AssemblyFileName = entity.AssemblyFileName,
                ClassName = entity.ClassName,
                EndTime = entity.EndTime,
                InterfaceName = entity.InterfaceName,
                IsEnable = entity.IsEnable,
                OrderIndex = entity.OrderIndex,
                StartTime = entity.StartTime,
                Id = entity.Id,
            });
        }
예제 #5
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();
        }