Revert "add:issue #224"

This reverts commit 07a62d2f78.
This commit is contained in:
2025-10-01 00:53:22 +08:00
parent 07a62d2f78
commit 69c45764b2
18 changed files with 52 additions and 229 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ namespace Ink_Canvas
public static string RootPath = Environment.GetEnvironmentVariable("APPDATA") + "\\Ink Canvas\\";
// 新增:标记是否通过--board参数启动
public static bool StartWithBoardMode;
public static bool StartWithBoardMode = false;
// 新增:保存看门狗进程对象
private static Process watchdogProcess;
// 新增:标记是否为软件内主动退出
@@ -229,7 +229,7 @@ namespace Ink_Canvas.Helpers
private readonly Dictionary<IntPtr, DateTime> _lastScanTime = new Dictionary<IntPtr, DateTime>();
private readonly HashSet<IntPtr> _knownWindows = new HashSet<IntPtr>();
private readonly Dictionary<string, DateTime> _processLastScanTime = new Dictionary<string, DateTime>();
private int _consecutiveEmptyScans;
private int _consecutiveEmptyScans = 0;
private DateTime _lastSuccessfulScan = DateTime.Now;
private readonly object _scanLock = new object();
+3 -3
View File
@@ -24,12 +24,12 @@ namespace Ink_Canvas.Helpers
// 多屏幕支持相关字段
private Screen _currentScreen;
private bool _isMultiScreenMode;
private bool _isMultiScreenMode = false;
private bool _enableScreenSpecificHotkeys = true; // 是否启用基于屏幕的热键注册
// 智能热键管理相关字段
private bool _isWindowFocused;
private bool _isMouseOverWindow;
private bool _isWindowFocused = false;
private bool _isMouseOverWindow = false;
private System.Windows.Threading.DispatcherTimer _mousePositionTimer;
// 配置文件路径
+1 -1
View File
@@ -30,7 +30,7 @@ namespace Ink_Canvas.Helpers
public class StrokeVisual : DrawingVisual
{
private bool _needsRedraw = true;
private int _lastPointCount;
private int _lastPointCount = 0;
private const int REDRAW_THRESHOLD = 3;
/// <summary>
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Ink_Canvas.Helpers
private const int MinSwitchIntervalMs = 100; // 最小切换间隔100毫秒
// 内存管理相关字段
private long _totalMemoryUsage;
private long _totalMemoryUsage = 0;
private const long MaxMemoryUsageBytes = 100 * 1024 * 1024; // 100MB限制
private DateTime _lastMemoryCleanup = DateTime.MinValue;
private const int MemoryCleanupIntervalMinutes = 5; // 5分钟清理一次
-33
View File
@@ -3242,39 +3242,6 @@
FontFamily="Consolas"
Text="{Binding ElementName=RandWindowOnceMaxStudentsSlider, Path=Value, Converter={StaticResource IntNumberToString}}" />
</ui:SimpleStackPanel>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<TextBlock Foreground="#fafafa" Text="计时器设置"
FontSize="16" FontWeight="Bold" Margin="0,10,0,5" />
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="使用老版计时器按钮UI"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchUseLegacyTimerUI"
IsOn="False" FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
Toggled="ToggleSwitchUseLegacyTimerUI_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="计时器提醒音量" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Slider x:Name="TimerVolumeSlider" Minimum="0"
Maximum="1" Width="168" FontFamily="Microsoft YaHei UI"
ValueChanged="TimerVolumeSlider_ValueChanged"
FontSize="20" IsSnapToTickEnabled="True" Value="1" TickFrequency="0.1"
TickPlacement="None" AutoToolTipPlacement="None" />
<TextBlock VerticalAlignment="Center" Margin="12,0,16,0" FontSize="14"
FontFamily="Consolas"
Text="{Binding ElementName=TimerVolumeSlider, Path=Value, StringFormat={}{0:P0}}" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,5,0,0">
<TextBlock Foreground="#fafafa" Text="自定义提醒铃声:" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<Button Name="ButtonSelectCustomTimerSound" Content="选择文件" FontFamily="Microsoft YaHei UI"
Click="ButtonSelectCustomTimerSound_Click" Padding="10,3"/>
<Button Name="ButtonResetTimerSound" Content="重置" FontFamily="Microsoft YaHei UI"
Click="ButtonResetTimerSound_Click" Padding="10,3" Margin="5,0,0,0"/>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox>
@@ -1493,7 +1493,7 @@ namespace Ink_Canvas
#region Image Resize Handles
// 图片缩放选择点相关变量
private bool isResizingImage;
private bool isResizingImage = false;
private Point imageResizeStartPoint;
private string activeResizeHandle = "";
+5 -5
View File
@@ -13,14 +13,14 @@ namespace Ink_Canvas
public partial class MainWindow : Window
{
// 橡皮擦系统核心变量
public bool isUsingGeometryEraser;
private IncrementalStrokeHitTester hitTester;
public bool isUsingGeometryEraser = false;
private IncrementalStrokeHitTester hitTester = null;
public double eraserWidth = 64;
public bool isEraserCircleShape;
public bool isUsingStrokesEraser;
public bool isEraserCircleShape = false;
public bool isUsingStrokesEraser = false;
private Matrix scaleMatrix;
private Matrix scaleMatrix = new Matrix();
// 橡皮擦覆盖层相关控件
private System.Windows.Controls.Canvas eraserOverlayCanvas;
+2 -2
View File
@@ -91,8 +91,8 @@ namespace Ink_Canvas
private const int ProcessMonitorInterval = 1000; // 应用程序监控间隔(毫秒)
// 上次播放位置相关字段
private int _lastPlaybackPage;
private bool _shouldNavigateToLastPage;
private int _lastPlaybackPage = 0;
private bool _shouldNavigateToLastPage = false;
// 页面切换防抖机制
private DateTime _lastSlideSwitchTime = DateTime.MinValue;
@@ -255,12 +255,12 @@ namespace Ink_Canvas
#endregion
private bool isGridInkCanvasSelectionCoverMouseDown;
private bool isStrokeDragging;
private bool isStrokeDragging = false;
private Point strokeDragStartPoint;
private StrokeCollection StrokesSelectionClone = new StrokeCollection();
// 选择框和选择点相关变量
private bool isResizing;
private bool isResizing = false;
private string currentResizeHandle = "";
private Point resizeStartPoint;
private Rect originalSelectionBounds;
-38
View File
@@ -2516,44 +2516,6 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ToggleSwitchUseLegacyTimerUI_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.UseLegacyTimerUI = ToggleSwitchUseLegacyTimerUI.IsOn;
SaveSettingsToFile();
}
private void TimerVolumeSlider_ValueChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.TimerVolume = TimerVolumeSlider.Value;
SaveSettingsToFile();
}
private void ButtonSelectCustomTimerSound_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog
{
Title = "选择计时器提醒铃声",
Filter = "音频文件 (*.wav)|*.wav|所有文件 (*.*)|*.*",
DefaultExt = "wav"
};
if (openFileDialog.ShowDialog() == true)
{
Settings.RandSettings.CustomTimerSoundPath = openFileDialog.FileName;
SaveSettingsToFile();
MessageBox.Show("自定义铃声设置成功!", "设置成功", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
private void ButtonResetTimerSound_Click(object sender, RoutedEventArgs e)
{
Settings.RandSettings.CustomTimerSoundPath = "";
SaveSettingsToFile();
MessageBox.Show("已重置为默认铃声!", "重置成功", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void ToggleSwitchShowRandomAndSingleDraw_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@@ -856,10 +856,6 @@ namespace Ink_Canvas
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
// 计时器设置
ToggleSwitchUseLegacyTimerUI.IsOn = Settings.RandSettings.UseLegacyTimerUI;
TimerVolumeSlider.Value = Settings.RandSettings.TimerVolume;
// 加载自定义点名背景
UpdatePickNameBackgroundsInComboBox();
@@ -878,8 +874,6 @@ namespace Ink_Canvas
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
ToggleSwitchExternalCaller.IsOn = Settings.RandSettings.DirectCallCiRand;
ComboBoxExternalCallerType.SelectedIndex = Settings.RandSettings.ExternalCallerType;
ToggleSwitchUseLegacyTimerUI.IsOn = Settings.RandSettings.UseLegacyTimerUI;
TimerVolumeSlider.Value = Settings.RandSettings.TimerVolume;
}
// ModeSettings
+2 -2
View File
@@ -71,10 +71,10 @@ namespace Ink_Canvas
private DateTime cachedNetworkTime = DateTime.Now;
private DateTime lastNtpSyncTime = DateTime.MinValue;
private string lastDisplayedTime = "";
private bool useNetworkTime;
private bool useNetworkTime = false;
private TimeSpan networkTimeOffset = TimeSpan.Zero;
private DateTime lastLocalTime = DateTime.Now; // 记录上次的本地时间,用于检测时间跳跃
private bool isNtpSyncing; // 防止重复NTP同步的标志
private bool isNtpSyncing = false; // 防止重复NTP同步的标志
private async Task<DateTime> GetNetworkTimeAsync()
{
+2 -1
View File
@@ -24,7 +24,8 @@ namespace Ink_Canvas
private InkCanvasEditingMode lastInkCanvasEditingMode = InkCanvasEditingMode.Ink;
private DateTime lastTouchDownTime = DateTime.MinValue;
private const double MULTI_TOUCH_DELAY_MS = 100;
private bool isMultiTouchTimerActive;
private bool isInWritingMode = false;
private bool isMultiTouchTimerActive = false;
/// </summary>
/// 保存画布上的非笔画元素(如图片、媒体元素等)
+10 -16
View File
@@ -91,7 +91,7 @@ namespace Ink_Canvas
[JsonProperty("enablePalmEraser")]
public bool EnablePalmEraser { get; set; } = true;
[JsonProperty("palmEraserSensitivity")]
public int PalmEraserSensitivity { get; set; } // 0-低敏感度, 1-中敏感度, 2-高敏感度
public int PalmEraserSensitivity { get; set; } = 0; // 0-低敏感度, 1-中敏感度, 2-高敏感度
[JsonProperty("clearCanvasAlsoClearImages")]
public bool ClearCanvasAlsoClearImages { get; set; } = true;
[JsonProperty("showCircleCenter")]
@@ -99,7 +99,7 @@ namespace Ink_Canvas
// 墨迹渐隐功能设置
[JsonProperty("enableInkFade")]
public bool EnableInkFade { get; set; }
public bool EnableInkFade { get; set; } = false;
[JsonProperty("inkFadeTime")]
public int InkFadeTime { get; set; } = 3000; // 墨迹渐隐时间(毫秒)
@@ -236,7 +236,7 @@ namespace Ink_Canvas
public int QuickColorPaletteDisplayMode { get; set; } = 1;
[JsonProperty("enableHotkeysInMouseMode")]
public bool EnableHotkeysInMouseMode { get; set; }
public bool EnableHotkeysInMouseMode { get; set; } = false;
}
@@ -310,9 +310,9 @@ namespace Ink_Canvas
[JsonProperty("isAlwaysGoToFirstPageOnReenter")]
public bool IsAlwaysGoToFirstPageOnReenter { get; set; }
[JsonProperty("enablePowerPointEnhancement")]
public bool EnablePowerPointEnhancement { get; set; }
public bool EnablePowerPointEnhancement { get; set; } = false;
[JsonProperty("showGestureButtonInSlideShow")]
public bool ShowGestureButtonInSlideShow { get; set; }
public bool ShowGestureButtonInSlideShow { get; set; } = false;
}
public class Automation
@@ -452,7 +452,7 @@ namespace Ink_Canvas
public int AutoDelSavedFilesDaysThreshold = 15;
[JsonProperty("keepFoldAfterSoftwareExit")]
public bool KeepFoldAfterSoftwareExit { get; set; }
public bool KeepFoldAfterSoftwareExit { get; set; } = false;
[JsonProperty("isSaveFullPageStrokes")]
public bool IsSaveFullPageStrokes;
@@ -467,13 +467,13 @@ namespace Ink_Canvas
public class FloatingWindowInterceptorSettings
{
[JsonProperty("isEnabled")]
public bool IsEnabled { get; set; }
public bool IsEnabled { get; set; } = false;
[JsonProperty("scanIntervalMs")]
public int ScanIntervalMs { get; set; } = 5000;
[JsonProperty("autoStart")]
public bool AutoStart { get; set; }
public bool AutoStart { get; set; } = false;
[JsonProperty("showNotifications")]
public bool ShowNotifications { get; set; } = true;
@@ -622,17 +622,11 @@ namespace Ink_Canvas
[JsonProperty("directCallCiRand")]
public bool DirectCallCiRand { get; set; }
[JsonProperty("externalCallerType")]
public int ExternalCallerType { get; set; }
public int ExternalCallerType { get; set; } = 0;
[JsonProperty("selectedBackgroundIndex")]
public int SelectedBackgroundIndex { get; set; }
[JsonProperty("customPickNameBackgrounds")]
public List<CustomPickNameBackground> CustomPickNameBackgrounds { get; set; } = new List<CustomPickNameBackground>();
[JsonProperty("useLegacyTimerUI")]
public bool UseLegacyTimerUI { get; set; }
[JsonProperty("timerVolume")]
public double TimerVolume { get; set; } = 1.0;
[JsonProperty("customTimerSoundPath")]
public string CustomTimerSoundPath { get; set; } = "";
}
public class CustomPickNameBackground
@@ -674,6 +668,6 @@ namespace Ink_Canvas
public class ModeSettings
{
[JsonProperty("isPPTOnlyMode")]
public bool IsPPTOnlyMode { get; set; } // 是否为仅PPT模式,默认为false(正常模式)
public bool IsPPTOnlyMode { get; set; } = false; // 是否为仅PPT模式,默认为false(正常模式)
}
}
+12 -12
View File
@@ -44,18 +44,18 @@
<Grid Name="GridAdjustHour" Visibility="Visible" Margin="-29,-30,0,-30" Width="29">
<ui:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_1">
<TextBlock x:Name="HourPlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click">
<TextBlock x:Name="HourPlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_2">
<TextBlock x:Name="HourMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_3">
<TextBlock x:Name="HourMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
</Grid>
@@ -91,18 +91,18 @@
<Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
<ui:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_5">
<TextBlock x:Name="MinutePlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_4">
<TextBlock x:Name="MinutePlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_6">
<TextBlock x:Name="MinuteMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_7">
<TextBlock x:Name="MinuteMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
<Border x:Name="BtnTimeSetOkay" MouseUp="Grid_MouseUp"
@@ -151,18 +151,18 @@
<Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
<ui:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_8">
<TextBlock x:Name="SecondPlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_9">
<TextBlock x:Name="SecondPlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_10">
<TextBlock x:Name="SecondMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_11">
<TextBlock x:Name="SecondMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ui:SimpleStackPanel>
</Grid>
+7 -102
View File
@@ -1,5 +1,4 @@
using Ink_Canvas.Helpers;
using Ink_Canvas.Resources;
using System;
using System.Media;
using System.Timers;
@@ -7,7 +6,6 @@ using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace Ink_Canvas
{
@@ -23,7 +21,6 @@ namespace Ink_Canvas
timer.Elapsed += Timer_Elapsed;
timer.Interval = 50;
InitializeUI();
}
private void Timer_Elapsed(object sender, ElapsedEventArgs e)
@@ -65,25 +62,24 @@ namespace Ink_Canvas
Application.Current.Dispatcher.Invoke(() =>
{
//Play sound
PlayTimerSound();
player.Stream = Properties.Resources.TimerDownNotice;
player.Play();
});
}
}
SoundPlayer player = new SoundPlayer();
MediaPlayer mediaPlayer = new MediaPlayer();
int hour;
int hour = 0;
int minute = 1;
int second;
int second = 0;
int totalSeconds = 60;
DateTime startTime = DateTime.Now;
DateTime pauseTime = DateTime.Now;
bool isTimerRunning;
bool isPaused;
bool useLegacyUI;
bool isTimerRunning = false;
bool isPaused = false;
Timer timer = new Timer();
@@ -338,97 +334,6 @@ namespace Ink_Canvas
}
}
private void InitializeUI()
{
// 从设置中读取配置
if (MainWindow.Settings.RandSettings != null)
{
useLegacyUI = MainWindow.Settings.RandSettings.UseLegacyTimerUI;
UpdateButtonTexts();
}
}
public void RefreshUI()
{
InitializeUI();
}
private void UpdateButtonTexts()
{
if (useLegacyUI)
{
// 老版UI:使用+5, +1, -1, -5
HourPlus5Text.Text = "+5";
HourPlus1Text.Text = "+1";
HourMinus1Text.Text = "-1";
HourMinus5Text.Text = "-5";
MinutePlus5Text.Text = "+5";
MinutePlus1Text.Text = "+1";
MinuteMinus1Text.Text = "-1";
MinuteMinus5Text.Text = "-5";
SecondPlus5Text.Text = "+5";
SecondPlus1Text.Text = "+1";
SecondMinus1Text.Text = "-1";
SecondMinus5Text.Text = "-5";
}
else
{
// 新版UI:使用箭头符号
HourPlus5Text.Text = "∧∧";
HourPlus1Text.Text = "∧";
HourMinus1Text.Text = "";
HourMinus5Text.Text = "∨∨";
MinutePlus5Text.Text = "∧∧";
MinutePlus1Text.Text = "∧";
MinuteMinus1Text.Text = "";
MinuteMinus5Text.Text = "∨∨";
SecondPlus5Text.Text = "∧∧";
SecondPlus1Text.Text = "∧";
SecondMinus1Text.Text = "";
SecondMinus5Text.Text = "∨∨";
}
}
private void PlayTimerSound()
{
try
{
double volume = MainWindow.Settings.RandSettings?.TimerVolume ?? 1.0;
mediaPlayer.Volume = volume;
if (!string.IsNullOrEmpty(MainWindow.Settings.RandSettings?.CustomTimerSoundPath) &&
System.IO.File.Exists(MainWindow.Settings.RandSettings.CustomTimerSoundPath))
{
// 播放自定义铃声
mediaPlayer.Open(new Uri(MainWindow.Settings.RandSettings.CustomTimerSoundPath));
}
else
{
// 播放默认铃声
string tempPath = System.IO.Path.GetTempFileName() + ".wav";
using (var stream = Properties.Resources.TimerDownNotice)
{
using (var fileStream = new System.IO.FileStream(tempPath, System.IO.FileMode.Create))
{
stream.CopyTo(fileStream);
}
}
mediaPlayer.Open(new Uri(tempPath));
}
mediaPlayer.Play();
}
catch (Exception ex)
{
// 如果播放失败,静默处理
System.Diagnostics.Debug.WriteLine($"播放计时器铃声失败: {ex.Message}");
}
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
isTimerRunning = false;
@@ -439,7 +344,7 @@ namespace Ink_Canvas
Close();
}
private bool _isInCompact;
private bool _isInCompact = false;
private void BtnMinimal_OnMouseUp(object sender, MouseButtonEventArgs e)
{
@@ -398,7 +398,7 @@ namespace Ink_Canvas.Windows
((Border)border).Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
}
private Border _sidebarItemMouseDownBorder;
private Border _sidebarItemMouseDownBorder = null;
private void SidebarItem_MouseDown(object sender, MouseButtonEventArgs e)
{
@@ -999,7 +999,7 @@ namespace Ink_Canvas.Windows
public Image ThumbImage { get; set; }
public Border TrackBorder { get; set; }
public Border ValueBorder { get; set; }
public bool IsTouchCaptured { get; set; }
public bool IsTouchCaptured { get; set; } = false;
}
#endregion