namespace Notify.Models; /// /// 水平方向:决定 toast 贴左/居中/贴右 /// public enum HEdge { Left, Center, Right, } /// /// 垂直方向:决定 toast 贴上/居中/贴下,并决定堆叠方向 /// public enum VEdge { Top, Center, Bottom, } /// /// 持久化的弹窗设置(纯数据模型,序列化到磁盘) /// public sealed class ToastSettings { /// /// 自动消失前的停留秒数 /// public int DurationSeconds { get; set; } = 4; /// /// 目标窗口已在前台时的停留秒数(你正盯着看,弹一下即可) /// public int FocusedDurationSeconds { get; set; } = 2; /// /// 水平方向 /// public HEdge Horizontal { get; set; } = HEdge.Right; /// /// 垂直方向 /// public VEdge Vertical { get; set; } = VEdge.Bottom; /// /// 与屏幕边缘的留白(DIP) /// public int Margin { get; set; } = 12; /// /// 不透明度 0–1 /// public double Opacity { get; set; } = 0.96; /// /// 最多同时可见的 toast 数量,超出则排队 /// public int MaxVisible { get; set; } = 5; /// /// 是否播放提示音 /// public bool PlaySound { get; set; } = true; /// /// toast 宽度(DIP) /// public double Width { get; set; } = 340; /// /// 淡入/淡出时长(毫秒) /// public int FadeMilliseconds { get; set; } = 300; /// /// 跨所有虚拟桌面显示(未公开 API,失败自动退回单桌面) /// public bool ShowOnAllDesktops { get; set; } = true; public ToastSettings Clone() => (ToastSettings)MemberwiseClone(); }