wsp-10327 Add Dynamic Memory to VPS - Server Part.

This commit is contained in:
Alexander Trofimov 2015-04-03 20:23:01 +03:00
parent 1c48c3d230
commit 8fa9792b83
12 changed files with 171 additions and 92 deletions

View file

@ -189,7 +189,7 @@
</table>
</asp:Panel>
<asp:PlaceHolder ID="providerControl" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="createSettingsProviderControl" runat="server"></asp:PlaceHolder>
<wsp:CollapsiblePanel id="secSnapshots" runat="server"
TargetControlID="SnapshotsPanel" meta:resourcekey="secSnapshots" Text="Snapshots">

View file

@ -1,4 +1,4 @@
// Copyright (c) 2015, Outercurve Foundation.
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
@ -26,7 +26,7 @@
// (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;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
@ -42,7 +42,7 @@ namespace WebsitePanel.Portal.VPS
{
protected void Page_Load(object sender, EventArgs e)
{
LoadCustomProviderControl();
LoadCustomProviderControls();
if (!IsPostBack)
{
@ -56,23 +56,23 @@ namespace WebsitePanel.Portal.VPS
ToggleControls();
}
private void LoadCustomProviderControl()
private void LoadCustomProviderControls()
{
try
{
LoadProviderControl(PanelSecurity.PackageId, "VPS", providerControl, "Create.ascx");
LoadProviderControl(PanelSecurity.PackageId, "VPS", createSettingsProviderControl, "Create.ascx");
}
catch { /* skip */ }
}
private IVirtualMachineCreateControl CustomProviderControl
private IVirtualMachineCreateControl CreareSettingsProviderControl
{
get
{
if (providerControl.Controls.Count == 0)
if (createSettingsProviderControl.Controls.Count == 0)
return null;
return (IVirtualMachineCreateControl)providerControl.Controls[0];
return (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
}
}
@ -136,9 +136,9 @@ namespace WebsitePanel.Portal.VPS
ddlCpu.SelectedIndex = ddlCpu.Items.Count - 1; // select last (maximum) item
// the custom provider control
if (CustomProviderControl != null)
if (CreareSettingsProviderControl != null)
{
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)providerControl.Controls[0];
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
ctrl.BindItem(new VirtualMachine());
}
@ -319,9 +319,9 @@ namespace WebsitePanel.Portal.VPS
VirtualMachine virtualMachine = new VirtualMachine();
// the custom provider control
if (CustomProviderControl != null)
if (CreareSettingsProviderControl != null)
{
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)providerControl.Controls[0];
IVirtualMachineCreateControl ctrl = (IVirtualMachineCreateControl)createSettingsProviderControl.Controls[0];
ctrl.SaveItem(virtualMachine);
}

View file

@ -373,13 +373,13 @@ namespace WebsitePanel.Portal.VPS {
protected global::System.Web.UI.WebControls.Localize locGB;
/// <summary>
/// providerControl control.
/// createSettingsProviderControl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.PlaceHolder providerControl;
protected global::System.Web.UI.WebControls.PlaceHolder createSettingsProviderControl;
/// <summary>
/// secSnapshots control.