private void Form1_FormClosed(object sender, FormClosedEventArgs e) { if (Global.fullscreen) { Global.FullscreenOff(); } Global.windowPosition.MainFormPosition = WindowPosition.Serialize(this); if (FormMonitor.isCreated()) { Global.windowPosition.MonitorFormPosition = WindowPosition.Serialize(FormMonitor.instance); } if (formOptions != null) { Global.windowPosition.OptionsFormPosition = WindowPosition.Serialize(formOptions); } if (HivemindSubmit.isCreated()) { Global.windowPosition.HivemindSubmitFormPosition = WindowPosition.Serialize(HivemindSubmit.instance); } Global.windowPosition.Save(); Hide(); if (FormMonitor.isCreated()) { FormMonitor.instance.Hide(); } if (Global.script.transparentMode) { FormBottomLayer.instance.Hide(); } if (FormTooltip.isCreated()) { FormTooltip.instance.Hide(); } if (Global.options.useCache) { Global.cache.Save(); } Global.options.SaveOptions(); Global.agth.Disconnect(); Global.agth.SaveAppProfiles(); if (Atlas.status == AtlasInitStatus.SUCCESS) { Atlas.Deinitialize(); } if (Mecab.status == MecabInitStatus.SUCCESS) { Mecab.Deinitialize(); } /*foreach (Translation trans in Translation.current) * { * trans.Abort(); * }*/ }
private void PreloadThreadProc() { var ed = Edict.instance; var inflect = Inflect.instance; foreach (var trans in Global.options.translators) { if (trans.inUse) { string name = Translation.Translators[trans.id]; if (name == "Atlas") { Atlas.Ready(); } else if (name.IndexOf("MeCab") >= 0) { Mecab.Ready(); } } } Invoke(new Action(() => ClipboardMonitoring.UpdateEnabled())); }