Exemple #1
0
 private void OnCreateShortcutClick(BootEntry entry)
 {
     if (CreateShortcutClick != null)
     {
         CreateShortcutClick(this, new BootEntryEventArgs(entry));
     }
 }
Exemple #2
0
 private void OnNextBootClick(BootEntry entry)
 {
     if (BootNextClick != null)
     {
         BootNextClick(this, new BootEntryEventArgs(entry));
     }
 }
Exemple #3
0
 private void OnRebootClick(BootEntry entry)
 {
     if (RebootClick != null)
     {
         RebootClick(this, new BootEntryEventArgs(entry));
     }
 }
Exemple #4
0
 public void MarkAsNext(BootEntry nextEntry)
 {
     foreach (BootEntry entry in Items)
     {
         entry.IsBootNext = false;
     }
     nextEntry.IsBootNext = true;
 }
Exemple #5
0
 public static void DoReboot(BootEntry entry, bool confirmation = true)
 {
     if (confirmation) {
         string message = string.Format("Are you sure want to reboot to {0} right now?", entry.Name);
         if (MessageBoxResult.Yes != MessageBox.Show(message, "Reboot confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No)) {
             return;
         }
     }
     EFIEnvironment.SetBootNext(entry);
     if (!NativeMethods.ExitWindowsEx(ExitWindows.Reboot,
             ShutdownReason.MajorApplication |
     ShutdownReason.MinorInstallation |
     ShutdownReason.FlagPlanned)) {
         MessageBox.Show("Unable to reboot your computer", "Reboot failure", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of <see cref="BootEntryEventArgs"/> for specified <see cref="BootEntry"/>.
 /// </summary>
 /// <param name="BootEntry">BootEntry</param>
 public BootEntryEventArgs(BootEntry BootEntry)
 {
     this.BootEntry = BootEntry;
 }
 public static bool SetBootNext(BootEntry entry)
 {
     return SetBootNext(entry.Id);
 }