public RefreshLanguageService()
        {
            _instance = this;
            items     = new List <WeakReference>();

            _harmony = HarmonyInstance.Create(nameof(RefreshLanguageService));
            _harmony.Patch(typeof(ModItem).GetConstructors()[0], null, new HarmonyMethod(NoroHelper.MethodInfo(() => OnModItemCtor(null))));
        }
示例#2
0
        public RefreshLanguageService()
        {
            _instance = this;
            items     = new List <WeakReference>();

            _harmony = HarmonyInstance.Create(nameof(RefreshLanguageService));
            var postfix = new HarmonyMethod(typeof(RefreshLanguageService).GetMethod(nameof(OnModItemCtor), All));

            _harmony.Patch(typeof(ModItem).GetConstructors()[0], null, postfix);
        }
 protected override void DisposeUnmanaged()
 {
     _instance = null;
     _harmony.UnpatchAll(nameof(RefreshLanguageService));
 }