示例#1
0
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="leaf"></param>
        /// <returns></returns>
        public static IExtensionInfoDictionary GetInformations(this LeafExtensionBase leaf)
        {
            var filted = from wrapper in OpenFxLoader.LibsManager.Wrappers()
                         where wrapper.Info.ExtType == leaf.GetType()
                         select wrapper;

            return(filted.First().Info);
        }
示例#2
0
 /// <summary>
 /// 寻找一个LeafExtension的入口点函数
 /// </summary>
 /// <param name="leaf"></param>
 /// <returns></returns>
 internal static MethodInfo FindEntryPoint(this LeafExtensionBase leaf)
 {
     if (leaf == null)
     {
         throw new System.ArgumentNullException(nameof(leaf));
     }
     return(FindEntry(leaf.GetType()));
 }
示例#3
0
        /// <summary>
        /// 获取图标数组
        /// </summary>
        /// <param name="leaf"></param>
        /// <returns></returns>
        public static string GetName(this LeafExtensionBase leaf)
        {
            var filted = from wrapper in OpenFxLoader.LibsManager.Wrappers()
                         where wrapper.Info.ExtType == leaf.GetType()
                         select wrapper;
            var result = filted.First();

            return(result.Info.Name);
        }
示例#4
0
 /// <summary>
 /// 通过抛出指定的异常中断模块主要流程
 /// </summary>
 /// <exception cref="LeafTerminatedException"></exception>
 /// <param name="leaf"></param>
 /// <param name="exitCode"></param>
 public static void EndCurrentLeafThread(this LeafExtensionBase leaf, int exitCode = 0)
 {
     throw new LeafTerminatedException(exitCode);
 }