private void btnAdmin_Click(object sender, RoutedEventArgs e) { DlgPassword cDlg = new DlgPassword(); // We temporarily allow Keyboard input. // // NOTE: This WILL enable the Win-Key in the Password // Box. At the moment, this is intentional to give // a way to close the Player when someone forgot the // password. To avoid this, the windows key must be trapped // individually from the captureKey() function ServiceWinInterop.disableHook(); if (cDlg.ShowDialog() == true) { if (ServiceSettings.checkPassword(cDlg.resultPassword) == true) { // A correct password was entered! WndAdmin cAdmin = new WndAdmin(); cAdmin.ShowDialog(); } else { MessageBox.Show("Wrong Password", "Password", MessageBoxButton.OK); } } ServiceWinInterop.enableHook(); refreshApp(); }
private void btnOpenSource_Click(object sender, RoutedEventArgs e) { sourceFile = ServiceWinInterop.openDialogSourceFile(); if (string.IsNullOrWhiteSpace(sourceFile)) { lblSourceFile.Content = "No File Selected"; sourceFile = null; } else { lblSourceFile.Content = sourceFile; } }
private void btnOpenIcon_Click(object sender, RoutedEventArgs e) { iconFile = ServiceWinInterop.openDialogImageFile(); if (string.IsNullOrWhiteSpace(iconFile)) { lblIconFile.Content = "No File Selected"; iconFile = null; } else { lblIconFile.Content = iconFile; } }
public WndMain() { // Disable all special keys to prevent the Window from being closed / hidden. // While it won't work 100%, it probably is the only alternative // to writing a custom shell // // NOTE 1: We ignore the on-screen keyboard for now // NOTE 2: Does not work with Multiple Screens ServiceWinInterop.disableSpecialKeys(); // Load the Settings from settings.xml ServiceSettings.loadSettings(); InitializeComponent(); dataContext = new WndMainViewModel(); this.DataContext = dataContext; refreshApp(); }
private void btnOpenBackground_Click(object sender, RoutedEventArgs e) { dataContext.BackgroundImage = ServiceWinInterop.openDialogImageFile(); }