예제 #1
0
        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();
        }
예제 #2
0
        private void InstanceRemoved(Notification notification)
        {
            NativeMenuItem item = this.MenuItemForInstance((VagrantInstance)notification.UserInfo["instance"]);

            _MenuItems.Remove(item);
            _Menu.Items.Remove(item.MenuItem);
            this.RebuildMenu();
        }
예제 #3
0
        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();
        }
예제 #5
0
        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();
        }
예제 #6
0
        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);
                }
            }
        }
예제 #7
0
 public void NativeMenuItemSuspendAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("suspend", menuItem.Instance);
 }
예제 #8
0
 public void NativeMenuItemSSHInstance(NativeMenuItem menuItem)
 {
     this.PerformAction("ssh", menuItem.Instance);
 }
예제 #9
0
 public void NativeMenuItemRsyncAutoInstance(NativeMenuItem menuItem)
 {
     this.PerformAction("rsync-auto", menuItem.Instance);
 }
예제 #10
0
 public void NativeMenuItemHaltAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("halt", menuItem.Instance);
 }
예제 #11
0
 public void NativeMenuItemUpAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("up", menuItem.Instance);
 }
예제 #12
0
 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();
 }
예제 #13
0
 public void NativeMenuItemRsyncAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("rsync", menuItem.Instance);
 }
예제 #14
0
 public void NativeMenuItemRemoveBookmark(NativeMenuItem menuItem)
 {
     Delegate.RemoveBookmarkWithInstance(menuItem.Instance);
 }
예제 #15
0
 public void NativeMenuItemAddBookmark(NativeMenuItem menuItem)
 {
     Delegate.AddBookmarkWithInstance(menuItem.Instance);
 }
예제 #16
0
 public void NativeMenuItemOpenTerminal(NativeMenuItem menuItem)
 {
     Delegate.OpenInstanceInTerminal(menuItem.Instance);
 }
예제 #17
0
        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();
        }
예제 #18
0
 public void NativeMenuItemOpenExplorer(NativeMenuItem menuItem)
 {
     Delegate.OpenInstanceInExplorer(menuItem.Instance);
 }
예제 #19
0
 public void NativeMenuItemProvisionAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("provision", menuItem.Instance);
 }
예제 #20
0
 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);
     }
 }
예제 #21
0
 public void NativeMenuItemReloadAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("reload", menuItem.Instance);
 }
예제 #22
0
 public void NativeMenuItemRemoveBookmark(NativeMenuItem menuItem)
 {
     Delegate.RemoveBookmarkWithInstance(menuItem.Instance);
 }
예제 #23
0
 public void NativeMenuItemHaltAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("halt", menuItem.Instance);
 }
예제 #24
0
 public void NativeMenuItemOpenTerminal(NativeMenuItem menuItem)
 {
     Delegate.OpenInstanceInTerminal(menuItem.Instance);
 }
예제 #25
0
 public void NativeMenuItemProvisionAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("provision", menuItem.Instance);
 }
예제 #26
0
 public void NativeMenuItemSuspendAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("suspend", menuItem.Instance);
 }
예제 #27
0
 public void NativeMenuItemOpenExplorer(NativeMenuItem menuItem)
 {
     Delegate.OpenInstanceInExplorer(menuItem.Instance);
 }
예제 #28
0
 public void NativeMenuItemReloadAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("reload", menuItem.Instance);
 }
예제 #29
0
 public void NativeMenuItemUpAllMachines(NativeMenuItem menuItem)
 {
     this.PerformAction("up", menuItem.Instance);
 }
예제 #30
0
 public void NativeMenuItemSSHInstance(NativeMenuItem menuItem)
 {
     this.PerformAction("ssh", menuItem.Instance);
 }
예제 #31
0
 public void NativeMenuItemAddBookmark(NativeMenuItem menuItem)
 {
     Delegate.AddBookmarkWithInstance(menuItem.Instance);
 }
예제 #32
0
 public void NativeMenuItemRDPInstance(NativeMenuItem menuItem)
 {
     this.PerformAction("rdp", menuItem.Instance);
 }