Example #1
0
        private void DebugToolstripItem_Click(object sender, RoutedEventArgs e)
        {
            if (settings.AdvancedMode)
            {
                var parent = Application.Current.MainWindow;
                if (parent != null)
                {
                    var debugWnd = new DebugDialog(cpu, modules, MEMCFG, BMC, AsusWmi)
                    {
                        Owner = parent, Width = parent.Width, Height = parent.Height
                    };
                    debugWnd.ShowDialog();
                }
            }
            else
            {
                var messageBox = new MessageBoxModel
                {
                    Text = "Debug functionality requires Advanced Mode.\n\n" +
                           "Do you want to enable it now (the application will restart automatically)?",
                    Caption = "Debug Report",
                    Buttons = MessageBoxButtons.YesNoCancel()
                };

                MessageBox.Show(messageBox);

                if (messageBox.Result == MessageBoxResult.Yes)
                {
                    settings.AdvancedMode = true;
                    Restart();
                }
            }
        }