Hide from designer TabPage properties that are not meaningful at design time. Minor tidy up.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-09-08 15:41:25 +01:00
parent 9b2204d3df
commit 7b41c3a82c
10 changed files with 43 additions and 25 deletions

View File

@ -28,6 +28,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using XenAPI; using XenAPI;
@ -39,6 +40,9 @@ namespace XenAdmin.Controls
public partial class LoggedInLabel : UserControl public partial class LoggedInLabel : UserControl
{ {
private IXenConnection connection; private IXenConnection connection;
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IXenConnection Connection public IXenConnection Connection
{ {
get get

View File

@ -588,7 +588,6 @@ namespace XenAdmin
// //
resources.ApplyResources(this.loggedInLabel1, "loggedInLabel1"); resources.ApplyResources(this.loggedInLabel1, "loggedInLabel1");
this.loggedInLabel1.BackColor = System.Drawing.Color.Transparent; this.loggedInLabel1.BackColor = System.Drawing.Color.Transparent;
this.loggedInLabel1.Connection = null;
this.loggedInLabel1.Name = "loggedInLabel1"; this.loggedInLabel1.Name = "loggedInLabel1";
// //
// labelFiltersOnOff // labelFiltersOnOff

View File

@ -37,6 +37,7 @@ using XenAPI;
using XenAdmin.Model; using XenAdmin.Model;
using System.Xml; using System.Xml;
using System.Collections; using System.Collections;
using System.ComponentModel;
namespace XenAdmin.TabPages namespace XenAdmin.TabPages
{ {
@ -49,6 +50,8 @@ namespace XenAdmin.TabPages
private Host host; private Host host;
private string cachedResult; private string cachedResult;
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public DockerContainer DockerContainer public DockerContainer DockerContainer
{ {
get get

View File

@ -30,6 +30,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Xml; using System.Xml;
using System.Windows.Forms; using System.Windows.Forms;
using XenAdmin.Actions; using XenAdmin.Actions;
@ -61,6 +62,8 @@ namespace XenAdmin.TabPages
public override string HelpID => "TabPageDockerProcess"; public override string HelpID => "TabPageDockerProcess";
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public DockerContainer DockerContainer public DockerContainer DockerContainer
{ {
get get

View File

@ -57,6 +57,8 @@ namespace XenAdmin.TabPages
private readonly CollectionChangeEventHandler PIF_CollectionChangedWithInvoke; private readonly CollectionChangeEventHandler PIF_CollectionChangedWithInvoke;
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Host Host public Host Host
{ {
get get

View File

@ -30,6 +30,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms; using System.Windows.Forms;
using XenAPI; using XenAPI;
@ -44,9 +45,12 @@ namespace XenAdmin.TabPages
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 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. // 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; private IXenObject _xenObject;
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IXenObject XenObject public IXenObject XenObject
{ {
get get

View File

@ -71,6 +71,8 @@ namespace XenAdmin.TabPages
public override string HelpID => "TabPagePvs"; public override string HelpID => "TabPagePvs";
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IXenConnection Connection public IXenConnection Connection
{ {
get get

View File

@ -115,6 +115,8 @@ namespace XenAdmin.TabPages
} }
} }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Browsable(false)]
public VM VM public VM VM
{ {
set set

View File

@ -28,6 +28,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
using System.ComponentModel;
using XenAdmin.Core; using XenAdmin.Core;
@ -35,31 +36,28 @@ namespace XenAdmin.TabPages
{ {
public partial class UpsellTabPage : BaseTabPage public partial class UpsellTabPage : BaseTabPage
{ {
protected UpsellTabPage(string title, string blurb) protected UpsellTabPage()
{ {
InitializeComponent(); InitializeComponent();
base.Text = title;
BlurbText = blurb;
LearnMoreUrl = InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL;
} }
public string BlurbText protected string BlurbText
{ {
set => upsellPage1.BlurbText = value; set => upsellPage1.BlurbText = value;
} }
public string LearnMoreUrl protected string Title
{ {
set => upsellPage1.LearnMoreUrl = value; set => Text = value;
} }
} }
public class ADUpsellPage : UpsellTabPage public class ADUpsellPage : UpsellTabPage
{ {
public ADUpsellPage() 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"; public override string HelpID => "TabPageADUpsell";
@ -68,8 +66,10 @@ namespace XenAdmin.TabPages
public class HAUpsellPage : UpsellTabPage public class HAUpsellPage : UpsellTabPage
{ {
public HAUpsellPage() public HAUpsellPage()
: base(Messages.HIGH_AVAILABILITY, Messages.UPSELL_BLURB_HA) {
{ } Title = Messages.HIGH_AVAILABILITY;
BlurbText = Messages.UPSELL_BLURB_HA;
}
public override string HelpID => "TabPageHAUpsell"; public override string HelpID => "TabPageHAUpsell";
} }
@ -77,8 +77,10 @@ namespace XenAdmin.TabPages
public class WLBUpsellPage : UpsellTabPage public class WLBUpsellPage : UpsellTabPage
{ {
public WLBUpsellPage() public WLBUpsellPage()
: base(Messages.WORKLOAD_BALANCING, Messages.UPSELL_BLURB_WLB) {
{ } Title = Messages.WORKLOAD_BALANCING;
BlurbText = Messages.UPSELL_BLURB_WLB;
}
public override string HelpID => "TabPageWLBUpsell"; public override string HelpID => "TabPageWLBUpsell";
} }

View File

@ -43,6 +43,8 @@ namespace XenAdmin.TabPages
public partial class UsbPage : BaseTabPage public partial class UsbPage : BaseTabPage
{ {
private Host _host; private Host _host;
private HostUsbRow selectedRow;
private bool InBuildList;
public UsbPage() public UsbPage()
{ {
@ -56,6 +58,8 @@ namespace XenAdmin.TabPages
public override string HelpID => "TabPageUSB"; public override string HelpID => "TabPageUSB";
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IXenObject XenObject public IXenObject XenObject
{ {
get get
@ -80,7 +84,6 @@ namespace XenAdmin.TabPages
} }
} }
public bool InBuildList = false;
private void BuildList() private void BuildList()
{ {
Program.AssertOnEventThread(); Program.AssertOnEventThread();
@ -121,11 +124,6 @@ namespace XenAdmin.TabPages
} }
} }
protected override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged(e);
}
public override void PageHidden() public override void PageHidden()
{ {
UnregisterHandlers(); UnregisterHandlers();
@ -133,12 +131,12 @@ namespace XenAdmin.TabPages
base.PageHidden(); base.PageHidden();
} }
void Host_PropertyChanged(object sender, PropertyChangedEventArgs e) private void Host_PropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
RefreshAllItems(); RefreshAllItems();
} }
void UsbCollectionChanged(object sender, EventArgs e) private void UsbCollectionChanged(object sender, EventArgs e)
{ {
BuildList(); BuildList();
} }
@ -153,7 +151,7 @@ namespace XenAdmin.TabPages
} }
} }
internal void UnregisterHandlers() private void UnregisterHandlers()
{ {
if (_host != null) if (_host != null)
{ {
@ -169,7 +167,6 @@ namespace XenAdmin.TabPages
} }
} }
private HostUsbRow selectedRow = null;
private void dataGridViewUsbList_SelectionChanged(object sender, EventArgs e) private void dataGridViewUsbList_SelectionChanged(object sender, EventArgs e)
{ {
selectedRow = null; selectedRow = null;