保存缓存时 自动保存文档
This commit is contained in:
parent
8ceaf028d8
commit
70c0654a41
Binary file not shown.
@ -650,6 +650,11 @@ namespace AIProofread
|
||||
return BridgeResult.Error(1, "请先保存文档");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 静默时 自动保存文档
|
||||
Globals.ThisAddIn.ActiveDocument.Save();
|
||||
}
|
||||
try
|
||||
{
|
||||
File.WriteAllText(Globals.ThisAddIn.ActiveDocument.ProofreadCachePath, cache);
|
||||
|
@ -98,14 +98,24 @@ namespace AIProofread.Model
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowDialog(string message,string confirmText, string confirmAction)
|
||||
public void ShowDialog(string message, string confirmText, string confirmAction)
|
||||
{
|
||||
TaskPane.Control.BeginInvoke(new Action(() => {
|
||||
TaskPane.Control.BeginInvoke(new Action(() =>
|
||||
{
|
||||
//MessageBox.Show(message, "提示");
|
||||
FormMessage.ShowMessage(message, confirmText, confirmAction);
|
||||
}));
|
||||
}
|
||||
|
||||
public void ShowLogin(string action)
|
||||
{
|
||||
TaskPane.Control.BeginInvoke(new Action(() =>
|
||||
{
|
||||
FormLogin frm = new FormLogin(action);
|
||||
frm.ShowDialog();
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏面板
|
||||
/// </summary>
|
||||
@ -550,7 +560,7 @@ namespace AIProofread.Model
|
||||
if (item.Tag != "i") index++;
|
||||
if (mark != null)
|
||||
{
|
||||
marks.Add(item.Id, new ProofreadItem(item,correct.Insert, mark, Id));
|
||||
marks.Add(item.Id, new ProofreadItem(item, correct.Insert, mark, Id));
|
||||
try
|
||||
{
|
||||
if (item.Tag == "i")
|
||||
@ -572,9 +582,10 @@ namespace AIProofread.Model
|
||||
// //item.Value.mark.Shading.BackgroundPatternColor = WdColor.wdColorLightOrange;
|
||||
//}
|
||||
}
|
||||
}catch(Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log(string.Format("mark color error {0}",e.Message));
|
||||
Logger.Log(string.Format("mark color error {0}", e.Message));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -712,15 +723,20 @@ namespace AIProofread.Model
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!hasProofreaded && !CurrentDocument.Saved) // 没有校对前需要提示保存
|
||||
if (!hasProofreaded && !CurrentDocument.Saved) // 没有校对前需要提示保存
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(hasProofreaded && hasProcessMark && !CurrentDocument.Saved)
|
||||
if (hasProofreaded && hasProcessMark && !CurrentDocument.Saved)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
internal void Save()
|
||||
{
|
||||
CurrentDocument.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -359,12 +359,11 @@ namespace AIProofread
|
||||
/// <param name="action"></param>
|
||||
public void ShowLoginForm(string action) {
|
||||
// 关闭之前的窗口
|
||||
if(LoginFormList.Count > 0){
|
||||
LoginFormList.ForEach(f => f.Close());
|
||||
}
|
||||
FormLogin frm = new FormLogin(action);
|
||||
LoginFormList.Add(frm);
|
||||
frm.Show();
|
||||
//if(LoginFormList.Count > 0){
|
||||
// LoginFormList.ForEach(f => f.Close());
|
||||
//}
|
||||
//LoginFormList.Add(frm);
|
||||
ActiveDocument?.ShowLogin(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user