예제 #1
0
 public Help()
 {
     InitializeComponent();
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     _db             = new AndroidToolkitDB();
     _textBlockStyle = (Style)Resources["TileTitle"];
 }
        public RecoveryMaster()
        {
            InitializeComponent();
            _db       = new AndroidToolkitDB();
            _fastboot = new FastbootOperations();
            BackgroundWorker loader = new BackgroundWorker();

            loader.DoWork += ((sender, args) =>
            {
                Load();
                //this.View.Dispatcher.BeginInvoke((Action)(() => Load()));
            });
            loader.RunWorkerCompleted += ((sender, args) =>
            {
                View.ItemsSource = _tempDevices;
                RunFlyout(0);
                RunFlyout(1);
            });
            RunFlyout(0);
            loader.RunWorkerAsync();

            View.SelectionChanged += ((sender, args) =>
            {
                FlashRecoveriesComboBox.Items.Clear();
                _device = (Device)View.SelectedItem;
                if (!string.IsNullOrEmpty(_device.CWMRecovery))
                {
                    FlashRecoveriesComboBox.Items.Add("CWM");
                }
                if (!string.IsNullOrEmpty(_device.CWMTouchRecovery))
                {
                    FlashRecoveriesComboBox.Items.Add("CWM Touch");
                }
                if (!string.IsNullOrEmpty(_device.TWRPRecovery))
                {
                    FlashRecoveriesComboBox.Items.Add("TWRP");
                }
            });

            LightThemeSwitch.Checked += delegate
            {
                ThemeManager.ChangeTheme(this, ThemeManager.DefaultAccents.First(a => a.Name == "Blue"), Theme.Light);
            };
            LightThemeSwitch.Unchecked += delegate
            {
                ThemeManager.ChangeTheme(this, ThemeManager.DefaultAccents.First(a => a.Name == "Blue"), Theme.Dark);
            };
        }
예제 #3
0
        public Admin()
        {
            InitializeComponent();
            _db            = new AndroidToolkitDB();
            _deviceManager = new DeviceManager();
            _adminManager  = new AdminManager();
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            DevicesGrid.CanUserAddRows    = false;
            DevicesGrid.CanUserDeleteRows = false;
            AdminsGrid.CanUserAddRows     = false;
            AdminsGrid.CanUserDeleteRows  = false;
            SQLBtn.Click += ((sender, args) =>
            {
                var flyout = (Flyout)Flyouts.Items[9];
                flyout.IsOpen = !flyout.IsOpen;
            });

            ExecuteSQLBtn.Click += ((sender, args) =>
            {
                string cmd = SQLCMD.Text;
                if (cmd.Length != 0)
                {
                    BackgroundWorker executer = new BackgroundWorker();

                    executer.DoWork += (async(sender1, args1) =>
                    {
                        try
                        {
                            await _db.Database.ExecuteSqlCommandAsync(cmd);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString(), "ERROR");
                        }
                    });

                    executer.RunWorkerAsync();
                }
            });
        }