/// <summary> /// System.Windows.Application.Startup イベント を発生させます。 /// </summary> /// <param name="e">イベントデータ を格納している StartupEventArgs</param> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); this.ShutdownMode = ShutdownMode.OnExplicitShutdown; this.notifyIcon = new NotifyIconWrapper(); classNotifyIcon.notifyIcon = this.notifyIcon; this.clipBoardWatcher = new ClipBoardWatcher(); }
// クリップボード監視機能の初期化 void InitCopyWatcher(object sender, EventArgs e) { cbw = new ClipBoardWatcher(); cbw.DrawClipBoard += (sender2, e2) => { if (Clipboard.ContainsText()) { if (latestCopy != Clipboard.GetText()) { latestCopy = Clipboard.GetText(); listBox1.Items.Add(latestCopy); } } }; }