private void InstanceUpdated(Notification notification) { NativeMenuItem item = this.MenuItemForInstance((VagrantInstance)notification.UserInfo["old_instance"]); item.Instance = (VagrantInstance)notification.UserInfo["new_instance"]; item.Refresh(); this.RebuildMenu(); }
private void InstanceRemoved(Notification notification) { NativeMenuItem item = this.MenuItemForInstance((VagrantInstance)notification.UserInfo["instance"]); _MenuItems.Remove(item); _Menu.Items.Remove(item.MenuItem); this.RebuildMenu(); }
public void NativeMenuItemDestroyAllMachines(NativeMenuItem menuItem) { DialogResult dialogResult = MessageBox.Show(String.Format("Are you sure you want to destroy {0}?", menuItem.Instance.Machines.Length > 1 ? "all machines in the group" : "this machine"), "Confirm Destructive Action", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { this.PerformAction("destroy", menuItem.Instance); } }
private void InstanceAdded(Notification notification) { NativeMenuItem item = new NativeMenuItem(); item.Delegate = this; _MenuItems.Add(item); item.Instance = (VagrantInstance)notification.UserInfo["instance"]; item.MenuItem = new ToolStripMenuItem(item.Instance.DisplayName); item.Refresh(); this.RebuildMenu(); }
public void NativeMenuItemUpdateProviderIdentifier(NativeMenuItem menuItem, string providerIdentifier) { Bookmark bookmark = BookmarkManager.Instance.GetBookmarkWithPath(menuItem.Instance.Path); if (bookmark != null) { bookmark.ProviderIdentifier = providerIdentifier; BookmarkManager.Instance.SaveBookmarks(); } menuItem.Instance.ProviderIdentifier = providerIdentifier; menuItem.Refresh(); }
public void NativeMenuItemDestroyAllMachines(NativeMenuItem menuItem) { DialogResult dialogResult = MessageBox.Show( String.Format("你确定你想要销毁 {0}: [{1}] ?", menuItem.Instance.Machines.Length > 1 ? "分组中的所有虚拟机" : "这台虚拟机", menuItem.Instance.DisplayName), "破坏操作提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3); if (dialogResult == DialogResult.Yes) { DialogResult dialogResult2 = MessageBox.Show("你十分确定你想要执行销毁操作?\n注意:此操作不可逆,请提前备份重要数据!", "毁灭性操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); if (dialogResult2 == DialogResult.Yes) { this.PerformAction("destroy", menuItem.Instance); } } }
public void NativeMenuItemSuspendAllMachines(NativeMenuItem menuItem) { this.PerformAction("suspend", menuItem.Instance); }
public void NativeMenuItemSSHInstance(NativeMenuItem menuItem) { this.PerformAction("ssh", menuItem.Instance); }
public void NativeMenuItemRsyncAutoInstance(NativeMenuItem menuItem) { this.PerformAction("rsync-auto", menuItem.Instance); }
public void NativeMenuItemHaltAllMachines(NativeMenuItem menuItem) { this.PerformAction("halt", menuItem.Instance); }
public void NativeMenuItemUpAllMachines(NativeMenuItem menuItem) { this.PerformAction("up", menuItem.Instance); }
public void NativeMenuItemRsyncAllMachines(NativeMenuItem menuItem) { this.PerformAction("rsync", menuItem.Instance); }
public void NativeMenuItemRemoveBookmark(NativeMenuItem menuItem) { Delegate.RemoveBookmarkWithInstance(menuItem.Instance); }
public void NativeMenuItemAddBookmark(NativeMenuItem menuItem) { Delegate.AddBookmarkWithInstance(menuItem.Instance); }
public void NativeMenuItemOpenTerminal(NativeMenuItem menuItem) { Delegate.OpenInstanceInTerminal(menuItem.Instance); }
public void NativeMenuItemOpenExplorer(NativeMenuItem menuItem) { Delegate.OpenInstanceInExplorer(menuItem.Instance); }
public void NativeMenuItemProvisionAllMachines(NativeMenuItem menuItem) { this.PerformAction("provision", menuItem.Instance); }
public void NativeMenuItemReloadAllMachines(NativeMenuItem menuItem) { this.PerformAction("reload", menuItem.Instance); }
public void NativeMenuItemRDPInstance(NativeMenuItem menuItem) { this.PerformAction("rdp", menuItem.Instance); }