示例#1
0
 public MainWindow()
 {
     InitializeComponent();
     usb_connection    = new HID_Connection();
     DataContext       = this;
     superuserAccess   = false;
     greenBrush        = new SolidColorBrush();
     orangeBrush       = new SolidColorBrush();
     redBrush          = new SolidColorBrush();
     grayBrush         = new SolidColorBrush();
     greenBrush.Color  = Color.FromRgb(50, 200, 0);
     orangeBrush.Color = Color.FromRgb(255, 165, 0);
     redBrush.Color    = Color.FromRgb(255, 0, 0);
     grayBrush.Color   = Color.FromRgb(128, 128, 128);
     if (OutputBox != null)
     {
         outputAdapter = new BSLRichTextBoxOutputBridge(OutputBox);
     }
     passwordWindow = null;
     PasswordBoxCommand.InputGestures.Add(new KeyGesture(Key.W, ModifierKeys.Control));
     PasswordCommand.Command = PasswordBoxCommand;
     RefreshButtonEnabled    = true;
     ReadProgress.Maximum    = Registers.adc_registers.Length + Registers.dac_registers.Length + Registers.sel_registers.Length;
     BaseMode = HEX_MODE; //Hex Mode
     OnPropertyChanged("RefreshButtonEnabled");
     OnPropertyChanged("RefreshButtonVisibility");
 }
示例#2
0
 private void PasswordCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     if (!connectionStatus)
     {
         return;
     }
     if (superuserAccess)
     {
         superuserAccess = false;
         OnPropertyChanged("SuperuserAccess");
     }
     passwordWindow = new SuperuserMode(this);
     passwordWindow.ShowDialog();
 }