示例#1
0
        private void MenuSettings_Click(object sender, RoutedEventArgs e)
        {
            PassWindow pw = new PassWindow();

            if (pw.ShowDialog() == true)
            {
                player.SetRoot(pw.passwordBox.Password);
            }
        }
示例#2
0
        /// <summary>
        ///     Защита паролем
        /// </summary>
        private static void PassProtect()
        {
            if (Settings.Default.isPassProtect)
            {
                var pw = new PassWindow();
                pw.btnCansel.Click += (o, args) => { Current.Shutdown(); };
                pw.btnOk.Click     += (o, args) =>
                {
                    if (pw.passBox.Text == Settings.Default.Pass)
                    {
                        pw.Close();
                    }
                    else
                    {
                        Current.Shutdown();
                    }
                };

                pw.ShowDialog();
            }
        }