예제 #1
0
        /// <summary>
        /// 模块注入
        /// </summary>
        /// <param name="Name">网站名称</param>
        /// <param name="Url">网站地址</param>
        /// <param name="CallBack">存储结果事件,回调函数</param>
        /// <returns> Maxcms实例</returns>
        public static MaxcmsEntity ModuleInject(string Name, string Url, Action <string, VideoInfo> CallBack)
        {
            var Entity = new MaxcmsEntity();

            Entity.ServerName      = Name;
            Entity.ServerUrl       = Url;
            Entity.CompletFunction = CallBack;
            Entity.SetCompletEvent();
            Entity.InitClassList();
            return(Entity);
        }
예제 #2
0
 /// <summary>
 /// 将当前实例保存到Json中
 /// </summary>
 /// <param name="Entity">待保存的实例</param>
 /// <returns>Json文本</returns>
 public static string ModuleSaveJson(MaxcmsEntity Entity)
 {
     return(JsonConvert.SerializeObject(Entity));
 }