From 6273856761d42c9f443f2559a52d927c0b1a1fff Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 2 Apr 2019 14:12:25 +0100 Subject: [PATCH] Prevent VisualStudio's designer from crashing when opening the MainWindow. Made command parameterless constructors public; made browsable events public; replaced manually written with auto-generated code. Signed-off-by: Konstantina Chremmou --- .../Commands/DisablePvsReadCachingCommand.cs | 2 +- .../Commands/EnablePvsReadCachingCommand.cs | 10 +- .../NavigationPane.Designer.cs | 1 + .../MainWindowControls/NavigationPane.cs | 4 +- .../MainWindowControls/NavigationView.cs | 3 +- XenAdmin/MainWindow.Designer.cs | 82 +++++++------- XenAdmin/MainWindow.resx | 106 +++++++++--------- 7 files changed, 101 insertions(+), 107 deletions(-) diff --git a/XenAdmin/Commands/DisablePvsReadCachingCommand.cs b/XenAdmin/Commands/DisablePvsReadCachingCommand.cs index 99ba5220c..ca1863d2b 100644 --- a/XenAdmin/Commands/DisablePvsReadCachingCommand.cs +++ b/XenAdmin/Commands/DisablePvsReadCachingCommand.cs @@ -46,7 +46,7 @@ namespace XenAdmin.Commands /// Initializes a new instance of this Command. The parameter-less constructor is required if /// this Command is to be attached to a ToolStrip menu item or button. It should not be used in any other scenario. /// - internal DisablePvsReadCachingCommand() + public DisablePvsReadCachingCommand() { } diff --git a/XenAdmin/Commands/EnablePvsReadCachingCommand.cs b/XenAdmin/Commands/EnablePvsReadCachingCommand.cs index 7bfcdbe96..b56599d2d 100644 --- a/XenAdmin/Commands/EnablePvsReadCachingCommand.cs +++ b/XenAdmin/Commands/EnablePvsReadCachingCommand.cs @@ -29,17 +29,11 @@ * SUCH DAMAGE. */ -using System; using System.Collections.Generic; -using System.Text; using XenAPI; using XenAdmin.Dialogs; -using XenAdmin.Network; -using XenAdmin.Properties; -using System.Drawing; -using System.Collections.ObjectModel; using System.Linq; -using XenAdmin.Model; + namespace XenAdmin.Commands @@ -53,7 +47,7 @@ namespace XenAdmin.Commands /// Initializes a new instance of this Command. The parameter-less constructor is required if /// this Command is to be attached to a ToolStrip menu item or button. It should not be used in any other scenario. /// - internal EnablePvsReadCachingCommand() + public EnablePvsReadCachingCommand() { } diff --git a/XenAdmin/Controls/MainWindowControls/NavigationPane.Designer.cs b/XenAdmin/Controls/MainWindowControls/NavigationPane.Designer.cs index 806d5e6a6..92fc3a102 100644 --- a/XenAdmin/Controls/MainWindowControls/NavigationPane.Designer.cs +++ b/XenAdmin/Controls/MainWindowControls/NavigationPane.Designer.cs @@ -74,6 +74,7 @@ // resources.ApplyResources(this.navigationView, "navigationView"); this.navigationView.Name = "navigationView"; + this.navigationView.DragDropCommandActivated += new System.Action(this.navigationView_DragDropCommandActivated); this.navigationView.TreeViewSelectionChanged += new System.Action(this.navigationView_TreeViewSelectionChanged); this.navigationView.TreeNodeBeforeSelected += new System.Action(this.navigationView_TreeNodeBeforeSelected); this.navigationView.TreeNodeClicked += new System.Action(this.navigationView_TreeNodeClicked); diff --git a/XenAdmin/Controls/MainWindowControls/NavigationPane.cs b/XenAdmin/Controls/MainWindowControls/NavigationPane.cs index 0e793f744..105ff373e 100644 --- a/XenAdmin/Controls/MainWindowControls/NavigationPane.cs +++ b/XenAdmin/Controls/MainWindowControls/NavigationPane.cs @@ -83,7 +83,7 @@ namespace XenAdmin.Controls.MainWindowControls public event Action TreeViewRefreshResumed; [Browsable(true)] - internal event Action DragDropCommandActivated; + public event Action DragDropCommandActivated; #endregion @@ -91,8 +91,6 @@ namespace XenAdmin.Controls.MainWindowControls { InitializeComponent(); - navigationView.DragDropCommandActivated += navigationView_DragDropCommandActivated; - AddNavigationItemPair(buttonInfraBig, buttonInfraSmall); AddNavigationItemPair(buttonObjectsBig, buttonObjectsSmall); AddNavigationItemPair(buttonOrganizationBig, buttonOrganizationSmall); diff --git a/XenAdmin/Controls/MainWindowControls/NavigationView.cs b/XenAdmin/Controls/MainWindowControls/NavigationView.cs index 0585239a8..66229fdbb 100644 --- a/XenAdmin/Controls/MainWindowControls/NavigationView.cs +++ b/XenAdmin/Controls/MainWindowControls/NavigationView.cs @@ -88,7 +88,8 @@ namespace XenAdmin.Controls.MainWindowControls [Browsable(true)] public event Action TreeViewRefreshResumed; - internal event Action DragDropCommandActivated; + [Browsable(true)] + public event Action DragDropCommandActivated; #endregion diff --git a/XenAdmin/MainWindow.Designer.cs b/XenAdmin/MainWindow.Designer.cs index a2957bdc4..42f794163 100644 --- a/XenAdmin/MainWindow.Designer.cs +++ b/XenAdmin/MainWindow.Designer.cs @@ -79,6 +79,7 @@ namespace XenAdmin this.TabPageSearch = new System.Windows.Forms.TabPage(); this.TabPageDockerProcess = new System.Windows.Forms.TabPage(); this.TabPageDockerDetails = new System.Windows.Forms.TabPage(); + this.TabPageUSB = new System.Windows.Forms.TabPage(); this.alertPage = new XenAdmin.TabPages.AlertSummaryPage(); this.updatesPage = new XenAdmin.TabPages.ManageUpdatesPage(); this.eventsPage = new XenAdmin.TabPages.HistoryPage(); @@ -204,6 +205,7 @@ namespace XenAdmin this.snapshotToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.convertToTemplateToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.exportToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); + this.disableCbtToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.enablePVSReadcachingToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.disablePVSReadcachingToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); @@ -275,8 +277,6 @@ namespace XenAdmin this.StatusStrip = new System.Windows.Forms.StatusStrip(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar(); - this.TabPageUSB = new System.Windows.Forms.TabPage(); - this.disableCbtToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -323,45 +323,44 @@ namespace XenAdmin this.navigationPane.Name = "navigationPane"; this.navigationPane.NavigationModeChanged += new System.Action(this.navigationPane_NavigationModeChanged); this.navigationPane.NotificationsSubModeChanged += new System.Action(this.navigationPane_NotificationsSubModeChanged); - this.navigationPane.DragDropCommandActivated += new System.Action(this.navigationPane_DragDropCommandActivated); this.navigationPane.TreeViewSelectionChanged += new System.Action(this.navigationPane_TreeViewSelectionChanged); this.navigationPane.TreeNodeBeforeSelected += new System.Action(this.navigationPane_TreeNodeBeforeSelected); this.navigationPane.TreeNodeClicked += new System.Action(this.navigationPane_TreeNodeClicked); this.navigationPane.TreeNodeRightClicked += new System.Action(this.navigationPane_TreeNodeRightClicked); this.navigationPane.TreeViewRefreshed += new System.Action(this.navigationPane_TreeViewRefreshed); + this.navigationPane.DragDropCommandActivated += new System.Action(this.navigationPane_DragDropCommandActivated); // // TheTabControl // resources.ApplyResources(this.TheTabControl, "TheTabControl"); - this.TheTabControl.Controls.AddRange(new System.Windows.Forms.TabPage [] { - this.TabPageHome, - this.TabPageGeneral, - this.TabPageBallooning, - this.TabPageConsole, - this.TabPageCvmConsole, - this.TabPageStorage, - this.TabPagePhysicalStorage, - this.TabPageSR, - this.TabPageNetwork, - this.TabPageNICs, - this.TabPagePeformance, - this.TabPageHA, - this.TabPageHAUpsell, - this.TabPageSnapshots, - this.TabPageWLB, - this.TabPageWLBUpsell, - this.TabPageAD, - this.TabPageADUpsell, - this.TabPageGPU, - this.TabPagePvs, - this.TabPageSearch, - this.TabPageDockerProcess, - this.TabPageDockerDetails, - this.TabPageUSB}); + this.TheTabControl.Controls.Add(this.TabPageHome); + this.TheTabControl.Controls.Add(this.TabPageGeneral); + this.TheTabControl.Controls.Add(this.TabPageBallooning); + this.TheTabControl.Controls.Add(this.TabPageConsole); + this.TheTabControl.Controls.Add(this.TabPageCvmConsole); + this.TheTabControl.Controls.Add(this.TabPageStorage); + this.TheTabControl.Controls.Add(this.TabPagePhysicalStorage); + this.TheTabControl.Controls.Add(this.TabPageSR); + this.TheTabControl.Controls.Add(this.TabPageNetwork); + this.TheTabControl.Controls.Add(this.TabPageNICs); + this.TheTabControl.Controls.Add(this.TabPagePeformance); + this.TheTabControl.Controls.Add(this.TabPageHA); + this.TheTabControl.Controls.Add(this.TabPageHAUpsell); + this.TheTabControl.Controls.Add(this.TabPageSnapshots); + this.TheTabControl.Controls.Add(this.TabPageWLB); + this.TheTabControl.Controls.Add(this.TabPageWLBUpsell); + this.TheTabControl.Controls.Add(this.TabPageAD); + this.TheTabControl.Controls.Add(this.TabPageADUpsell); + this.TheTabControl.Controls.Add(this.TabPageGPU); + this.TheTabControl.Controls.Add(this.TabPagePvs); + this.TheTabControl.Controls.Add(this.TabPageSearch); + this.TheTabControl.Controls.Add(this.TabPageDockerProcess); + this.TheTabControl.Controls.Add(this.TabPageDockerDetails); + this.TheTabControl.Controls.Add(this.TabPageUSB); this.TheTabControl.Name = "TheTabControl"; this.TheTabControl.SelectedIndex = 4; - this.TheTabControl.Deselected += new System.Windows.Forms.TabControlEventHandler(this.TheTabControl_Deselected); this.TheTabControl.SelectedIndexChanged += new System.EventHandler(this.TheTabControl_SelectedIndexChanged); + this.TheTabControl.Deselected += new System.Windows.Forms.TabControlEventHandler(this.TheTabControl_Deselected); // // TabPageHome // @@ -508,6 +507,12 @@ namespace XenAdmin this.TabPageDockerDetails.Name = "TabPageDockerDetails"; this.TabPageDockerDetails.UseVisualStyleBackColor = true; // + // TabPageUSB + // + resources.ApplyResources(this.TabPageUSB, "TabPageUSB"); + this.TabPageUSB.Name = "TabPageUSB"; + this.TabPageUSB.UseVisualStyleBackColor = true; + // // alertPage // resources.ApplyResources(this.alertPage, "alertPage"); @@ -1394,6 +1399,12 @@ namespace XenAdmin this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem"); // + // disableCbtToolStripMenuItem + // + this.disableCbtToolStripMenuItem.Command = new XenAdmin.Commands.DisableChangedBlockTrackingCommand(); + this.disableCbtToolStripMenuItem.Name = "disableCbtToolStripMenuItem"; + resources.ApplyResources(this.disableCbtToolStripMenuItem, "disableCbtToolStripMenuItem"); + // // enablePVSReadcachingToolStripMenuItem // this.enablePVSReadcachingToolStripMenuItem.Command = new XenAdmin.Commands.EnablePvsReadCachingCommand(); @@ -1875,17 +1886,6 @@ namespace XenAdmin this.statusProgressBar.Name = "statusProgressBar"; this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; // - // TabPageUSB - // - resources.ApplyResources(this.TabPageUSB, "TabPageUSB"); - this.TabPageUSB.Name = "TabPageUSB"; - this.TabPageUSB.UseVisualStyleBackColor = true; - // disableCbtToolStripMenuItem - // - this.disableCbtToolStripMenuItem.Command = new XenAdmin.Commands.DisableChangedBlockTrackingCommand(); - this.disableCbtToolStripMenuItem.Name = "disableCbtToolStripMenuItem"; - resources.ApplyResources(this.disableCbtToolStripMenuItem, "disableCbtToolStripMenuItem"); - // // MainWindow // resources.ApplyResources(this, "$this"); @@ -1945,7 +1945,6 @@ namespace XenAdmin private System.Windows.Forms.ToolStripSeparator toolStripSeparator12; private System.Windows.Forms.Label TitleLabel; private System.Windows.Forms.PictureBox TitleIcon; - private XenAdmin.Controls.GradientPanel.GradientPanel TitleBackPanel; private System.Windows.Forms.ToolStripSeparator toolStripSeparator17; internal System.Windows.Forms.ToolStripSplitButton backButton; internal System.Windows.Forms.ToolStripSplitButton forwardButton; @@ -2155,6 +2154,7 @@ namespace XenAdmin private System.Windows.Forms.TabPage TabPageUSB; private XenAdmin.Commands.CommandToolStripMenuItem disableCbtToolStripMenuItem; private System.Windows.Forms.Label LicenseStatusTitleLabel; + private Controls.GradientPanel.VerticalGradientPanel TitleBackPanel; } } diff --git a/XenAdmin/MainWindow.resx b/XenAdmin/MainWindow.resx index 620d16cf9..dcf1bf590 100644 --- a/XenAdmin/MainWindow.resx +++ b/XenAdmin/MainWindow.resx @@ -292,7 +292,7 @@ TheTabControl - 4 + 3 4, 22 @@ -316,7 +316,7 @@ TheTabControl - 5 + 4 Fill @@ -349,7 +349,7 @@ TheTabControl - 6 + 5 4, 22 @@ -376,7 +376,7 @@ TheTabControl - 7 + 6 Top, Bottom, Left, Right @@ -406,7 +406,7 @@ TheTabControl - 8 + 7 Fill @@ -436,7 +436,7 @@ TheTabControl - 9 + 8 Fill @@ -469,7 +469,7 @@ TheTabControl - 10 + 9 Fill @@ -499,7 +499,7 @@ TheTabControl - 11 + 10 4, 22 @@ -526,7 +526,7 @@ TheTabControl - 12 + 11 4, 22 @@ -553,7 +553,7 @@ TheTabControl - 13 + 12 True @@ -610,7 +610,7 @@ TheTabControl - 14 + 13 4, 22 @@ -634,7 +634,7 @@ TheTabControl - 15 + 14 4, 22 @@ -658,7 +658,7 @@ TheTabControl - 16 + 15 4, 22 @@ -682,7 +682,7 @@ TheTabControl - 17 + 16 4, 22 @@ -709,7 +709,7 @@ TheTabControl - 18 + 17 4, 22 @@ -733,7 +733,7 @@ TheTabControl - 19 + 18 4, 22 @@ -760,7 +760,7 @@ TheTabControl - 20 + 19 Fill @@ -790,7 +790,7 @@ TheTabControl - 21 + 20 4, 22 @@ -820,7 +820,7 @@ TheTabControl - 22 + 21 Fill @@ -850,7 +850,7 @@ TheTabControl - 23 + 22 4, 22 @@ -877,7 +877,7 @@ TheTabControl - 24 + 23 Verdana, 8.25pt @@ -1207,7 +1207,7 @@ TitleBackPanel - XenAdmin.Controls.GradientPanel.GradientPanel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + XenAdmin.Controls.GradientPanel.VerticalGradientPanel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2 @@ -2281,130 +2281,130 @@ &Server - 244, 22 + 243, 22 &New VM... - 244, 22 + 243, 22 &Start/Shut down - 244, 22 + 243, 22 Res&ume on Server - 244, 22 + 243, 22 M&igrate to Server - 244, 22 + 243, 22 Start &on Server - 241, 6 + 240, 6 - 244, 22 + 243, 22 Assign to Snaps&hot Schedule... - 244, 22 + 243, 22 Assign to &vApp - 241, 6 + 240, 6 - 244, 22 + 243, 22 &Copy VM - 244, 22 + 243, 22 &Move VM - 244, 22 + 243, 22 Ta&ke a Snapshot - 244, 22 + 243, 22 Convert to &Template - 244, 22 + 243, 22 &Export... - 244, 22 + 243, 22 D&isable Changed Block Tracking - 244, 22 + 243, 22 - 244, 22 + 243, 22 - 241, 6 + 240, 6 - 244, 22 + 243, 22 Inst&all [Citrix VM Tools] - 244, 22 + 243, 22 Send Ctrl+&Alt+Del - 241, 6 + 240, 6 - 244, 22 + 243, 22 &Delete VM - 241, 6 + 240, 6 - 244, 22 + 243, 22 PluginItemsPlaceHolder - 244, 22 + 243, 22 P&roperties @@ -3525,6 +3525,12 @@ XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + disableCbtToolStripMenuItem + + + XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + enablePVSReadcachingToolStripMenuItem @@ -3933,12 +3939,6 @@ System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - disableCbtToolStripMenuItem - - - XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - MainWindow