public MainWindow()
 {
     InitializeComponent();
     ViewModel                      = new MainViewModel(EFIEnvironment.GetEntries());
     ViewModel.RebootClick         += OnRebootClick;
     ViewModel.BootNextClick       += OnBootNextClick;
     ViewModel.CreateShortcutClick += OnCreateShortcut;
     BootEntries.DataContext        = ViewModel;
     this.Loaded                   += OnLoaded;
 }
Exemple #2
0
 private bool ProcessCommandLine()
 {
     string[] args = Environment.GetCommandLineArgs();
     if (args.Length > 1)
     {
         ushort entryId = 0;
         if (ushort.TryParse(args[1], out entryId))
         {
             BootEntry entry = EFIEnvironment.GetEntries().FirstOrDefault(e => e.Id == entryId);
             if (entry != null)
             {
                 DoReboot(entry, !args.Contains("quiet"));
                 return(true);
             }
         }
     }
     return(false);
 }