/// <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); }
/// <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())); }
/// <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); }
/// <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); }