2017-01-16 20:59:50 +01:00
|
|
|
|
/* Copyright (c) Citrix Systems, Inc.
|
2013-06-24 13:41:48 +02:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms,
|
|
|
|
|
* with or without modification, are permitted provided
|
|
|
|
|
* that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* * Redistributions of source code must retain the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer.
|
|
|
|
|
* * Redistributions in binary form must reproduce the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer in the documentation and/or other
|
|
|
|
|
* materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
|
|
|
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using XenAdmin.Actions;
|
|
|
|
|
using XenAdmin.Core;
|
|
|
|
|
using XenAdmin.SettingsPanels;
|
|
|
|
|
using XenAPI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace XenAdmin.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class UpsellPage : UserControl, IEditPage
|
|
|
|
|
{
|
|
|
|
|
public UpsellPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2016-01-28 22:43:15 +01:00
|
|
|
|
this.LearnMoreButton.Visible = !HiddenFeatures.LearnMoreButtonHidden;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void enableOkButton()
|
|
|
|
|
{
|
|
|
|
|
OKButton.Visible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string BlurbText
|
|
|
|
|
{
|
2021-03-16 02:50:45 +01:00
|
|
|
|
set => Blurb.Text = HiddenFeatures.LinkLabelHidden
|
|
|
|
|
? value
|
|
|
|
|
: value + string.Format(Messages.UPSELL_BLURB_TRIAL, BrandManager.ProductBrand);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-03-16 02:50:45 +01:00
|
|
|
|
public string LearnMoreUrl { private get; set; } = InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
private void LearnMoreButton_Clicked(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-03-16 02:50:45 +01:00
|
|
|
|
NavigateTo(LearnMoreUrl);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NavigateTo(string url)
|
|
|
|
|
{
|
|
|
|
|
if (url == null)
|
|
|
|
|
return;
|
|
|
|
|
Program.OpenURL(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region IEditPage Members
|
|
|
|
|
|
|
|
|
|
public AsyncAction SaveSettings()
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetXenObjects(IXenObject orig, IXenObject clone)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-17 10:34:41 +02:00
|
|
|
|
public bool ValidToSave => true;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
public void ShowLocalValidationMessages()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Cleanup()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-17 10:34:41 +02:00
|
|
|
|
public bool HasChanged => false;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
|
2018-03-20 18:02:45 +01:00
|
|
|
|
#region IVerticalTab Members
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2020-06-17 10:34:41 +02:00
|
|
|
|
public string SubText => Messages.XENSERVER_UPGRADE_REQUIRED;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2020-06-17 10:34:41 +02:00
|
|
|
|
[Browsable(false)]
|
|
|
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
2020-11-08 01:41:42 +01:00
|
|
|
|
public Image Image { get; set; } = Images.StaticImages.Logo; //serving as default value; never really shown
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private void OKButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2020-06-17 10:34:41 +02:00
|
|
|
|
ParentForm?.Close();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|