diff --git a/XenAdmin/Commands/RevertToSnapshotCommand.cs b/XenAdmin/Commands/RevertToSnapshotCommand.cs index 27b37cfc4..7d7ff9e55 100644 --- a/XenAdmin/Commands/RevertToSnapshotCommand.cs +++ b/XenAdmin/Commands/RevertToSnapshotCommand.cs @@ -87,7 +87,7 @@ namespace XenAdmin.Commands VM vm = (VM)selection[0].XenObject; var snapshotAllowed = vm.allowed_operations.Contains(vm_operations.snapshot); - Program.MainWindow.ConsolePanel.setCurrentSource(vm); + Program.MainWindow.ConsolePanel.SetCurrentSource(vm); using (var dialog = new WarningDialog(string.Format(Messages.SNAPSHOT_REVERT_BLURB, _snapshot.Name()), ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo) diff --git a/XenAdmin/Commands/TakeSnapshotCommand.cs b/XenAdmin/Commands/TakeSnapshotCommand.cs index a6f5b7de8..8afdd2aec 100644 --- a/XenAdmin/Commands/TakeSnapshotCommand.cs +++ b/XenAdmin/Commands/TakeSnapshotCommand.cs @@ -84,7 +84,7 @@ namespace XenAdmin.Commands { if (dialog.ShowDialog(Parent) != DialogResult.Cancel && dialog.SnapshotName != null) { - Program.Invoke(Program.MainWindow, () => Program.MainWindow.ConsolePanel.setCurrentSource(vm)); + Program.Invoke(Program.MainWindow, () => Program.MainWindow.ConsolePanel.SetCurrentSource(vm)); return new VMSnapshotCreateAction(vm, dialog.SnapshotName, dialog.SnapshotDescription, dialog.SnapshotType, (vmToSnapshot, username, password) => Program.MainWindow.ConsolePanel.Snapshot( diff --git a/XenAdmin/Controls/ConsolePanel.cs b/XenAdmin/Controls/ConsolePanel.cs index cf3ea7323..e0b5059fc 100644 --- a/XenAdmin/Controls/ConsolePanel.cs +++ b/XenAdmin/Controls/ConsolePanel.cs @@ -107,7 +107,7 @@ namespace XenAdmin.Controls activeVNCView.UpdateRDPResolution(fullscreen); } - internal void setCurrentSource(VM source) + internal void SetCurrentSource(VM source) { Program.AssertOnEventThread(); @@ -145,7 +145,7 @@ namespace XenAdmin.Controls var viewsToRemove = vncViews.Where(v => v.Key.opaque_ref != source.opaque_ref).Take(vncViews.Count - 1 - MAX_ACTIVE_VM_CONSOLES).ToList(); foreach (var view in viewsToRemove) - closeVNCForSource(view.Key); + CloseVncForSource(view.Key); if (vncViews.ContainsKey(source)) { @@ -162,7 +162,7 @@ namespace XenAdmin.Controls ClearErrorMessage(); } - internal virtual void setCurrentSource(Host source) + internal virtual void SetCurrentSource(Host source) { if (source == null) { @@ -178,7 +178,7 @@ namespace XenAdmin.Controls SetErrorMessage(Messages.VNC_COULD_NOT_FIND_CONSOLES); } else - setCurrentSource(dom0); + SetCurrentSource(dom0); } public static bool RbacDenied(VM source, out List allowedRoles) @@ -221,7 +221,7 @@ namespace XenAdmin.Controls view = new VNCView(vm, elevatedUsername, elevatedPassword) { Dock = DockStyle.Fill }; else { - setCurrentSource(vm); + SetCurrentSource(vm); if (vncViews.ContainsKey(vm)) view = vncViews[vm]; } @@ -249,7 +249,7 @@ namespace XenAdmin.Controls return snapshot; } - public void closeVNCForSource(VM source) + public void CloseVncForSource(VM source) { Program.AssertOnEventThread(); @@ -265,19 +265,19 @@ namespace XenAdmin.Controls vncView.Dispose(); } - public void closeVNCForSource(VM source, bool vncOnly) + public void CloseVncForSource(VM source, bool vncOnly) { if (!vncViews.ContainsKey(source) || vncViews[source] == null || (vncOnly && !vncViews[source].IsVNC)) return; - closeVNCForSource(source); + CloseVncForSource(source); } protected void SetErrorMessage(string message) { errorLabel.Text = message; tableLayoutPanelError.Visible = true; - setCurrentSource((VM)null); + SetCurrentSource((VM)null); } private void ClearErrorMessage() @@ -331,7 +331,7 @@ namespace XenAdmin.Controls try { log.DebugFormat("ConsolePanel: closeVNCForSource({0}) in delegate", vm.Name()); - closeVNCForSource(vm, true); + CloseVncForSource(vm, true); } catch (Exception exception) { @@ -368,7 +368,7 @@ namespace XenAdmin.Controls internal class CvmConsolePanel : ConsolePanel { - internal override void setCurrentSource(Host source) + internal override void SetCurrentSource(Host source) { if (source == null) { @@ -384,7 +384,7 @@ namespace XenAdmin.Controls SetErrorMessage(Messages.VNC_COULD_NOT_FIND_CONSOLES); } else - setCurrentSource(cvm); + SetCurrentSource(cvm); } public override string HelpID => "TabPageCvmConsole"; diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 105f0b1a9..18f2fca3f 100755 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -290,9 +290,9 @@ namespace XenAdmin ConsolePanel.ResetAllViews(); if (SelectionManager.Selection.FirstIsRealVM) - ConsolePanel.setCurrentSource((VM)SelectionManager.Selection.First); + ConsolePanel.SetCurrentSource((VM)SelectionManager.Selection.First); else if (SelectionManager.Selection.FirstIs()) - ConsolePanel.setCurrentSource((Host)SelectionManager.Selection.First); + ConsolePanel.SetCurrentSource((Host)SelectionManager.Selection.First); UnpauseVNC(sender == TheTabControl); } @@ -861,15 +861,15 @@ namespace XenAdmin foreach (VM vm in con.Cache.VMs) { - ConsolePanel.closeVNCForSource(vm); + ConsolePanel.CloseVncForSource(vm); } foreach (Host host in con.Cache.Hosts) { - ConsolePanel.closeVNCForSource(host.ControlDomainZero()); + ConsolePanel.CloseVncForSource(host.ControlDomainZero()); foreach (VM vm in host.OtherControlDomains()) - CvmConsolePanel.closeVNCForSource(vm); + CvmConsolePanel.CloseVncForSource(vm); } con.EndConnect(); @@ -1185,7 +1185,7 @@ namespace XenAdmin if (o is VM) { VM vm = (VM)e.Element; - ConsolePanel.closeVNCForSource(vm); + ConsolePanel.CloseVncForSource(vm); XenDialogBase.CloseAll(vm); } @@ -1908,12 +1908,12 @@ namespace XenAdmin { if (SelectionManager.Selection.FirstIsRealVM) { - ConsolePanel.setCurrentSource((VM)SelectionManager.Selection.First); + ConsolePanel.SetCurrentSource((VM)SelectionManager.Selection.First); UnpauseVNC(e != null && sender == TheTabControl); } else if (SelectionManager.Selection.FirstIs()) { - ConsolePanel.setCurrentSource((Host)SelectionManager.Selection.First); + ConsolePanel.SetCurrentSource((Host)SelectionManager.Selection.First); UnpauseVNC(e != null && sender == TheTabControl); } ConsolePanel.UpdateRDPResolution(); @@ -1922,7 +1922,7 @@ namespace XenAdmin { if (SelectionManager.Selection.First is SR sr && sr.HasDriverDomain(out var vm)) { - CvmConsolePanel.setCurrentSource(vm); + CvmConsolePanel.SetCurrentSource(vm); UnpauseVNC(e != null && sender == TheTabControl); } }