撤回模块改进

This commit is contained in:
2025-07-20 00:25:33 +08:00
parent 6a97919f7a
commit 86fbd0cebc
2 changed files with 11 additions and 46 deletions
+1 -34
View File
@@ -178,40 +178,7 @@
</Window.CommandBindings>
<Grid x:Name="Main_Grid">
<!-- 等待COM组件加载动画 -->
<Grid x:Name="LoadingMask" Background="#80000000" Visibility="Collapsed" Panel.ZIndex="10000">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" >
<!-- 圆形旋转动画 -->
<Grid Width="60" Height="60">
<Ellipse Width="60" Height="60" Stroke="#40FFFFFF" StrokeThickness="6"/>
<Ellipse Width="60" Height="60" Stroke="White" StrokeThickness="6"
StrokeDashArray="0,1.5"
RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<RotateTransform x:Name="SpinnerRotate"/>
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:0.2"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>
<TextBlock Text="正在连接 PPT..."
Foreground="White"
Margin="0,20,0,0"
HorizontalAlignment="Center"
FontSize="18"
FontWeight="Bold"
Opacity="0.9"/>
</StackPanel>
</Grid>
<!--// 设置界面 //-->
<Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="True"
Margin="0,0,0,0">
+10 -12
View File
@@ -28,8 +28,6 @@ namespace Ink_Canvas {
private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) {
try {
// 显示加载动画
Application.Current.Dispatcher.Invoke(() => { LoadingMask.Visibility = Visibility.Visible; });
pptApplication =
(Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("kwpp.Application");
//pptApplication.SlideShowWindows[1].View.Next();
@@ -69,10 +67,6 @@ namespace Ink_Canvas {
RightSidePanelForPPTNavigation.Visibility = Visibility.Collapsed;
MessageBox.Show("未找到幻灯片");
}
finally {
// 隐藏加载动画
Application.Current.Dispatcher.Invoke(() => { LoadingMask.Visibility = Visibility.Collapsed; });
}
}
private void ToggleSwitchSupportWPS_Toggled(object sender, RoutedEventArgs e) {
@@ -91,8 +85,16 @@ namespace Ink_Canvas {
private void TimerCheckPPT_Elapsed(object sender, ElapsedEventArgs e) {
if (IsShowingRestoreHiddenSlidesWindow || IsShowingAutoplaySlidesWindow) return;
try {
// 显示加载动画
Application.Current.Dispatcher.Invoke(() => { LoadingMask.Visibility = Visibility.Visible; });
//var processes = Process.GetProcessesByName("wpp");
//if (processes.Length > 0 && !isWPSSupportOn) return;
//使用下方提前创建 PowerPoint 实例,将导致 PowerPoint 不再有启动界面
//pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
//new ComAwareEventInfo(typeof(EApplication_Event), "SlideShowBegin").AddEventHandler(pptApplication, new EApplication_SlideShowBeginEventHandler(this.PptApplication_SlideShowBegin));
//new ComAwareEventInfo(typeof(EApplication_Event), "SlideShowEnd").AddEventHandler(pptApplication, new EApplication_SlideShowEndEventHandler(this.PptApplication_SlideShowEnd));
//new ComAwareEventInfo(typeof(EApplication_Event), "SlideShowNextSlide").AddEventHandler(pptApplication, new EApplication_SlideShowNextSlideEventHandler(this.PptApplication_SlideShowNextSlide));
//ConfigHelper.Instance.IsInitApplicationSuccessful = true;
pptApplication =
(Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("PowerPoint.Application");
@@ -140,10 +142,6 @@ namespace Ink_Canvas {
Application.Current.Dispatcher.Invoke(() => { BtnPPTSlideShow.Visibility = Visibility.Collapsed; });
timerCheckPPT.Start();
}
finally {
// 隐藏加载动画
Application.Current.Dispatcher.Invoke(() => { LoadingMask.Visibility = Visibility.Collapsed; });
}
}
private void PptApplication_PresentationOpen(Presentation Pres) {