routine的加载
2024-09-01 13:30:18
// Hearthbuddy.Windows.MainWindow
// Token: 0x06000245 RID: 581 RVA: 0x0008C318 File Offset: 0x0008A518
[CompilerGenerated]
private void method_27()
{
List<IRoutine> routines = RoutineManager.Routines;
this.comboBox_1.ItemsSource = routines;
if (CommandLine.Arguments.Exists("routine"))
{
MainWindow.Class28 @class = new MainWindow.Class28();
@class.string_0 = CommandLine.Arguments.Single("routine");
IRoutine routine = routines.FirstOrDefault(new Func<IRoutine, bool>(@class.method_0));
if (routine != null)
{
this.comboBox_1.SelectedItem = routine;
}
}
else if (!string.IsNullOrEmpty(MainSettings.Instance.LastRoutine))
{
MainWindow.Class29 class2 = new MainWindow.Class29();
class2.string_0 = MainSettings.Instance.LastRoutine;
IRoutine routine2 = routines.FirstOrDefault(new Func<IRoutine, bool>(class2.method_0));
if (routine2 != null)
{
this.comboBox_1.SelectedItem = routine2;
}
}
if (this.comboBox_1.SelectedItem == null)
{
this.comboBox_1.SelectedItem = routines.FirstOrDefault<IRoutine>();
}
this.method_14();
}
// Triton.Bot.RoutineManager
// Token: 0x060011D3 RID: 4563 RVA: 0x000B7424 File Offset: 0x000B5624
public static bool Load()
{
try
{
string routinesPath = RoutineManager.RoutinesPath;
if (RoutineManager.Routines != null)
{
RoutineManager.ilog_0.ErrorFormat("[Load] This function can only be called once.", Array.Empty<object>());
return false;
}
if (!Directory.Exists(routinesPath))
{
Directory.CreateDirectory(routinesPath);
}
AssemblyLoader<IRoutine> assemblyLoader = new AssemblyLoader<IRoutine>(routinesPath, false);
RoutineManager.Routines = new List<IRoutine>();
foreach (IRoutine routine in assemblyLoader.Instances.AsReadOnly())
{
try
{
Utility.smethod_0(routine);
routine.Initialize();
RoutineManager.Routines.Add(routine);
}
catch (Exception exception)
{
RoutineManager.ilog_0.Debug("[Load] Exception thrown when initializing " + routine.Name + ". Routine will not be loaded.", exception);
Utility.smethod_1(routine);
routine.Deinitialize();
}
}
return true;
}
catch (Exception arg)
{
RoutineManager.ilog_0.ErrorFormat("[Load] An exception occurred: {0}.", arg);
}
return false;
}
最新文章
- 有关bootstrap之排版
- Jser 设计模式系列之面向对象 - 接口封装与继承
- JavaScript写在Html页面的<;head>;<;/head>;中
- 电量/信号的显示 imageLevel
- vs2010编辑器中找不到System.Web.Extensions.dll
- 2.在程序中如何实现Cookie信息的设置,读取和删除
- C#可扩展编程之MEF学习
- 第一章 git指令与设置
- HDU 2896 AC自动机 裸题
- 与《YII框架》不得不说的故事—5篇目录
- ORA-01092 ORA-12432: LBAC error: zllegnp:OCIStmtExecute 故障一例
- 数字是否可以被3和5同时整除,use if and % (21.9.2017)
- Ext JS 6开发实例(三) :主界面设计
- 第七课 路径与列表 html5学习2
- 【原创】从Rest到Graphql
- php中使用sphinx搜索引擎
- robotframework使用中的一些注意事项
- 解决Eclipse中“诡异”的错误:找不到或无法加载主类
- Shellcode入门
- ID基本操作(出血的定义)(置入图片)(添加页面)5.15
热门文章
- sql server统计总成绩和排名
- nginx: [emerg] directive ";upstream"; has no opening ";{"; in /application/nginx-1.6.3/conf/nginx.conf:13 ...
- ubuntu18.04 安装idea
- Formal Analysis of the TLS Handshake Protocol -----论文整理
- (转)大厂常问到的14个Java面试题
- websocket搭建的聊天室
- NXP LPC系列学习笔记汇总(持续更新中)
- EntityFramework 两个参数连续(中间有空格)问题
- Python3入门与进阶【笔记】
- 2019牛客多校B Beauty Values——思维题