private void Application_Startup(object sender, StartupEventArgs e) { ShutdownMode = ShutdownMode.OnExplicitShutdown; //_mediaEvent.MediaWatcher += new MediaWatcherEventHandler(MeMediaWatcher); _mediaEvent.ContourUSBInserted += OnContourUSBInserted; // TODO Remove the logical device stuff _mediaEvent.Monitor("K:", _mediaEvent); //dbPath = GetUserDirectory() + @"\GLUCOFACTS Deluxe\logs\Barracuda.log"; // TODO rename //dbPath = @"C:\Bayer.db"; // NOTE: For debugging copy Bayer.db to the Debug output directory dbPath = Directory.GetCurrentDirectory(); dbFilename = "Bayer.db"; dbPathAndFilename = dbPath + @"\" + dbFilename; var dao = new DAO(); vm = new StickerViewModel(dao); //vm.NewSticker(); // Create system tray icon var tbi = new TaskbarIcon(); tbi.Icon = new Icon("DefaultTrayIcon.ico"); tbi.ToolTipText = "HealthKick!"; tbi.ContextMenu = new ContextMenu(); var mi = new MenuItem(); mi.Header = "Exit"; mi.Click += mi_Click; tbi.ContextMenu.Items.Add(mi); tbi.MenuActivation = PopupActivationMode.RightClick; // Timer for waiting after db accesses MyTimer = new Timer(); MyTimer.Elapsed += MyTimerElapsed; MyTimer.Interval = 2000; }
public void SetViewModel(ViewModel.StickerViewModel stickerViewModel) { _vm = stickerViewModel; }
public OKCommand(StickerViewModel vm) { this.vm = vm; }