diff --git a/XenAdmin/Controls/AD/LoggedInLabel.cs b/XenAdmin/Controls/AD/LoggedInLabel.cs index 6df542beb..d87a97080 100644 --- a/XenAdmin/Controls/AD/LoggedInLabel.cs +++ b/XenAdmin/Controls/AD/LoggedInLabel.cs @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using XenAPI; @@ -39,6 +40,9 @@ namespace XenAdmin.Controls public partial class LoggedInLabel : UserControl { private IXenConnection connection; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IXenConnection Connection { get diff --git a/XenAdmin/MainWindow.Designer.cs b/XenAdmin/MainWindow.Designer.cs index f18bcc15e..2d2262611 100644 --- a/XenAdmin/MainWindow.Designer.cs +++ b/XenAdmin/MainWindow.Designer.cs @@ -588,7 +588,6 @@ namespace XenAdmin // resources.ApplyResources(this.loggedInLabel1, "loggedInLabel1"); this.loggedInLabel1.BackColor = System.Drawing.Color.Transparent; - this.loggedInLabel1.Connection = null; this.loggedInLabel1.Name = "loggedInLabel1"; // // labelFiltersOnOff diff --git a/XenAdmin/TabPages/DockerDetailsPage.cs b/XenAdmin/TabPages/DockerDetailsPage.cs index 67be1c6ed..e0d3e9f78 100755 --- a/XenAdmin/TabPages/DockerDetailsPage.cs +++ b/XenAdmin/TabPages/DockerDetailsPage.cs @@ -37,6 +37,7 @@ using XenAPI; using XenAdmin.Model; using System.Xml; using System.Collections; +using System.ComponentModel; namespace XenAdmin.TabPages { @@ -49,6 +50,8 @@ namespace XenAdmin.TabPages private Host host; private string cachedResult; + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DockerContainer DockerContainer { get diff --git a/XenAdmin/TabPages/DockerProcessPage.cs b/XenAdmin/TabPages/DockerProcessPage.cs index 54157934c..c309bd7e3 100644 --- a/XenAdmin/TabPages/DockerProcessPage.cs +++ b/XenAdmin/TabPages/DockerProcessPage.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Xml; using System.Windows.Forms; using XenAdmin.Actions; @@ -61,6 +62,8 @@ namespace XenAdmin.TabPages public override string HelpID => "TabPageDockerProcess"; + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public DockerContainer DockerContainer { get diff --git a/XenAdmin/TabPages/NICPage.cs b/XenAdmin/TabPages/NICPage.cs index ffe4d9013..2bcf3ef59 100644 --- a/XenAdmin/TabPages/NICPage.cs +++ b/XenAdmin/TabPages/NICPage.cs @@ -57,6 +57,8 @@ namespace XenAdmin.TabPages private readonly CollectionChangeEventHandler PIF_CollectionChangedWithInvoke; + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Host Host { get diff --git a/XenAdmin/TabPages/NetworkPage.cs b/XenAdmin/TabPages/NetworkPage.cs index 737d7a5a3..b2c16c95a 100644 --- a/XenAdmin/TabPages/NetworkPage.cs +++ b/XenAdmin/TabPages/NetworkPage.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Windows.Forms; using XenAPI; @@ -44,9 +45,12 @@ namespace XenAdmin.TabPages private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // We don't rebuild the controls while the tab is not visible, but instead queue it up later for when the page is displayed. - private bool refreshNeeded = false; + private bool refreshNeeded; private IXenObject _xenObject; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IXenObject XenObject { get diff --git a/XenAdmin/TabPages/PvsPage.cs b/XenAdmin/TabPages/PvsPage.cs index 2e952551e..63333af3e 100644 --- a/XenAdmin/TabPages/PvsPage.cs +++ b/XenAdmin/TabPages/PvsPage.cs @@ -71,6 +71,8 @@ namespace XenAdmin.TabPages public override string HelpID => "TabPagePvs"; + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IXenConnection Connection { get diff --git a/XenAdmin/TabPages/SnapshotsPage.cs b/XenAdmin/TabPages/SnapshotsPage.cs index b26b5ce2f..f4ed27a99 100644 --- a/XenAdmin/TabPages/SnapshotsPage.cs +++ b/XenAdmin/TabPages/SnapshotsPage.cs @@ -115,6 +115,8 @@ namespace XenAdmin.TabPages } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Browsable(false)] public VM VM { set diff --git a/XenAdmin/TabPages/UpsellTabPage.cs b/XenAdmin/TabPages/UpsellTabPage.cs index dbd981e95..ba0580cf4 100644 --- a/XenAdmin/TabPages/UpsellTabPage.cs +++ b/XenAdmin/TabPages/UpsellTabPage.cs @@ -28,6 +28,7 @@ * SUCH DAMAGE. */ +using System.ComponentModel; using XenAdmin.Core; @@ -35,31 +36,28 @@ namespace XenAdmin.TabPages { public partial class UpsellTabPage : BaseTabPage { - protected UpsellTabPage(string title, string blurb) + protected UpsellTabPage() { InitializeComponent(); - base.Text = title; - - BlurbText = blurb; - LearnMoreUrl = InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL; } - public string BlurbText + protected string BlurbText { set => upsellPage1.BlurbText = value; } - public string LearnMoreUrl + protected string Title { - set => upsellPage1.LearnMoreUrl = value; + set => Text = value; } } public class ADUpsellPage : UpsellTabPage { public ADUpsellPage() - : base(Messages.ACTIVE_DIRECTORY_TAB_TITLE, string.Format(Messages.UPSELL_BLURB_AD, BrandManager.ProductBrand)) { + Title = Messages.ACTIVE_DIRECTORY_TAB_TITLE; + BlurbText = string.Format(Messages.UPSELL_BLURB_AD, BrandManager.ProductBrand); } public override string HelpID => "TabPageADUpsell"; @@ -68,8 +66,10 @@ namespace XenAdmin.TabPages public class HAUpsellPage : UpsellTabPage { public HAUpsellPage() - : base(Messages.HIGH_AVAILABILITY, Messages.UPSELL_BLURB_HA) - { } + { + Title = Messages.HIGH_AVAILABILITY; + BlurbText = Messages.UPSELL_BLURB_HA; + } public override string HelpID => "TabPageHAUpsell"; } @@ -77,8 +77,10 @@ namespace XenAdmin.TabPages public class WLBUpsellPage : UpsellTabPage { public WLBUpsellPage() - : base(Messages.WORKLOAD_BALANCING, Messages.UPSELL_BLURB_WLB) - { } + { + Title = Messages.WORKLOAD_BALANCING; + BlurbText = Messages.UPSELL_BLURB_WLB; + } public override string HelpID => "TabPageWLBUpsell"; } diff --git a/XenAdmin/TabPages/UsbPage.cs b/XenAdmin/TabPages/UsbPage.cs index de8e19e43..26cb95bbd 100755 --- a/XenAdmin/TabPages/UsbPage.cs +++ b/XenAdmin/TabPages/UsbPage.cs @@ -43,6 +43,8 @@ namespace XenAdmin.TabPages public partial class UsbPage : BaseTabPage { private Host _host; + private HostUsbRow selectedRow; + private bool InBuildList; public UsbPage() { @@ -56,6 +58,8 @@ namespace XenAdmin.TabPages public override string HelpID => "TabPageUSB"; + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IXenObject XenObject { get @@ -80,7 +84,6 @@ namespace XenAdmin.TabPages } } - public bool InBuildList = false; private void BuildList() { Program.AssertOnEventThread(); @@ -121,11 +124,6 @@ namespace XenAdmin.TabPages } } - protected override void OnVisibleChanged(EventArgs e) - { - base.OnVisibleChanged(e); - } - public override void PageHidden() { UnregisterHandlers(); @@ -133,12 +131,12 @@ namespace XenAdmin.TabPages base.PageHidden(); } - void Host_PropertyChanged(object sender, PropertyChangedEventArgs e) + private void Host_PropertyChanged(object sender, PropertyChangedEventArgs e) { RefreshAllItems(); } - void UsbCollectionChanged(object sender, EventArgs e) + private void UsbCollectionChanged(object sender, EventArgs e) { BuildList(); } @@ -153,7 +151,7 @@ namespace XenAdmin.TabPages } } - internal void UnregisterHandlers() + private void UnregisterHandlers() { if (_host != null) { @@ -169,7 +167,6 @@ namespace XenAdmin.TabPages } } - private HostUsbRow selectedRow = null; private void dataGridViewUsbList_SelectionChanged(object sender, EventArgs e) { selectedRow = null;