/// <summary> /// 创建并初始化一个实例 /// </summary> public Notification() { TrayIcon = new TrayIcon(); TrayIcon.NotifyIcon.ContextMenu = TrayIconHelper.GetExitContextMenu(); Toast = new Toast(); }
protected override void ExecuteAction() { base.ExecuteAction(); var input = string.Empty; switch (InputMode) { case InputMode.Clipboard: input = Clipboard.GetText(); break; case InputMode.File: input = File.ReadAllText(FilePath.Path); break; case InputMode.Text: input = Text; break; } TrayIconHelper.ShowBalloon(input, Image); }