代码优化

This commit is contained in:
2026-02-21 16:51:34 +08:00
parent 469dbd1497
commit 99ec2d7609
31 changed files with 171 additions and 158 deletions
+2 -2
View File
@@ -1399,7 +1399,7 @@ namespace Ink_Canvas.Windows
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
presentation = currentPresentationProperty?.GetValue(pptManager) as Microsoft.Office.Interop.PowerPoint.Presentation;
}
catch { }
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
// 如果 CurrentPresentation 不可用,尝试 GetCurrentActivePresentation
if (presentation == null)
@@ -1409,7 +1409,7 @@ namespace Ink_Canvas.Windows
var getCurrentActivePresentationMethod = pptManager.GetType().GetMethod("GetCurrentActivePresentation");
presentation = getCurrentActivePresentationMethod?.Invoke(pptManager, null) as Microsoft.Office.Interop.PowerPoint.Presentation;
}
catch { }
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}
if (presentation != null)