Merge pull request #1608 from MihaelaStoica/removeVMPP

Remove vmpp
This commit is contained in:
Konstantina Chremmou 2017-05-31 08:43:12 +01:00 committed by GitHub
commit af647fbf52
80 changed files with 910 additions and 10369 deletions

View File

@ -229,22 +229,6 @@ namespace XenAdmin.Alerts
}
break;
//these here do not need the object
case Message.MessageType.VMPP_ARCHIVE_FAILED_0:
case Message.MessageType.VMPP_ARCHIVE_LOCK_FAILED:
case Message.MessageType.VMPP_ARCHIVE_MISSED_EVENT:
case Message.MessageType.VMPP_ARCHIVE_SUCCEEDED:
case Message.MessageType.VMPP_ARCHIVE_TARGET_MOUNT_FAILED:
case Message.MessageType.VMPP_ARCHIVE_TARGET_UNMOUNT_FAILED:
case Message.MessageType.VMPP_SNAPSHOT_ARCHIVE_ALREADY_EXISTS:
case Message.MessageType.VMPP_SNAPSHOT_FAILED:
case Message.MessageType.VMPP_SNAPSHOT_LOCK_FAILED:
case Message.MessageType.VMPP_SNAPSHOT_MISSED_EVENT:
case Message.MessageType.VMPP_SNAPSHOT_SUCCEEDED:
case Message.MessageType.VMPP_LICENSE_ERROR:
case Message.MessageType.VMPP_XAPI_LOGON_FAILURE:
var policyAlert = new PolicyAlert(Message.Connection, Message.body);
return policyAlert.Text;
case Message.MessageType.VMSS_SNAPSHOT_MISSED_EVENT:
case Message.MessageType.VMSS_XAPI_LOGON_FAILURE:
case Message.MessageType.VMSS_LICENSE_ERROR:

View File

@ -34,17 +34,11 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Core;
using XenAdmin.Wizards.NewPolicyWizard;
using XenAPI;
using XenAdmin.Dialogs;
using System.Drawing;
using XenAdmin.Wizards;
using XenAdmin.Network;
using XenAdmin.Wizards.NewVMApplianceWizard;
namespace XenAdmin.Commands
{
/// <summary>
@ -85,7 +79,7 @@ namespace XenAdmin.Commands
/* do not add unsupported policies to the drop down for VMSS */
XenAPI.VMSS policy = group as VMSS;
if (policy != null && policy.policy_type == policy_backup_type.snapshot_with_quiesce)
if (policy != null && policy.type == vmss_type.snapshot_with_quiesce)
{
List<VM> vms = Command.GetSelection().AsXenObjects<VM>();
bool doNotInclude = vms.Any(vm => !vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce));
@ -306,12 +300,6 @@ namespace XenAdmin.Commands
}
}
/// <summary>
/// Class used for the benefit of visual studio's form designer which has trouble with generic controls
/// </summary>
internal sealed class AssignGroupToolStripMenuItemVMPP : AssignGroupToolStripMenuItem<VMPP>
{ }
/// <summary>
/// Class used for the benefit of visual studio's form designer which has trouble with generic controls
/// </summary>

View File

@ -707,7 +707,6 @@ namespace XenAdmin.Commands
items.AddSeparator();
if (selection.FirstAsXenObject != null )
items.Add(new HACommand(mainWindow, selection));
items.AddIfEnabled(new VMGroupCommand<VMPP>(mainWindow, selection));
items.AddIfEnabled(new VMGroupCommand<VMSS>(mainWindow, selection));
items.AddIfEnabled(new VMGroupCommand<VM_appliance>(mainWindow, selection));
@ -889,7 +888,6 @@ namespace XenAdmin.Commands
items.AddIfEnabled(new ExportCommand(mainWindow, selection));
items.AddIfEnabled(new TakeSnapshotCommand(mainWindow, selection));
items.AddIfEnabled(new ConvertVMToTemplateCommand(mainWindow, selection));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VMPP>(mainWindow, selection, true));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VMSS>(mainWindow, selection, true));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VM_appliance>(mainWindow, selection, true));
items.AddSeparator();
@ -1084,7 +1082,6 @@ namespace XenAdmin.Commands
items.AddIfEnabled(new ResumeVMOnHostToolStripMenuItem(mainWindow, selection, true));
items.AddIfEnabled(new MigrateVMToolStripMenuItem(mainWindow, selection, true));
items.AddIfEnabled(new ExportCommand(mainWindow, selection));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VMPP>(mainWindow, selection, true));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VMSS>(mainWindow, selection, true));
items.AddIfEnabled(new AssignGroupToolStripMenuItem<VM_appliance>(mainWindow, selection, true));
items.AddSeparator();

View File

@ -29,10 +29,8 @@
* SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using XenAdmin.Core;
using XenAdmin.Dialogs;
@ -90,11 +88,7 @@ namespace XenAdmin.Commands
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
if (typeof(T) == typeof(VMPP) && selection.Any(s => Helpers.ClearwaterOrGreater(s.Connection)))
{
return false;
}
else if (typeof(T) == typeof(VMSS) && selection.Any(s => !Helpers.DundeeOrGreater(s.Connection)))
if (typeof(T) == typeof(VMSS) && selection.Any(s => !Helpers.FalconOrGreater(s.Connection)))
{
return false;
}
@ -121,12 +115,6 @@ namespace XenAdmin.Commands
}
}
/// <summary>
/// Class used for the benefit of visual studio's form designer which has trouble with generic controls
/// </summary>
internal sealed class VMGroupCommandVMPP : VMGroupCommand<VMPP>
{ }
/// <summary>
/// Class used for the benefit of visual studio's form designer which has trouble with generic controls
/// </summary>

View File

@ -35,7 +35,7 @@ using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace XenAdmin.Dialogs.VMProtectionRecovery
namespace XenAdmin.Controls
{
public class DataGridViewTextAndImageCell : DataGridViewTextBoxCell
{

View File

@ -48,14 +48,6 @@ namespace XenAdmin.Core
}
}
internal static bool VMPRFeatureEnabled
{
get
{
return ReadBool(VMPR_ENABLED, true);
}
}
internal static bool DisablePlugins
{
get
@ -390,7 +382,6 @@ namespace XenAdmin.Core
private const string ALLOW_CREDENTIAL_SAVE = "AllowCredentialSave";
private const string FORCE_SYSTEM_FONTS = "ForceSystemFonts";
private const string DISABLE_PLUGINS = "DisablePlugins";
private const string VMPR_ENABLED = "VMPREnabled";
private const string DONT_SUDO = "DontSudo";
private const string XENCENTER_LOCAL_KEYS = @"SOFTWARE\" + Branding.COMPANY_NAME_SHORT + @"\" + Branding.BRAND_CONSOLE;
private const string PSConsoleKey = @"Software\" + Branding.COMPANY_NAME_SHORT + @"\XenServerPSSnapIn";

View File

@ -31,10 +31,9 @@
using System;
using System.Collections.Generic;
using System.Text;
using XenAdmin.Actions;
using XenAdmin.Dialogs;
using XenAdmin.Dialogs.VMPolicies;
using XenAdmin.Dialogs.ScheduledSnapshots;
using XenAdmin.Dialogs.VMAppliances;
using XenAdmin.Network;
using XenAdmin.Wizards;
@ -46,7 +45,7 @@ using XenAPI;
namespace XenAdmin.Core
{
/// <summary>
/// A helper class for dealing with a group of VMs (currently either a VMPP, VMSS or a vApp);
/// A helper class for dealing with a group of VMs (currently either a VMSS or a vApp);
/// it contains all the functions necessary to abstract away what type of group it is.
///
/// In C++, we would use template specialization for this, but C# generics don't have that, so we
@ -59,87 +58,87 @@ namespace XenAdmin.Core
internal static T[] GroupsInCache(ICache cache)
{
return typeof(T) == typeof(VMPP) ? cache.VMPPs as T[] : (typeof(T) == typeof(VMSS)? cache.VMSSs as T[] : cache.VM_appliances as T[]);
return typeof(T) == typeof(VMSS)? cache.VMSSs as T[] : cache.VM_appliances as T[];
}
internal static XenRef<T> VmToGroup(VM vm)
{
return typeof(T) == typeof(VMPP) ? vm.protection_policy as XenRef<T> : (typeof(T) == typeof(VMSS) ? vm.snapshot_schedule as XenRef<T> : vm.appliance as XenRef<T>);
return typeof(T) == typeof(VMSS) ? vm.snapshot_schedule as XenRef<T> : vm.appliance as XenRef<T>;
}
internal static List<XenRef<VM>> GroupToVMs(T group)
{
return typeof(T) == typeof(VMPP) ? (group as VMPP).VMs : (typeof(T) == typeof(VMSS) ? (group as VMSS).VMs : (group as VM_appliance).VMs);
return typeof(T) == typeof(VMSS) ? (group as VMSS).VMs : (group as VM_appliance).VMs;
}
internal static string ChangeOneWarningString
{
get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICY_WARNING : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VM_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCE_WARNING); }
get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VM_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCE_WARNING; }
}
internal static string ChangeMultipleWarningString
{
get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICIES_WARNING : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMS_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCES_WARNING); }
get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMS_SNAPSHOT_SCHEDULE_WARNING : Messages.CHANGE_VMS_APPLIANCES_WARNING; }
}
internal static string NewGroupString
{
get { return typeof(T) == typeof(VMPP) ? Messages.NEW_POLICY : (typeof(T) == typeof(VMSS) ? Messages.NEW_SCHEDULE : Messages.NEW_VM_APPLIANCE); }
get { return typeof(T) == typeof(VMSS) ? Messages.NEW_SCHEDULE : Messages.NEW_VM_APPLIANCE; }
}
internal static string ChangeVMsGroupString
{
get { return typeof(T) == typeof(VMPP) ? Messages.CHANGE_VMS_POLICY : (typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMSS_POLICY : Messages.CHANGE_VMS_APPLIANCE); }
get { return typeof(T) == typeof(VMSS) ? Messages.CHANGE_VMSS_POLICY : Messages.CHANGE_VMS_APPLIANCE; }
}
internal static string AssignMainMenuString
{
get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY : (typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY : Messages.ASSIGN_VM_APPLIANCE); }
get { return typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY : Messages.ASSIGN_VM_APPLIANCE; }
}
internal static string AssignContextMenuString
{
get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY_CONTEXT_MENU : (typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY_CONTEXT_MENU : Messages.ASSIGN_VM_APPLIANCE); }
get { return typeof(T) == typeof(VMSS) ? Messages.ASSIGN_VMSS_POLICY_CONTEXT_MENU : Messages.ASSIGN_VM_APPLIANCE; }
}
internal static string ManageMainMenuString
{
get { return typeof(T) == typeof(VMPP) ? Messages.VM_PROTECTION_MAIN_MENU : (typeof(T) == typeof(VMSS) ? Messages.VMSS_MAIN_MENU : Messages.VM_APPLIANCES_MENU); }
get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_MAIN_MENU : Messages.VM_APPLIANCES_MENU; }
}
internal static string ManageContextMenuString
{
get { return typeof(T) == typeof(VMPP) ? Messages.VM_PROTECTION_CONTEXT_MENU : (typeof(T) == typeof(VMSS) ? Messages.VMSS_CONTEXT_MENU : Messages.VM_APPLIANCES_MENU); }
get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_CONTEXT_MENU : Messages.VM_APPLIANCES_MENU; }
}
internal static string ChooseVMsPage_Text
{
get { return typeof(T) == typeof(VMPP) ? Messages.PROTECTED_VMS : (typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS : Messages.NEWVMAPPLIANCE_VMSPAGE_TEXT); }
get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS : Messages.NEWVMAPPLIANCE_VMSPAGE_TEXT; }
}
internal static string ChooseVMsPage_Title
{
get { return typeof(T) == typeof(VMPP) ? Messages.PROTECTED_VMS_TITLE : (typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS_TITLE : Messages.NEWVMAPPLIANCE_VMSPAGE_TITLE); }
get { return typeof(T) == typeof(VMSS) ? Messages.VMSS_VMS_TITLE : Messages.NEWVMAPPLIANCE_VMSPAGE_TITLE; }
}
internal static string ChooseVMsPage_Rubric
{
get { return typeof(T) == typeof(VMPP) ? Messages.CHOOSE_VMS_VMPP_RUBRIC : (typeof(T) == typeof(VMSS) ? Messages.CHOOSE_VMS_VMSS_RUBRIC : Messages.CHOOSE_VMS_VAPP_RUBRIC); }
get { return typeof(T) == typeof(VMSS) ? Messages.CHOOSE_VMS_VMSS_RUBRIC : Messages.CHOOSE_VMS_VAPP_RUBRIC; }
}
internal static string ChooseVMsPage_CurrentGroup
{
get { return typeof(T) == typeof(VMPP) ? Messages.CURRENT_POLICY : (typeof(T) == typeof(VMSS) ? Messages.CURRENT_SCHEDULE : Messages.CURRENT_VAPP); }
get { return typeof(T) == typeof(VMSS) ? Messages.CURRENT_SCHEDULE : Messages.CURRENT_VAPP; }
}
internal static string VMPolicyTypeName
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_TYPE : Messages.VMSS_TYPE; }
get { return Messages.VMSS_TYPE; }
}
internal static string ChooseVMsPage_HelpID
{
get { return typeof(T) == typeof(VMPP) ? "VirtualMachines" : "VMs"; } // these are only different for historical reasons
get { return "VMs"; }
}
internal static string UpsellBlurb
@ -147,220 +146,62 @@ namespace XenAdmin.Core
get
{
if (HiddenFeatures.LinkLabelHidden)
return typeof(T) == typeof(VMPP) ? Messages.UPSELL_BLURB_VM_PROTECTION : (typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS : Messages.UPSELL_BLURB_VM_APPLIANCES);
return typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS : Messages.UPSELL_BLURB_VM_APPLIANCES;
else
return typeof(T) == typeof(VMPP) ? Messages.UPSELL_BLURB_VM_PROTECTION + Messages.UPSELL_BLURB_VM_PROTECTION_MORE : (typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS + Messages.UPSELL_BLURB_VMSS_MORE : Messages.UPSELL_BLURB_VM_APPLIANCES + Messages.UPSELL_BLURB_VM_APPLIANCES_MORE);
return typeof(T) == typeof(VMSS) ? Messages.UPSELL_BLURB_VMSS + Messages.UPSELL_BLURB_VMSS_MORE : Messages.UPSELL_BLURB_VM_APPLIANCES + Messages.UPSELL_BLURB_VM_APPLIANCES_MORE;
}
}
internal static string UpsellLearnMoreUrl
{
get { return typeof(T) == typeof(VMPP) ? InvisibleMessages.UPSELL_LEARNMOREURL_VM_PROTECTION : (typeof(T) == typeof(VMSS) ? InvisibleMessages.UPSELL_LEARNMOREURL_VMSS : InvisibleMessages.UPSELL_LEARNMOREURL_VM_APPLIANCES); }
get { return typeof(T) == typeof(VMSS) ? InvisibleMessages.UPSELL_LEARNMOREURL_VMSS : InvisibleMessages.UPSELL_LEARNMOREURL_VM_APPLIANCES; }
}
internal static AsyncAction AssignVMsToGroupAction(T group, List<XenRef<VM>> vms, bool suppressHistory)
{
return typeof(T) == typeof(VMPP) ?
(AsyncAction)(new AssignVMsToPolicyAction<VMPP>(group as VMPP, vms, suppressHistory)) :
(typeof(T) == typeof(VMSS) ? (AsyncAction)(new AssignVMsToPolicyAction<VMSS>(group as VMSS, vms, suppressHistory)) :
(AsyncAction)(new AssignVMsToVMApplianceAction(group as VM_appliance, vms, suppressHistory)));
return typeof(T) == typeof(VMSS) ? (AsyncAction)(new AssignVMsToPolicyAction(group as VMSS, vms, suppressHistory)) :
(AsyncAction)(new AssignVMsToVMApplianceAction(group as VM_appliance, vms, suppressHistory));
}
internal static AsyncAction RemoveVMsFromGroupAction(T group, List<XenRef<VM>> vms)
{
return typeof(T) == typeof(VMPP) ?
(AsyncAction)(new RemoveVMsFromPolicyAction<VMPP>(group as VMPP, vms)) :
(typeof(T) == typeof(VMSS) ? (AsyncAction)(new RemoveVMsFromPolicyAction<VMSS>(group as VMSS, vms)) :
(AsyncAction)(new RemoveVMsFromVMApplianceAction(group as VM_appliance, vms)));
return typeof(T) == typeof(VMSS) ? (AsyncAction)(new RemoveVMsFromPolicyAction(group as VMSS, vms)) :
(AsyncAction)(new RemoveVMsFromVMApplianceAction(group as VM_appliance, vms));
}
internal static XenWizardBase NewGroupWizard(Pool pool)
{
return typeof(T) == typeof(VMPP) ? (XenWizardBase)(new NewPolicyWizardSpecific<VMPP>(pool)) : (typeof(T) == typeof(VMSS) ? (XenWizardBase)(new NewPolicyWizardSpecific<VMSS>(pool)) : (XenWizardBase)(new NewVMApplianceWizard(pool)));
return typeof(T) == typeof(VMSS) ? (XenWizardBase) new NewPolicyWizard(pool) : new NewVMApplianceWizard(pool);
}
internal static XenWizardBase NewGroupWizard(Pool pool, List<VM> vms)
{
return typeof(T) == typeof(VMPP) ? (XenWizardBase)(new NewPolicyWizardSpecific<VMPP>(pool, vms)) : (typeof(T) == typeof(VMSS) ? (XenWizardBase)(new NewPolicyWizardSpecific<VMSS>(pool, vms)) : (XenWizardBase)(new NewVMApplianceWizard(pool, vms)));
return typeof(T) == typeof(VMSS) ? new NewPolicyWizard(pool, vms) : (XenWizardBase)new NewVMApplianceWizard(pool, vms);
}
internal static XenDialogBase ManageGroupsDialog(Pool pool)
{
return typeof(T) == typeof(VMPP) ? (XenDialogBase)(new VMPoliciesDialogSpecific<VMPP>(pool)) : (typeof(T) == typeof(VMSS) ? (XenDialogBase)(new VMPoliciesDialogSpecific<VMSS>(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool)));
return typeof(T) == typeof(VMSS) ? (XenDialogBase)(new ScheduledSnapshotsDialog(pool)) : (XenDialogBase)(new VMAppliancesDialog(pool));
}
internal static bool FeaturePossible(IXenConnection connection)
{
if (typeof(T) == typeof(VMPP) && (Helpers.ClearwaterOrGreater(connection)))
return false;
//VMSS is enabled Falcon onwards
if ((typeof(T) == typeof(VMSS)) && !Helpers.FalconOrGreater(connection))
return false;
return typeof(T) == typeof(VMPP) ?
Registry.VMPRFeatureEnabled :
true;
return true;
}
internal static Predicate<Host> FeatureRestricted
{
get { return typeof(T) == typeof(VMPP) ? (Predicate<Host>)Host.RestrictVMProtection : (typeof(T) == typeof(VMSS) ? ((Predicate<Host>)Host.RestrictVMSnapshotSchedule) : (Predicate<Host>)Host.RestrictVMAppliances); }
}
internal static string VMPolicyDialogTitle
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_DIALOG_TITLE : Messages.VMSS_DIALOG_TITLE; }
}
internal static string VMPolicyDialogText
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_DIALOG_TEXT : Messages.VMSS_DIALOG_TEXT; }
}
internal static string VMPolicyDialogSchedulesInPool
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL : Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL; }
}
internal static string VMPolicyDialogSchedulesInServer
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER : Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER; }
}
internal static IVMPolicy[] VMPolicies (ICache cache)
{
if (typeof(T) == typeof(VMPP))
return cache.VMPPs;
else
return cache.VMSSs;
get { return typeof(T) == typeof(VMSS) ? ((Predicate<Host>)Host.RestrictVMSnapshotSchedule) : (Predicate<Host>)Host.RestrictVMAppliances; }
}
internal static bool isQuescingSupported
{
get { return typeof(T) == typeof(VMPP) ? false : true; }
}
internal static string VMPolicyNamePageText
{
get { return typeof(T) == typeof(VMPP) ? Messages.NEW_VMPP_PAGE_TEXT : Messages.NEW_VMSS_PAGE_TEXT; }
}
internal static string VMPolicyNamePageTextMore
{
get { return typeof(T) == typeof(VMPP) ? Messages.NEW_VMPP_PAGE_TEXT_MORE : Messages.NEW_VMSS_PAGE_TEXT_MORE; }
}
internal static string VMPolicyNamePageTabName
{
get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME : Messages.VMSS_NAME; }
}
internal static string VMPolicyNamePageTabText
{
get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME_TITLE : Messages.VMSS_NAME_TITLE; }
}
internal static string VMPolicyNamePageNameFieldText
{
get { return typeof(T) == typeof(VMPP) ? Messages.POLICY_NAME_FIELD_TEXT : Messages.VMSS_NAME_FIELD_TEXT; }
}
internal static string VMPolicyFinishPageText
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_PAGE_TEXT : Messages.VMSS_FINISH_PAGE_TEXT; }
}
internal static string VMPolicyFinishPageTitle
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_TITLE : Messages.VMSS_FINISH_TITLE; }
}
internal static string VMPolicyFinishPageCheckboxText
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_FINISH_PAGE_CHECKBOX_TEXT : Messages.VMSS_FINISH_PAGE_CHECKBOX_TEXT; }
}
internal static string VMPolicyRBACWarning
{
get { return typeof(T) == typeof(VMPP) ? Messages.RBAC_WARNING_VMPP : Messages.RBAC_WARNING_VMSS; }
}
internal static string VMPolicyRBACapiCheck
{
get { return typeof(T) == typeof(VMPP) ? "VMPP.async_create" : "VMSS.async_create"; }
}
internal static string VMPolicyWizardTitle
{
get { return typeof(T) == typeof(VMPP) ? Messages.VMPP_WIZARD_TITLE : Messages.VMSS_WIZARD_TITLE; }
}
internal static bool isVMPolicyVMPP
{
get { return typeof(T) == typeof(VMPP) ? true : false; }
}
internal static string VMAssigningPolicy
{
get { return typeof(T) == typeof(VMPP) ? Messages.ASSIGNING_PROTECTION_POLICY : Messages.ASSIGNING_VMSS_POLICY; }
}
internal static AsyncAction VMCreateObjectAction(
string _name_label,
string _name_description,
policy_backup_type _backup_type,
policy_frequency _backup_frequency,
Dictionary<string, string> _backup_schedule,
long _backup_retention_value,
vmpp_archive_frequency _archive_frequency,
Dictionary<string, string> _archive_target_config,
vmpp_archive_target_type _archive_target_type,
Dictionary<string, string> _archive_schedule,
bool _is_alarm_enabled,
Dictionary<string, string> _alarm_config,
bool _is_policy_enabled,
List<VM> vms,
bool runNow,
IXenConnection _connection)
{
if (typeof(T) == typeof(VMPP))
{
var vmpp = new VMPP
{
name_label = _name_label,
name_description = _name_description,
backup_type = (vmpp_backup_type)_backup_type,
backup_frequency = (vmpp_backup_frequency)_backup_frequency,
backup_schedule = _backup_schedule,
backup_retention_value = _backup_retention_value,
archive_frequency = _archive_frequency,
archive_target_config = _archive_target_config,
archive_target_type = _archive_target_type,
archive_schedule = _archive_schedule,
is_alarm_enabled = _is_alarm_enabled,
alarm_config = _alarm_config,
is_policy_enabled = _is_policy_enabled,
Connection = _connection
};
return new CreateVMPolicy<VMPP>(vmpp, vms, runNow);
}
else
{
var vmss = new VMSS
{
name_label = _name_label,
name_description = _name_description,
type = (vmss_type)_backup_type,
frequency = (vmss_frequency)_backup_frequency,
schedule = _backup_schedule,
retained_snapshots = _backup_retention_value,
enabled = _is_policy_enabled,
Connection = _connection
};
return new CreateVMPolicy<VMSS>(vmss, vms, runNow);
}
get { return typeof(T) == typeof(VMSS); }
}
}
}

View File

@ -34,7 +34,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Dialogs.VMProtectionRecovery;
using XenAdmin.Controls;
using XenAPI;

View File

@ -37,7 +37,7 @@ using System.Linq;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Core;
using XenAdmin.Dialogs.VMProtectionRecovery;
using XenAdmin.Controls;
using XenAdmin.Model;
using XenAdmin.Network;
using XenAPI;

View File

@ -67,11 +67,7 @@ namespace XenAdmin.Dialogs
private HostPowerONEditPage HostPowerONEditPage;
private PoolPowerONEditPage PoolPowerONEditPage;
private NewPolicySnapshotFrequencyPage newPolicySnapshotFrequencyPage1;
private NewPolicySnapshotTypePageSpecific<VMPP> newPolicySnapshotTypePage1;
private NewPolicySnapshotTypePageSpecific<VMSS> newPolicyVMSSTypePage1;
private NewPolicyArchivePage newPolicyArchivePage1;
private NewPolicyEmailPage newPolicyEmailPage1;
private NewVMGroupVMsPage<VMPP> newPolicyVMsPage1;
private NewPolicySnapshotTypePage newPolicyVMSSTypePage1;
private NewVMGroupVMsPage<VMSS> newVMSSVMsPage1;
private NewVMGroupVMsPage<VM_appliance> newVMApplianceVMsPage1;
private NewVMApplianceVMOrderAndDelaysPage newVmApplianceVmOrderAndDelaysPage1;
@ -131,8 +127,6 @@ namespace XenAdmin.Dialogs
bool wlb_enabled = (Helpers.WlbEnabledAndConfigured(xenObjectCopy.Connection));
bool is_VMPP = xenObjectCopy is VMPP;
bool is_VM_appliance = xenObjectCopy is VM_appliance;
bool is_VMSS = xenObjectCopy is VMSS;
@ -146,7 +140,7 @@ namespace XenAdmin.Dialogs
ShowTab(GeneralEditPage = new GeneralEditPage());
if (!is_VMPP && !is_VM_appliance)
if (!is_VM_appliance)
ShowTab(CustomFieldsEditPage = new CustomFieldsDisplayPage {AutoScroll = true});
if (is_vm)
@ -240,19 +234,10 @@ namespace XenAdmin.Dialogs
if (is_vm && Helpers.ContainerCapability(xenObject.Connection) && ((VM)xenObjectCopy).CanHaveCloudConfigDrive)
ShowTab(CloudConfigParametersPage = new Page_CloudConfigParameters());
if (is_VMPP)
{
ShowTab(newPolicyVMsPage1 = new NewVMGroupVMsPage<VMPP> {Pool = pool});
ShowTab(newPolicySnapshotTypePage1 = new NewPolicySnapshotTypePageSpecific<VMPP>());
ShowTab(newPolicySnapshotFrequencyPage1 = new NewPolicySnapshotFrequencyPage {Pool = pool});
ShowTab(newPolicyArchivePage1 = new NewPolicyArchivePage {Pool = pool, PropertiesDialog = this});
ShowTab(newPolicyEmailPage1 = new NewPolicyEmailPage() {PropertiesDialog = this});
}
if(is_VMSS)
{
ShowTab(newVMSSVMsPage1 = new NewVMGroupVMsPage<VMSS> {Pool = pool});
ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePageSpecific<VMSS>());
ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePage());
ShowTab(newPolicySnapshotFrequencyPage1 = new NewPolicySnapshotFrequencyPage {Pool = pool});
}
@ -348,7 +333,7 @@ namespace XenAdmin.Dialogs
if(xenObjectBefore is VMSS)
{
XenAPI.VMSS VMSSObj = xenObjectBefore as XenAPI.VMSS;
if (VMSSObj.policy_type == policy_backup_type.snapshot_with_quiesce)
if (VMSSObj.type == vmss_type.snapshot_with_quiesce)
{
actions.Insert(0, new SaveChangesAction(xenObjectCopy, xenObjectBefore, true));
}
@ -488,21 +473,13 @@ namespace XenAdmin.Dialogs
private void verticalTabs_SelectedIndexChanged(object sender, EventArgs e)
{
var snapshotTypePageSpecific = verticalTabs.SelectedItem as NewPolicySnapshotTypePageSpecific<VMSS>;
if (snapshotTypePageSpecific != null)
var snapshotTypePage = verticalTabs.SelectedItem as NewPolicySnapshotTypePage;
if (snapshotTypePage != null)
{
newPolicyVMSSTypePage1.ToggleQuiesceCheckBox(newVMSSVMsPage1.SelectedVMs);
return;
}
var selectedPage = verticalTabs.SelectedItem as NewPolicyArchivePage;
if (selectedPage != null)
{
if (newPolicySnapshotFrequencyPage1.ValidToSave)
selectedPage.SetXenObjects(null, null);
return;
}
var vmApplianceStartOrderPage = verticalTabs.SelectedItem as NewVMApplianceVMOrderAndDelaysPage;
if (vmApplianceStartOrderPage != null && newVMApplianceVMsPage1 != null)
{
@ -570,11 +547,6 @@ namespace XenAdmin.Dialogs
SelectPage(PerfmonAlertEditPage);
}
public void SelectNewPolicyArchivePage()
{
SelectPage(newPolicyArchivePage1);
}
public void SelectStartupOptionsEditPage()
{
SelectPage(StartupOptionsEditPage);

View File

@ -1,6 +1,6 @@
using XenAdmin.Controls.DataGridViewEx;
namespace XenAdmin.Dialogs.VMProtectionRecovery
namespace XenAdmin.Dialogs.ScheduledSnapshots
{
partial class PolicyHistory
{

View File

@ -30,22 +30,20 @@
*/
using System;
using System.Windows.Forms;
using XenAdmin.Alerts;
using XenAPI;
using XenAdmin.Properties;
using System.ComponentModel;
using XenAdmin.Actions;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Alerts;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAdmin.Properties;
using XenAPI;
namespace XenAdmin.Dialogs.VMProtectionRecovery
namespace XenAdmin.Dialogs.ScheduledSnapshots
{
public partial class PolicyHistory : UserControl
{
public Pool pool;
public PolicyHistory()
{
InitializeComponent();
@ -71,7 +69,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
}
}
private IVMPolicy _policy;
private VMSS _policy;
public void StartRefreshTab()
{
/* hoursFromNow has 3 possible values:
@ -92,12 +90,12 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
break;
}
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
PureAsyncAction action = new GetVMSSAlertsAction(_policy, hoursFromNow);
action.Completed += action_Completed;
action.RunAsync();
}
public void RefreshTab(IVMPolicy policy)
public void RefreshTab(VMSS policy)
{
_policy = policy;
if (_policy == null)
@ -202,14 +200,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
Program.Invoke(Program.MainWindow, () =>
{
panelLoading.Visible = false;
if (_policy._Type == typeof(VMPP))
{
RefreshGrid(((GetVMPPAlertsAction)(action)).VMPP.Alerts);
}
else
{
RefreshGrid(((GetVMSSAlertsAction)(action)).VMSS.Alerts);
}
RefreshGrid(((GetVMSSAlertsAction)(action)).VMSS.Alerts);
});
}

View File

@ -1,10 +1,9 @@
using XenAdmin.Controls.DataGridViewEx;
using XenAdmin.Wizards.NewPolicyWizard;
using XenAPI;
namespace XenAdmin.Dialogs.VMProtection_Recovery
namespace XenAdmin.Dialogs.ScheduledSnapshots
{
partial class VMProtectionPoliciesDialog
partial class ScheduledSnapshotsDialog
{
/// <summary>
/// Required designer variable.
@ -32,7 +31,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(VMProtectionPoliciesDialog));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScheduledSnapshotsDialog));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.dataGridView1 = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx();
this.NameColum = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -48,7 +47,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
this.buttonRunNow = new System.Windows.Forms.Button();
this.labelPolicyTitle = new System.Windows.Forms.Label();
this.buttonProperties = new System.Windows.Forms.Button();
this.policyHistory1 = new XenAdmin.Dialogs.VMProtectionRecovery.PolicyHistory();
this.policyHistory1 = new PolicyHistory();
this.label2 = new System.Windows.Forms.Label();
this.localServerTime1 = new XenAdmin.Wizards.NewPolicyWizard.LocalServerTime();
this.chevronButton1 = new XenAdmin.Controls.ChevronButton();
@ -245,13 +244,13 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
this.tableLayoutPanel5.Controls.Add(this.tableLayoutPanel4, 0, 3);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
//
// VMProtectionPoliciesDialog
// ScheduledSnapshotsDialog
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.buttonCancel;
this.Controls.Add(this.tableLayoutPanel5);
this.Name = "VMProtectionPoliciesDialog";
this.Name = "ScheduledSnapshotsDialog";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.VMProtectionPoliciesDialog_Load);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.VMProtectionPoliciesDialog_FormClosed);
@ -279,7 +278,7 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
protected System.Windows.Forms.Button buttonRunNow;
protected System.Windows.Forms.Label labelPolicyTitle;
protected System.Windows.Forms.Button buttonProperties;
protected XenAdmin.Dialogs.VMProtectionRecovery.PolicyHistory policyHistory1;
protected PolicyHistory policyHistory1;
protected System.Windows.Forms.Label label2;
protected LocalServerTime localServerTime1;
protected XenAdmin.Controls.ChevronButton chevronButton1;

View File

@ -32,28 +32,23 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Alerts;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAdmin.Wizards.NewPolicyWizard;
using XenAPI;
using System.ComponentModel;
using System.Threading;
using System.Diagnostics;
using XenAdmin.Core;
using XenAdmin.Dialogs.VMProtectionRecovery;
using XenCenterLib;
using XenAdmin.Alerts;
using System.Linq;
namespace XenAdmin.Dialogs.VMProtection_Recovery
namespace XenAdmin.Dialogs.ScheduledSnapshots
{
public partial class VMProtectionPoliciesDialog: XenDialogBase
public partial class ScheduledSnapshotsDialog: XenDialogBase
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public readonly Pool Pool;
public VMProtectionPoliciesDialog(Pool pool)
public ScheduledSnapshotsDialog(Pool pool)
: base(pool.Connection)
{
Pool = pool;
@ -62,24 +57,10 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
chevronButton1.Text = Messages.SHOW_RUN_HISTORY;
chevronButton1.Image = Properties.Resources.PDChevronDown;
policyHistory1.Visible = false;
policyHistory1.pool = pool;
RefreshPoolTitle(pool);
}
public VMProtectionPoliciesDialog() { }
protected virtual void chevronButton1_KeyDown(object sender, KeyEventArgs e) {}
protected virtual void chevronButton1_ButtonClick(object sender, EventArgs e) { }
protected virtual void buttonProperties_Click(object sender, EventArgs e) { }
protected virtual void button1_Click(object sender, EventArgs e) { }
protected virtual void buttonEnable_Click(object sender, EventArgs e) { }
protected virtual void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e) { }
protected virtual void dataGridView1_SelectionChanged(object sender, EventArgs e) { }
protected virtual void VMProtectionPoliciesDialog_Load(object sender, EventArgs e) { }
protected virtual void buttonCancel_Click(object sender, System.EventArgs e) { }
protected virtual void buttonNew_Click(object sender, System.EventArgs e) { }
protected virtual void buttonDelete_Click(object sender, EventArgs e) { }
public ScheduledSnapshotsDialog() { }
public class PolicyRow : DataGridViewRow
{
private DataGridViewTextBoxCell _name = new DataGridViewTextBoxCell();
@ -88,8 +69,8 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
private DataGridViewTextBoxCell _status = new DataGridViewTextBoxCell();
private DataGridViewTextBoxCell _nextArchiveRuntime = new DataGridViewTextBoxCell();
private DataGridViewTextAndImageCell _lastResult = new DataGridViewTextAndImageCell();
public readonly IVMPolicy _policy;
public PolicyRow(IVMPolicy policy)
public readonly VMSS _policy;
public PolicyRow(VMSS policy)
{
Cells.Add(_name);
Cells.Add(_status);
@ -118,14 +99,9 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
{
_name.Value = _policy.Name;
_numVMs.Value = _policy.VMs.FindAll(vm => _policy.Connection.Resolve(vm).is_a_real_vm).Count;
_status.Value = _policy.is_enabled ? Messages.ENABLED : Messages.DISABLED;
_status.Value = _policy.enabled ? Messages.ENABLED : Messages.DISABLED;
if (_policy.is_running)
_status.Value = Messages.RUNNING_SNAPSHOTS;
if (this._policy.hasArchive)
{
if (_policy.is_archiving)
_status.Value = Messages.RUNNING_ARCHIVE;
}
_lastResult.Value = _policy.LastResult;
if (_policy.LastResult == Messages.FAILED)
_lastResult.Image = Properties.Resources._075_WarningRound_h32bit_16;
@ -138,37 +114,10 @@ namespace XenAdmin.Dialogs.VMProtection_Recovery
_nextRunTime.Value = nextRunTime.HasValue
? HelpersGUI.DateTimeToString(nextRunTime.Value, Messages.DATEFORMAT_DMY_HM,
true)
: Messages.VM_PROTECTION_POLICY_HOST_NOT_LIVE;
if (this._policy.hasArchive)
{
DateTime? nextArchiveRuntime = GetVMPPDateTime(() => _policy.GetNextArchiveRunTime());
_nextArchiveRuntime.Value = nextArchiveRuntime.HasValue
? nextArchiveRuntime == DateTime.MinValue
? Messages.NEVER
: HelpersGUI.DateTimeToString(nextArchiveRuntime.Value,
Messages.DATEFORMAT_DMY_HM, true)
: Messages.VM_PROTECTION_POLICY_HOST_NOT_LIVE;
}
: Messages.VMSS_HOST_NOT_LIVE;
}
}
}
}
namespace XenAdmin.Dialogs.VMPolicies
{
public class VMPoliciesDialogSpecific<T> : XenAdmin.Dialogs.VMProtection_Recovery.VMProtectionPoliciesDialog where T : XenObject<T>
{
public VMPoliciesDialogSpecific() { }
public VMPoliciesDialogSpecific(Pool pool)
: base(pool)
{
RefreshPoolTitle(pool);
if (VMGroup<T>.isVMPolicyVMPP)
SetupDeprecationBanner();
}
private void RefreshPoolTitle(Pool pool)
{
int protectedVMs = 0;
@ -179,19 +128,19 @@ namespace XenAdmin.Dialogs.VMPolicies
if (vm.is_a_real_vm && vm.Show(Properties.Settings.Default.ShowHiddenVMs))
{
realVMs++;
if (vm.Connection.Resolve(VMGroup<T>.VmToGroup(vm)) != null)
if (vm.Connection.Resolve(vm.snapshot_schedule) != null)
protectedVMs++;
}
}
this.Text = VMGroup<T>.VMPolicyDialogTitle;
label2.Text = VMGroup<T>.VMPolicyDialogText;
this.Text = Messages.VMSS_DIALOG_TITLE;
label2.Text = Messages.VMSS_DIALOG_TEXT;
labelPolicyTitle.Text = string.Format(Helpers.IsPool(pool.Connection)
? VMGroup<T>.VMPolicyDialogSchedulesInPool
: VMGroup<T>.VMPolicyDialogSchedulesInServer,
? Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL
: Messages.VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER,
pool.Name.Ellipsise(45), protectedVMs, realVMs);
}
void VMPPCollectionChanged(object sender, EventArgs e)
void VMSSCollectionChanged(object sender, EventArgs e)
{
LoadPolicies();
}
@ -201,12 +150,12 @@ namespace XenAdmin.Dialogs.VMPolicies
dataGridView1.SuspendLayout();
var selectedPolicy = currentSelected;
dataGridView1.Rows.Clear();
var policyList = VMGroup<T>.VMPolicies(Pool.Connection.Cache);
var policyList = Pool.Connection.Cache.VMSSs;
/* creating a dictionary to hold (policy_uuid, message list) */
Dictionary<string, List<XenAPI.Message>> policyMessage = new Dictionary<string, List<XenAPI.Message>>();
/* populate the dictionary with policy uuid */
foreach (var policy in policyList)
@ -215,43 +164,41 @@ namespace XenAdmin.Dialogs.VMPolicies
List<XenAPI.Message> messageList = new List<XenAPI.Message>();
policyMessage.Add(policy.uuid, messageList);
}
/* iterate through all messages and populate the dictionary with message list */
var messages = Pool.Connection.Cache.Messages;
List<XenAPI.Message> value = new List<XenAPI.Message>();
if (!VMGroup<T>.isVMPolicyVMPP)
foreach (var message in messages)
{
var messages = Pool.Connection.Cache.Messages;
List<XenAPI.Message> value = new List<XenAPI.Message>();
foreach (var message in messages)
if (message.cls == cls.VMSS)
{
if (message.cls == cls.VMSS)
if (policyMessage.TryGetValue(message.obj_uuid, out value))
{
if (policyMessage.TryGetValue(message.obj_uuid, out value))
{
value.Add(message);
}
value.Add(message);
}
}
}
/* add only 10 messages for each policy and referesh the rows*/
foreach (var policy in policyList)
{
/* message list need not be always sorted */
var messageListSorted = policyMessage[policy.uuid].OrderByDescending(message => message.timestamp).ToList();
var messageListSorted =
policyMessage[policy.uuid].OrderByDescending(message => message.timestamp).ToList();
for (int messageCount = 0; messageCount < 10 && messageCount < messageListSorted.Count; messageCount++)
{
policy.PolicyAlerts.Add(new PolicyAlert(messageListSorted[messageCount].priority, messageListSorted[messageCount].name, messageListSorted[messageCount].timestamp, messageListSorted[messageCount].body, policy.Name));
policy.PolicyAlerts.Add(new PolicyAlert(messageListSorted[messageCount].priority,
messageListSorted[messageCount].name, messageListSorted[messageCount].timestamp,
messageListSorted[messageCount].body, policy.Name));
}
if (dataGridView1.ColumnCount > 0)
dataGridView1.Rows.Add(new PolicyRow(policy));
}
RefreshButtons();
RefreshButtons();
if (selectedPolicy != null)
{
foreach (PolicyRow row in dataGridView1.Rows)
@ -269,31 +216,28 @@ namespace XenAdmin.Dialogs.VMPolicies
}
protected override void buttonNew_Click(object sender, System.EventArgs e)
private void buttonNew_Click(object sender, System.EventArgs e)
{
new NewPolicyWizardSpecific<T>(Pool).Show(this);
new NewPolicyWizard(Pool).Show(this);
}
protected override void buttonCancel_Click(object sender, System.EventArgs e)
private void buttonCancel_Click(object sender, System.EventArgs e)
{
this.Close();
}
protected override void VMProtectionPoliciesDialog_Load(object sender, EventArgs e)
private void VMProtectionPoliciesDialog_Load(object sender, EventArgs e)
{
if (!VMGroup<T>.isVMPolicyVMPP)
{
this.dataGridView1.Columns["ColumnNextArchive"].Visible = false;
}
this.dataGridView1.Columns["ColumnNextArchive"].Visible = false;
LoadPolicies();
localServerTime1.GetServerTime();
Pool.Connection.Cache.RegisterBatchCollectionChanged<T>(VMPPCollectionChanged);
Pool.Connection.Cache.RegisterBatchCollectionChanged<VMSS>(VMSSCollectionChanged);
}
protected override void buttonDelete_Click(object sender, EventArgs e)
private void buttonDelete_Click(object sender, EventArgs e)
{
var selectedPolicies = new List<IVMPolicy>();
var selectedPolicies = new List<VMSS>();
int numberOfProtectedVMs = 0;
foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
@ -313,18 +257,18 @@ namespace XenAdmin.Dialogs.VMPolicies
}
using (var dlg = new ThreeButtonDialog(
new ThreeButtonDialog.Details(SystemIcons.Warning, text, Messages.DELETE_VM_PROTECTION_TITLE),
new ThreeButtonDialog.Details(SystemIcons.Warning, text, Messages.DELETE_VMSS_TITLE),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo))
{
if (dlg.ShowDialog(this) == DialogResult.Yes)
new DestroyPolicyAction<T>(Pool.Connection, selectedPolicies).RunAsync();
new DestroyPolicyAction(Pool.Connection, selectedPolicies).RunAsync();
}
}
private IVMPolicy currentSelected = null;
private VMSS currentSelected = null;
protected override void dataGridView1_SelectionChanged(object sender, EventArgs e)
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
RefreshButtons();
}
@ -334,10 +278,10 @@ namespace XenAdmin.Dialogs.VMPolicies
if (dataGridView1.SelectedRows.Count == 1)
{
currentSelected = ((PolicyRow)dataGridView1.SelectedRows[0])._policy;
buttonEnable.Text = currentSelected.is_enabled? Messages.DISABLE : Messages.ENABLE;
buttonEnable.Enabled = currentSelected.VMs.Count == 0 && !currentSelected.is_enabled? false : true;
buttonEnable.Text = currentSelected.enabled? Messages.DISABLE : Messages.ENABLE;
buttonEnable.Enabled = currentSelected.VMs.Count == 0 && !currentSelected.enabled? false : true;
buttonProperties.Enabled = true;
buttonRunNow.Enabled = currentSelected.is_enabled && !currentSelected.is_archiving && !currentSelected.is_running;
buttonRunNow.Enabled = currentSelected.enabled && !currentSelected.is_running;
}
else
@ -351,26 +295,26 @@ namespace XenAdmin.Dialogs.VMPolicies
buttonDelete.Enabled = (dataGridView1.SelectedRows.Count != 0);
}
protected override void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e)
private void VMProtectionPoliciesDialog_FormClosed(object sender, FormClosedEventArgs e)
{
Pool.Connection.Cache.DeregisterBatchCollectionChanged<T>(VMPPCollectionChanged);
Pool.Connection.Cache.DeregisterBatchCollectionChanged<VMSS>(VMSSCollectionChanged);
}
protected override void buttonEnable_Click(object sender, EventArgs e)
private void buttonEnable_Click(object sender, EventArgs e)
{
if (currentSelected != null)
{
var action = new ChangePolicyEnabledAction<T>(currentSelected);
var action = new ChangePolicyEnabledAction(currentSelected);
action.RunAsync();
}
}
protected override void button1_Click(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count == 1)
{
var policy = ((PolicyRow)dataGridView1.SelectedRows[0])._policy;
var action = new RunPolicyNowAction<T>(policy);
var action = new RunPolicyNowAction(policy);
action.Completed += action_Completed;
buttonRunNow.Enabled = false;
action.RunAsync();
@ -382,28 +326,16 @@ namespace XenAdmin.Dialogs.VMPolicies
Program.Invoke(Program.MainWindow, RefreshButtons);
}
private void SetupDeprecationBanner()
private void buttonProperties_Click(object sender, EventArgs e)
{
if (deprecationBanner != null && !Helpers.ClearwaterOrGreater(Pool.Connection))
{
deprecationBanner.AppliesToVersion = Messages.XENSERVER_6_2;
deprecationBanner.BannerType = DeprecationBanner.Type.Removal;
deprecationBanner.FeatureName = Messages.VMPP;
deprecationBanner.LinkUri = HiddenFeatures.LinkLabelHidden ? null : new Uri(InvisibleMessages.VMPR_DEPRECATION_URL);
deprecationBanner.Visible = true;
}
}
protected override void buttonProperties_Click(object sender, EventArgs e)
{
using (PropertiesDialog propertiesDialog = new PropertiesDialog((T)currentSelected))
using (PropertiesDialog propertiesDialog = new PropertiesDialog((VMSS)currentSelected))
{
propertiesDialog.ShowDialog(this);
}
}
protected override void chevronButton1_ButtonClick(object sender, EventArgs e)
private void chevronButton1_ButtonClick(object sender, EventArgs e)
{
if (chevronButton1.Text == Messages.HIDE_RUN_HISTORY)
{
@ -419,7 +351,7 @@ namespace XenAdmin.Dialogs.VMPolicies
}
}
protected override void chevronButton1_KeyDown(object sender, KeyEventArgs e)
private void chevronButton1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Space)
chevronButton1_ButtonClick(sender, e);
@ -429,11 +361,7 @@ namespace XenAdmin.Dialogs.VMPolicies
{
get
{
if (!VMGroup<T>.isVMPolicyVMPP)
{
return "VMSnapshotSchedulesDialog";
}
return "VMProtectionPoliciesDialog";
return "VMSnapshotSchedulesDialog";
}
}

View File

@ -829,7 +829,7 @@
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>VMProtectionPoliciesDialog</value>
<value>ScheduledSnapshotsDialog</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -829,7 +829,7 @@
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>VMProtectionPoliciesDialog</value>
<value>ScheduledSnapshotsDialog</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>

View File

@ -829,7 +829,7 @@
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>VMProtectionPoliciesDialog</value>
<value>ScheduledSnapshotsDialog</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>

View File

@ -38,7 +38,7 @@ using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Commands;
using XenAdmin.Core;
using XenAdmin.Dialogs.VMProtectionRecovery;
using XenAdmin.Controls;
using XenAdmin.Wizards.ImportWizard;
using XenAdmin.Wizards.NewVMApplianceWizard;
using XenAdmin.Wizards.ExportWizard;

View File

@ -1059,9 +1059,6 @@
<data name="VMAppliancesDialog" xml:space="preserve">
<value>9800</value>
</data>
<data name="VMProtectionPoliciesDialog" xml:space="preserve">
<value>6536</value>
</data>
<data name="VMSnapshotSchedulesDialog" xml:space="preserve">
<value>6551</value>
</data>

View File

@ -156,7 +156,7 @@ namespace XenAdmin
this.disasterRecoveryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.drConfigureToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.DrWizardToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.vMProtectionAndRecoveryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.VMSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.exportResourceReportPoolToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.wlbReportsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.wlbDisconnectToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
@ -207,7 +207,6 @@ namespace XenAdmin
this.startOnHostToolStripMenuItem = new XenAdmin.Commands.StartVMOnHostToolStripMenuItem();
this.toolStripSeparator20 = new System.Windows.Forms.ToolStripSeparator();
this.assignSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVMSS();
this.assignPolicyToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVMPP();
this.assignToVirtualApplianceToolStripMenuItem = new XenAdmin.Commands.AssignGroupToolStripMenuItemVM_appliance();
this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator();
this.copyVMtoSharedStorageMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
@ -287,7 +286,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.VMSnapshotScheduleToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -922,7 +920,6 @@ namespace XenAdmin
this.highAvailabilityToolStripMenuItem,
this.disasterRecoveryToolStripMenuItem,
this.VMSnapshotScheduleToolStripMenuItem,
this.vMProtectionAndRecoveryToolStripMenuItem,
this.exportResourceReportPoolToolStripMenuItem,
this.wlbReportsToolStripMenuItem,
this.wlbDisconnectToolStripMenuItem,
@ -1014,11 +1011,11 @@ namespace XenAdmin
this.DrWizardToolStripMenuItem.Name = "DrWizardToolStripMenuItem";
resources.ApplyResources(this.DrWizardToolStripMenuItem, "DrWizardToolStripMenuItem");
//
// vMProtectionAndRecoveryToolStripMenuItem
// VMSnapshotScheduleToolStripMenuItem
//
this.vMProtectionAndRecoveryToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMPP();
this.vMProtectionAndRecoveryToolStripMenuItem.Name = "vMProtectionAndRecoveryToolStripMenuItem";
resources.ApplyResources(this.vMProtectionAndRecoveryToolStripMenuItem, "vMProtectionAndRecoveryToolStripMenuItem");
this.VMSnapshotScheduleToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMSS();
this.VMSnapshotScheduleToolStripMenuItem.Name = "VMSnapshotScheduleToolStripMenuItem";
resources.ApplyResources(this.VMSnapshotScheduleToolStripMenuItem, "VMSnapshotScheduleToolStripMenuItem");
//
// exportResourceReportPoolToolStripMenuItem
//
@ -1305,7 +1302,6 @@ namespace XenAdmin
this.startOnHostToolStripMenuItem,
this.toolStripSeparator20,
this.assignSnapshotScheduleToolStripMenuItem,
this.assignPolicyToolStripMenuItem,
this.assignToVirtualApplianceToolStripMenuItem,
this.toolStripMenuItem9,
this.copyVMtoSharedStorageMenuItem,
@ -1363,11 +1359,6 @@ namespace XenAdmin
this.assignSnapshotScheduleToolStripMenuItem.Name = "assignSnapshotScheduleToolStripMenuItem";
resources.ApplyResources(this.assignSnapshotScheduleToolStripMenuItem, "assignSnapshotScheduleToolStripMenuItem");
//
// assignPolicyToolStripMenuItem
//
this.assignPolicyToolStripMenuItem.Name = "assignPolicyToolStripMenuItem";
resources.ApplyResources(this.assignPolicyToolStripMenuItem, "assignPolicyToolStripMenuItem");
//
// assignToVirtualApplianceToolStripMenuItem
//
this.assignToVirtualApplianceToolStripMenuItem.Name = "assignToVirtualApplianceToolStripMenuItem";
@ -1896,12 +1887,6 @@ namespace XenAdmin
this.statusProgressBar.Name = "statusProgressBar";
this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
//
// VMSnapshotScheduleToolStripMenuItem
//
this.VMSnapshotScheduleToolStripMenuItem.Command = new XenAdmin.Commands.VMGroupCommandVMSS();
this.VMSnapshotScheduleToolStripMenuItem.Name = "VMSnapshotScheduleToolStripMenuItem";
resources.ApplyResources(this.VMSnapshotScheduleToolStripMenuItem, "VMSnapshotScheduleToolStripMenuItem");
//
// MainWindow
//
resources.ApplyResources(this, "$this");
@ -2125,8 +2110,6 @@ namespace XenAdmin
private ToolStripMenuItem xenCenterPluginsOnlineToolStripMenuItem;
private CommandToolStripMenuItem MoveVMToolStripMenuItem;
private CommandToolStripMenuItem rollingUpgradeToolStripMenuItem;
private CommandToolStripMenuItem vMProtectionAndRecoveryToolStripMenuItem;
private AssignGroupToolStripMenuItemVMPP assignPolicyToolStripMenuItem;
private CommandToolStripMenuItem changePoolPasswordToolStripMenuItem;
private ToolStripSeparator toolStripSeparator30;
private CommandToolStripMenuItem virtualAppliancesToolStripMenuItem;

View File

@ -1689,22 +1689,16 @@ namespace XenAdmin
IXenConnection conn;
conn = SelectionManager.Selection.GetConnectionOfAllItems();
if (SelectionManager.Selection.Count > 0 && (Helpers.GetMaster(conn) != null) && (Helpers.FalconOrGreater(conn))) /* hide VMPP */
if (SelectionManager.Selection.Count > 0 && (Helpers.GetMaster(conn) != null) && (Helpers.FalconOrGreater(conn)))
{
assignSnapshotScheduleToolStripMenuItem.Available = true;
VMSnapshotScheduleToolStripMenuItem.Available = true;
assignPolicyToolStripMenuItem.Available = false;
vMProtectionAndRecoveryToolStripMenuItem.Available = false;
}
else /* hide VMSS */
{
assignSnapshotScheduleToolStripMenuItem.Available = false;
VMSnapshotScheduleToolStripMenuItem.Available = false;
assignPolicyToolStripMenuItem.Available = true;
vMProtectionAndRecoveryToolStripMenuItem.Available = true;
}
templatesToolStripMenuItem1.Checked = Properties.Settings.Default.DefaultTemplatesVisible;

View File

@ -1965,12 +1965,6 @@
<data name="VMSnapshotScheduleToolStripMenuItem.Text" xml:space="preserve">
<value>VM Snapshot Schedule Policies...</value>
</data>
<data name="vMProtectionAndRecoveryToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>277, 22</value>
</data>
<data name="vMProtectionAndRecoveryToolStripMenuItem.Text" xml:space="preserve">
<value>VM &amp;Protection Policies...</value>
</data>
<data name="exportResourceReportPoolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>277, 22</value>
</data>
@ -2245,124 +2239,124 @@
<value>Ctrl+N</value>
</data>
<data name="NewVmToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="NewVmToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;New VM...</value>
</data>
<data name="startShutdownToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="startShutdownToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Start/Shut down</value>
</data>
<data name="resumeOnToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="resumeOnToolStripMenuItem.Text" xml:space="preserve">
<value>Res&amp;ume on Server</value>
</data>
<data name="relocateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="relocateToolStripMenuItem.Text" xml:space="preserve">
<value>M&amp;igrate to Server</value>
</data>
<data name="startOnHostToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="startOnHostToolStripMenuItem.Text" xml:space="preserve">
<value>Start &amp;on Server</value>
</data>
<data name="toolStripSeparator20.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 6</value>
<value>242, 6</value>
</data>
<data name="assignSnapshotScheduleToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="assignSnapshotScheduleToolStripMenuItem.Text" xml:space="preserve">
<value>Assign to Snaps&amp;hot Schedule...</value>
</data>
<data name="assignPolicyToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
</data>
<data name="assignPolicyToolStripMenuItem.Text" xml:space="preserve">
<value>Assign to VM &amp;Protection Policy...</value>
</data>
<data name="assignToVirtualApplianceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="assignToVirtualApplianceToolStripMenuItem.Text" xml:space="preserve">
<value>Assign to &amp;vApp</value>
</data>
<data name="toolStripMenuItem9.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 6</value>
<value>242, 6</value>
</data>
<data name="copyVMtoSharedStorageMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="copyVMtoSharedStorageMenuItem.Text" xml:space="preserve">
<value>&amp;Copy VM</value>
</data>
<data name="MoveVMToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="MoveVMToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Move VM</value>
</data>
<data name="snapshotToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="snapshotToolStripMenuItem.Text" xml:space="preserve">
<value>Ta&amp;ke a Snapshot</value>
</data>
<data name="convertToTemplateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="convertToTemplateToolStripMenuItem.Text" xml:space="preserve">
<value>Convert to &amp;Template</value>
</data>
<data name="exportToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="exportToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Export...</value>
</data>
<data name="enablePVSReadcachingToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 22</value>
</data>
<data name="disablePVSReadcachingToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>245, 22</value>
</data>
<data name="toolStripMenuItem12.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 6</value>
<value>242, 6</value>
</data>
<data name="installToolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="installToolsToolStripMenuItem.Text" xml:space="preserve">
<value>Inst&amp;all [XenServer product] Tools</value>
</data>
<data name="sendCtrlAltDelToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="sendCtrlAltDelToolStripMenuItem.Text" xml:space="preserve">
<value>Send Ctrl+&amp;Alt+Del</value>
</data>
<data name="toolStripSeparator5.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 6</value>
<value>242, 6</value>
</data>
<data name="uninstallToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="uninstallToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Delete VM</value>
</data>
<data name="toolStripSeparator10.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 6</value>
<value>242, 6</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem4.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem4.Text" xml:space="preserve">
<value>PluginItemsPlaceHolder</value>
</data>
<data name="VMPropertiesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 22</value>
<value>245, 22</value>
</data>
<data name="VMPropertiesToolStripMenuItem.Text" xml:space="preserve">
<value>P&amp;roperties</value>
@ -3141,10 +3135,10 @@
<data name="&gt;&gt;DrWizardToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;vMProtectionAndRecoveryToolStripMenuItem.Name" xml:space="preserve">
<value>vMProtectionAndRecoveryToolStripMenuItem</value>
<data name="&gt;&gt;VMSnapshotScheduleToolStripMenuItem.Name" xml:space="preserve">
<value>VMSnapshotScheduleToolStripMenuItem</value>
</data>
<data name="&gt;&gt;vMProtectionAndRecoveryToolStripMenuItem.Type" xml:space="preserve">
<data name="&gt;&gt;VMSnapshotScheduleToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;exportResourceReportPoolToolStripMenuItem.Name" xml:space="preserve">
@ -3447,12 +3441,6 @@
<data name="&gt;&gt;assignSnapshotScheduleToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.AssignGroupToolStripMenuItemVMSS, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;assignPolicyToolStripMenuItem.Name" xml:space="preserve">
<value>assignPolicyToolStripMenuItem</value>
</data>
<data name="&gt;&gt;assignPolicyToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.AssignGroupToolStripMenuItemVMPP, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;assignToVirtualApplianceToolStripMenuItem.Name" xml:space="preserve">
<value>assignToVirtualApplianceToolStripMenuItem</value>
</data>
@ -3495,6 +3483,18 @@
<data name="&gt;&gt;exportToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;enablePVSReadcachingToolStripMenuItem.Name" xml:space="preserve">
<value>enablePVSReadcachingToolStripMenuItem</value>
</data>
<data name="&gt;&gt;enablePVSReadcachingToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;disablePVSReadcachingToolStripMenuItem.Name" xml:space="preserve">
<value>disablePVSReadcachingToolStripMenuItem</value>
</data>
<data name="&gt;&gt;disablePVSReadcachingToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;toolStripMenuItem12.Name" xml:space="preserve">
<value>toolStripMenuItem12</value>
</data>
@ -3897,16 +3897,10 @@
<data name="&gt;&gt;statusProgressBar.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;VMSnapshotScheduleToolStripMenuItem.Name" xml:space="preserve">
<value>VMSnapshotScheduleToolStripMenuItem</value>
</data>
<data name="&gt;&gt;VMSnapshotScheduleToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainWindow</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
</root>

View File

@ -197,12 +197,6 @@ namespace XenAdmin.SettingsPanels
labelIqnHint.Visible = true;
}
if (xenObjectCopy is VMPP)
{
lblFolder.Visible = labelTags.Visible = folderPanel.Visible = tagsPanel.Visible = false;
labelTitle.Text = Messages.GENERAL_PAGE_VMPP_SETTINGS;
}
if (xenObjectCopy is VMSS)
{
lblFolder.Visible = labelTags.Visible = folderPanel.Visible = tagsPanel.Visible = false;

View File

@ -68,15 +68,15 @@ namespace XenAdmin.TabPages
viewToolStripMenuItem.DropDown = contextMenuStripView;
this.DoubleBuffered = true;
base.Text = Messages.SNAPSHOTS_PAGE_TITLE;
dataGridView.TabIndex = TreeView.TabIndex;
DataGridView.Sorted += DataGridView_Sorted;
dataGridView.TabIndex = snapshotTreeView.TabIndex;
dataGridView.Sorted += DataGridView_Sorted;
ConnectionsManager.History.CollectionChanged += History_CollectionChanged;
}
void DataGridView_Sorted(object sender, EventArgs e)
{
switch (DataGridView.SortedColumn.Index)
switch (dataGridView.SortedColumn.Index)
{
case 0:
sortByTypeToolStripMenuItem.Checked = true;
@ -105,17 +105,6 @@ namespace XenAdmin.TabPages
}
}
public SnapshotTreeView TreeView
{
get { return this.snapshotTreeView; }
}
public DataGridView DataGridView
{
get { return this.dataGridView; }
}
public VM VM
{
set
@ -124,12 +113,12 @@ namespace XenAdmin.TabPages
if (value != null)
{
m_VM = value;
Program.Invoke(Program.MainWindow, () => TreeView.ChangeVMToSpinning(false, null));
Program.Invoke(Program.MainWindow, () => snapshotTreeView.ChangeVMToSpinning(false, null));
m_VM.Connection.Cache.RegisterBatchCollectionChanged<VM>(
VM_BatchCollectionChanged);
m_VM.PropertyChanged += snapshot_PropertyChanged;
//Version setup
toolStripMenuItemScheduledSnapshots.Available = toolStripSeparatorView.Available = (Registry.VMPRFeatureEnabled && !Helpers.ClearwaterOrGreater(VM.Connection)) || !Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule);
toolStripMenuItemScheduledSnapshots.Available = toolStripSeparatorView.Available = !Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule);
if (VM.SnapshotView != SnapshotsView.ListView)
TreeViewChecked();
else
@ -146,8 +135,7 @@ namespace XenAdmin.TabPages
BuildList();
RefreshDetailsGroupBox(true);
RefreshToolStripButtons();
RefreshVMProtectionPanel();
RefreshArchiveNowOption();
RefreshVMSSPanel();
}
}
get
@ -156,42 +144,9 @@ namespace XenAdmin.TabPages
}
}
private void RefreshArchiveNowOption()
private void RefreshVMSSPanel()
{
if(Helpers.ClearwaterOrGreater(VM.Connection))
{
archiveSnapshotNowToolStripMenuItem.Enabled = archiveSnapshotNowToolStripMenuItem.Visible = false;
archiveToolStripMenuItem.Enabled = archiveToolStripMenuItem.Visible = false;
}
else
{
archiveSnapshotNowToolStripMenuItem.Enabled = archiveSnapshotNowToolStripMenuItem.Visible = true;
archiveToolStripMenuItem.Enabled = archiveToolStripMenuItem.Visible = true;
}
}
private void RefreshVMProtectionPanel()
{
if (Registry.VMPRFeatureEnabled && !Helpers.ClearwaterOrGreater(VM.Connection))
{
panelVMPP.Visible = true;
var vmpp = VM.Connection.Resolve(VM.protection_policy);
if (vmpp == null || Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection))
{
labelVMPPInfo.Text = Messages.THIS_VM_IS_NOT_PROTECTED;
pictureBoxVMPPInfo.Image = Resources._000_BackupMetadata_h32bit_16;
linkLabelVMPPInfo.Text = Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection) ? Messages.TELL_ME_MORE : Messages.VIEW_POLICIES;
}
else
{
labelVMPPInfo.Text = string.Format(Messages.THIS_VM_IS_PROTECTED, vmpp.Name);
pictureBoxVMPPInfo.Image = Resources._000_Tick_h32bit_16;
linkLabelVMPPInfo.Text = Messages.VIEW_POLICIES;
}
}
else if (Helpers.FalconOrGreater(VM.Connection))
if (Helpers.FalconOrGreater(VM.Connection))
{
panelVMPP.Visible = true;
var vmss = VM.Connection.Resolve(VM.snapshot_schedule);
@ -224,7 +179,7 @@ namespace XenAdmin.TabPages
if (action != null)
{
string message = action is VMSnapshotCreateAction ? Messages.SNAPSHOTTING : Messages.VM_REVERTING_ELLIPSIS;
Program.Invoke(Program.MainWindow, () => TreeView.ChangeVMToSpinning(true, message));
Program.Invoke(Program.MainWindow, () => snapshotTreeView.ChangeVMToSpinning(true, message));
}
}
@ -247,10 +202,10 @@ namespace XenAdmin.TabPages
string message = createAction is VMSnapshotCreateAction
? Messages.SNAPSHOTTING
: Messages.VM_REVERTING_ELLIPSIS;
if (TreeView.SpinningMessage != Messages.SNAPSHOTTING)
if (snapshotTreeView.SpinningMessage != Messages.SNAPSHOTTING)
Program.Invoke(Program.MainWindow,
() =>
TreeView.ChangeVMToSpinning(true,
snapshotTreeView.ChangeVMToSpinning(true,
message));
}
});
@ -262,7 +217,7 @@ namespace XenAdmin.TabPages
ActionBase action = ConnectionsManager.History.Find(SpinningPredicate());
if (action == null)
{
Program.Invoke(Program.MainWindow, () => TreeView.ChangeVMToSpinning(false, null));
Program.Invoke(Program.MainWindow, () => snapshotTreeView.ChangeVMToSpinning(false, null));
}
}
@ -303,7 +258,7 @@ namespace XenAdmin.TabPages
{
if (!this.Visible)
return;
lock (TreeView)
lock (snapshotTreeView)
{
if (VM == null || VM.snapshots == null)
return;
@ -312,7 +267,7 @@ namespace XenAdmin.TabPages
if (snapshots.Count == 0)
{
TreeView.Clear();
snapshotTreeView.Clear();
TreeViewChecked();
RefreshDetailsGroupBox(true);
toolStripButtonTreeView.Enabled = toolStripButtonListView.Enabled = false; ;
@ -329,10 +284,10 @@ namespace XenAdmin.TabPages
private void SelectPreviousItemVMTreeView()
{
if (TreeView.Items.Count > 0)
if (snapshotTreeView.Items.Count > 0)
{
TreeView.Select();
foreach (ListViewItem item in TreeView.Items)
snapshotTreeView.Select();
foreach (ListViewItem item in snapshotTreeView.Items)
{
if (item.ImageIndex == SnapshotIcon.VMImageIndex)
{
@ -368,22 +323,22 @@ namespace XenAdmin.TabPages
private void RefreshTreeView(IList<VM> roots)
{
if (TreeView.Parent == null) return;
if (snapshotTreeView.Parent == null) return;
TreeView.SuspendLayout();
TreeView.BeginUpdate();
TreeView.Clear();
snapshotTreeView.SuspendLayout();
snapshotTreeView.BeginUpdate();
snapshotTreeView.Clear();
Debug.WriteLine("Start refreshing Tree");
SnapshotIcon rootIcon = null;
rootIcon = new SnapshotIcon(VM.Name, Messages.BASE, null, TreeView, SnapshotIcon.Template);
TreeView.AddSnapshot(rootIcon);
rootIcon = new SnapshotIcon(VM.Name, Messages.BASE, null, snapshotTreeView, SnapshotIcon.Template);
snapshotTreeView.AddSnapshot(rootIcon);
//Set VM
VM vmParent = VM.Connection.Resolve<VM>(VM.parent);
if (vmParent == null || !vmParent.is_a_snapshot)
{
SnapshotIcon vmIcon = new SnapshotIcon(Messages.NOW, "", rootIcon, TreeView, SnapshotIcon.VMImageIndex);
TreeView.AddSnapshot(vmIcon);
SnapshotIcon vmIcon = new SnapshotIcon(Messages.NOW, "", rootIcon, snapshotTreeView, SnapshotIcon.VMImageIndex);
snapshotTreeView.AddSnapshot(vmIcon);
}
foreach (VM root in roots)
@ -396,8 +351,8 @@ namespace XenAdmin.TabPages
else
icon = root.power_state == vm_power_state.Suspended ? SnapshotIcon.DiskAndMemorySnapshot : SnapshotIcon.DiskSnapshot;
DateTime time = root.snapshot_time.ToLocalTime() + root.Connection.ServerTimeOffset;
SnapshotIcon currentIcon = new SnapshotIcon(root.name_label, HelpersGUI.DateTimeToString(time, Messages.DATEFORMAT_DMY_HMS, true), rootIcon, TreeView, icon);
TreeView.AddSnapshot(currentIcon);
SnapshotIcon currentIcon = new SnapshotIcon(root.name_label, HelpersGUI.DateTimeToString(time, Messages.DATEFORMAT_DMY_HMS, true), rootIcon, snapshotTreeView, icon);
snapshotTreeView.AddSnapshot(currentIcon);
currentIcon.Tag = root;
BuildTree(root, currentIcon);
}
@ -405,12 +360,12 @@ namespace XenAdmin.TabPages
BuildTree(root, rootIcon);
}
if (TreeView.Items.Count < 4)
TreeView.Clear();
if (snapshotTreeView.Items.Count < 4)
snapshotTreeView.Clear();
TreeView.EndUpdate();
TreeView.ResumeLayout();
TreeView.PerformLayout();
snapshotTreeView.EndUpdate();
snapshotTreeView.ResumeLayout();
snapshotTreeView.PerformLayout();
}
@ -420,7 +375,7 @@ namespace XenAdmin.TabPages
IList<VM> snapshots = VM.Connection.ResolveAll(VM.snapshots);
if (snapshots.Count == 0)
{
TreeView.Clear();
snapshotTreeView.Clear();
TreeViewChecked();
return;
}
@ -429,8 +384,7 @@ namespace XenAdmin.TabPages
private IList<VM> RefreshDataGridView(IList<VM> snapshots)
{
DataGridView.Rows.Clear();
dataGridView.Rows.Clear();
IList<VM> roots = new List<VM>();
for (int i = 0; i < snapshots.Count; i++)
{
@ -442,7 +396,7 @@ namespace XenAdmin.TabPages
//Build DataGridView
SnapshotDataGridViewRow row = new SnapshotDataGridViewRow(snapshot);
row.Tag = snapshot;
DataGridView.Rows.Add(row);
dataGridView.Rows.Add(row);
}
VM parent = VM.Connection.Resolve<VM>(snapshot.parent);
@ -453,8 +407,8 @@ namespace XenAdmin.TabPages
}
if (DataGridView.SortedColumn == null)
DataGridView.Sort(DataGridView.Columns[1], ListSortDirection.Ascending);
if (dataGridView.SortedColumn == null)
dataGridView.Sort(dataGridView.Columns[1], ListSortDirection.Ascending);
return roots;
}
@ -536,9 +490,6 @@ namespace XenAdmin.TabPages
case "snapshots":
m_NeedToUpdate = true;
break;
case "protection_policy":
RefreshVMProtectionPanel();
break;
}
}
@ -578,8 +529,8 @@ namespace XenAdmin.TabPages
//Set VM
if (VM.Connection.Resolve<VM>(VM.parent) == currentNode)
{
SnapshotIcon vmIcon = new SnapshotIcon(Messages.NOW, "", currentIcon, TreeView, SnapshotIcon.VMImageIndex);
TreeView.AddSnapshot(vmIcon);
SnapshotIcon vmIcon = new SnapshotIcon(Messages.NOW, "", currentIcon, snapshotTreeView, SnapshotIcon.VMImageIndex);
snapshotTreeView.AddSnapshot(vmIcon);
}
//Do childs
@ -597,8 +548,8 @@ namespace XenAdmin.TabPages
else
icon = childSnapshot.power_state == vm_power_state.Suspended ? SnapshotIcon.DiskAndMemorySnapshot : SnapshotIcon.DiskSnapshot;
DateTime time = childSnapshot.snapshot_time.ToLocalTime() + childSnapshot.Connection.ServerTimeOffset;
SnapshotIcon childIcon = new SnapshotIcon(childSnapshot.name_label, HelpersGUI.DateTimeToString(time, Messages.DATEFORMAT_DMY_HMS, true), currentIcon, TreeView, icon);
TreeView.AddSnapshot(childIcon);
SnapshotIcon childIcon = new SnapshotIcon(childSnapshot.name_label, HelpersGUI.DateTimeToString(time, Messages.DATEFORMAT_DMY_HMS, true), currentIcon, snapshotTreeView, icon);
snapshotTreeView.AddSnapshot(childIcon);
childIcon.Tag = childSnapshot;
BuildTree(childSnapshot, childIcon);
}
@ -612,7 +563,7 @@ namespace XenAdmin.TabPages
{
RefreshDetailsGroupBox(false);
RefreshToolStripButtons();
TreeView.Invalidate();
snapshotTreeView.Invalidate();
}
private void RefreshToolStripButtons()
@ -624,11 +575,6 @@ namespace XenAdmin.TabPages
EnableDelete();
else
DisableAllButtons();
//Archive now
archiveSnapshotNowToolStripMenuItem.Available = CanArchive;
}
private void DisableAllButtons()
@ -801,7 +747,7 @@ namespace XenAdmin.TabPages
void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if ((TreeViewButtonsChecked && TreeView.SelectedIndices.Count >= 1) || (GridViewButtonsChecked && DataGridView.SelectedRows.Count >= 1))
if ((TreeViewButtonsChecked && snapshotTreeView.SelectedIndices.Count >= 1) || (GridViewButtonsChecked && dataGridView.SelectedRows.Count >= 1))
screenshotPictureBox.Image = (Image)e.Result;
else
{
@ -1049,15 +995,15 @@ namespace XenAdmin.TabPages
private void TreeViewChecked()
{
viewPanel.Controls.Clear();
viewPanel.Controls.Add(TreeView);
TreeView.Dock = DockStyle.Fill;
viewPanel.Controls.Add(snapshotTreeView);
snapshotTreeView.Dock = DockStyle.Fill;
TreeViewButtonsChecked = true;
VM.SnapshotView = SnapshotsView.TreeView;
GridViewButtonsChecked = false;
TreeView.SelectedItems.Clear();
foreach (DataGridViewRow row in DataGridView.SelectedRows)
snapshotTreeView.SelectedItems.Clear();
foreach (DataGridViewRow row in dataGridView.SelectedRows)
{
foreach (ListViewItem item in TreeView.Items)
foreach (ListViewItem item in snapshotTreeView.Items)
{
if (row.Tag == item.Tag)
{
@ -1072,8 +1018,8 @@ namespace XenAdmin.TabPages
private void GridViewChecked()
{
viewPanel.Controls.Clear();
viewPanel.Controls.Add(DataGridView);
DataGridView.Dock = DockStyle.Fill;
viewPanel.Controls.Add(dataGridView);
dataGridView.Dock = DockStyle.Fill;
GridViewButtonsChecked = true;
VM.SnapshotView = SnapshotsView.ListView;
TreeViewButtonsChecked = false;
@ -1098,16 +1044,16 @@ namespace XenAdmin.TabPages
{
if (TreeViewButtonsChecked)
{
if (TreeView.SelectedItems.Count == 1)
if (snapshotTreeView.SelectedItems.Count == 1)
{
return (VM)TreeView.SelectedItems[0].Tag;
return (VM)snapshotTreeView.SelectedItems[0].Tag;
}
}
else if (GridViewButtonsChecked)
{
if (DataGridView.SelectedRows.Count == 1)
if (dataGridView.SelectedRows.Count == 1)
{
return (VM)DataGridView.SelectedRows[0].Tag;
return (VM)dataGridView.SelectedRows[0].Tag;
}
}
return null;
@ -1117,10 +1063,10 @@ namespace XenAdmin.TabPages
{
if (TreeViewButtonsChecked)
{
if (TreeView.SelectedItems.Count > 0)
if (snapshotTreeView.SelectedItems.Count > 0)
{
List<VM> snapshots = new List<VM>();
foreach (ListViewItem item in TreeView.SelectedItems)
foreach (ListViewItem item in snapshotTreeView.SelectedItems)
{
VM snap = (VM)item.Tag;
if (snap != null && snap.is_a_snapshot)
@ -1135,10 +1081,10 @@ namespace XenAdmin.TabPages
}
else if (GridViewButtonsChecked)
{
if (DataGridView.SelectedRows.Count > 0)
if (dataGridView.SelectedRows.Count > 0)
{
List<VM> snapshots = new List<VM>();
foreach (DataGridViewRow row in DataGridView.SelectedRows)
foreach (DataGridViewRow row in dataGridView.SelectedRows)
{
VM snap = (VM)row.Tag;
if (snap != null && snap.is_a_snapshot)
@ -1178,9 +1124,6 @@ namespace XenAdmin.TabPages
{
contextMenuStrip.Items.Clear();
if (CanArchive)
contextMenuStrip.Items.Add(archiveToolStripMenuItem);
contextMenuStrip.Items.AddRange(new ToolStripItem[]
{
viewToolStripMenuItem,
@ -1189,14 +1132,6 @@ namespace XenAdmin.TabPages
});
}
private bool CanArchive
{
get
{
var vmpp = VM.Connection.Resolve(VM.protection_policy);
return vmpp != null;
}
}
private void SetContextMenuSnapshot()
{
@ -1214,9 +1149,6 @@ namespace XenAdmin.TabPages
exportToolStripMenuItem
});
if (CanArchive)
contextMenuStrip.Items.Add(archiveToolStripMenuItem);
contextMenuStrip.Items.AddRange(new ToolStripItem[]
{
separatorDeleteToolStripSeparator,
@ -1263,7 +1195,7 @@ namespace XenAdmin.TabPages
private void snapshotTreeView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
ListViewHitTestInfo test = TreeView.HitTest(e.Location);
ListViewHitTestInfo test = snapshotTreeView.HitTest(e.Location);
SnapshotIcon snapIcon = test.Item as SnapshotIcon;
if (snapIcon != null && snapIcon.Selectable)
revertButton_Click(sender, e);
@ -1276,21 +1208,21 @@ namespace XenAdmin.TabPages
switch (item.Name)
{
case "sortByTypeToolStripMenuItem":
DataGridView.Sort(DataGridView.Columns[0], ListSortDirection.Ascending);
DataGridView.Columns[0].HeaderCell.SortGlyphDirection = SortOrder.Ascending;
dataGridView.Sort(dataGridView.Columns[0], ListSortDirection.Ascending);
dataGridView.Columns[0].HeaderCell.SortGlyphDirection = SortOrder.Ascending;
break;
case "sortByNameToolStripMenuItem":
DataGridView.Sort(DataGridView.Columns[1], ListSortDirection.Ascending);
dataGridView.Sort(dataGridView.Columns[1], ListSortDirection.Ascending);
break;
case "sortByCreatedOnToolStripMenuItem":
DataGridView.Sort(DataGridView.Columns[2], ListSortDirection.Ascending);
dataGridView.Sort(dataGridView.Columns[2], ListSortDirection.Ascending);
break;
//case "sortBySizeToolStripMenuItem":
// DataGridView.Sort(DataGridView.Columns[3], ListSortDirection.Ascending);
// break;
}
if (item.Name != "sortByTypeToolStripMenuItem")
DataGridView.Columns[0].HeaderCell.SortGlyphDirection = SortOrder.None;
dataGridView.Columns[0].HeaderCell.SortGlyphDirection = SortOrder.None;
}
@ -1318,7 +1250,7 @@ namespace XenAdmin.TabPages
chevronButton1.Text = Messages.SHOW_DETAILS;
chevronButton1.Image = Resources.PDChevronLeft;
}
TreeView.Invalidate();
snapshotTreeView.Invalidate();
}
@ -1371,11 +1303,11 @@ namespace XenAdmin.TabPages
{
if (GridViewButtonsChecked)
{
if (DataGridView.SelectedRows.Count > 1)
if (dataGridView.SelectedRows.Count > 1)
{
SetContextMenuMultiSelection();
}
else if (DataGridView.SelectedRows.Count == 1)
else if (dataGridView.SelectedRows.Count == 1)
SetContextMenuSnapshot();
else
SetContextMenuNoneSelected();
@ -1384,17 +1316,17 @@ namespace XenAdmin.TabPages
else if (TreeViewButtonsChecked)
{
if (TreeView.SelectedItems.Count > 1)
if (snapshotTreeView.SelectedItems.Count > 1)
{
SetContextMenuMultiSelection();
}
else if (TreeView.SelectedItems.Count < 1)
else if (snapshotTreeView.SelectedItems.Count < 1)
{
SetContextMenuNoneSelected();
}
else if (TreeView.SelectedItems.Count == 1)
else if (snapshotTreeView.SelectedItems.Count == 1)
{
VM snapshot = (VM)TreeView.SelectedItems[0].Tag;
VM snapshot = (VM)snapshotTreeView.SelectedItems[0].Tag;
if (snapshot != null && snapshot.is_a_snapshot)
{
@ -1436,20 +1368,20 @@ namespace XenAdmin.TabPages
{
if (e.Button == MouseButtons.Right)
{
DataGridView.HitTestInfo hitTestInfo = DataGridView.HitTest(e.X, e.Y);
DataGridView.HitTestInfo hitTestInfo = dataGridView.HitTest(e.X, e.Y);
if (hitTestInfo.RowIndex >= 0)
{
if (DataGridView.SelectedRows.Count == 1)
DataGridView.ClearSelection();
DataGridView.Rows[hitTestInfo.RowIndex].Selected = true;
if (dataGridView.SelectedRows.Count == 1)
dataGridView.ClearSelection();
dataGridView.Rows[hitTestInfo.RowIndex].Selected = true;
}
else
{
DataGridView.ClearSelection();
dataGridView.ClearSelection();
}
contextMenuStrip.Show(DataGridView, e.X, e.Y);
contextMenuStrip.Show(dataGridView, e.X, e.Y);
}
}
@ -1458,26 +1390,26 @@ namespace XenAdmin.TabPages
{
if (e.Button == MouseButtons.Right)
{
ListViewHitTestInfo hitTestInfo = TreeView.HitTest(e.X, e.Y);
ListViewHitTestInfo hitTestInfo = snapshotTreeView.HitTest(e.X, e.Y);
if (hitTestInfo.Item != null)
{
SnapshotIcon snapshotIcon = hitTestInfo.Item as SnapshotIcon;
if (snapshotIcon != null && snapshotIcon.Selectable)
{
if (TreeView.SelectedItems.Count == 1)
TreeView.SelectedItems.Clear();
if (snapshotTreeView.SelectedItems.Count == 1)
snapshotTreeView.SelectedItems.Clear();
hitTestInfo.Item.Selected = true;
}
else
{
TreeView.SelectedItems.Clear();
snapshotTreeView.SelectedItems.Clear();
}
}
else
{
TreeView.SelectedItems.Clear();
snapshotTreeView.SelectedItems.Clear();
}
contextMenuStrip.Show(TreeView, e.X, e.Y);
contextMenuStrip.Show(snapshotTreeView, e.X, e.Y);
}
}
@ -1488,7 +1420,7 @@ namespace XenAdmin.TabPages
SnapshotIcon icon = e.Item as SnapshotIcon;
if (icon != null && icon.ImageIndex == SnapshotIcon.VMImageIndex)
{
TreeView.DoDragDrop(e.Item, DragDropEffects.Move);
snapshotTreeView.DoDragDrop(e.Item, DragDropEffects.Move);
}
}
@ -1496,15 +1428,15 @@ namespace XenAdmin.TabPages
private void snapshotTreeView_DragOver(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
Point hitPoint = TreeView.PointToClient(new Point(e.X, e.Y));
ListViewHitTestInfo info = TreeView.HitTest(hitPoint);
Point hitPoint = snapshotTreeView.PointToClient(new Point(e.X, e.Y));
ListViewHitTestInfo info = snapshotTreeView.HitTest(hitPoint);
SnapshotIcon icon = info.Item as SnapshotIcon;
if (icon != null && (icon.ImageIndex == SnapshotIcon.DiskAndMemorySnapshot || icon.ImageIndex == SnapshotIcon.DiskSnapshot))
{
icon.Selected = true;
if (TreeView.SelectedItems.Count > 1)
TreeView.SelectedItems.Clear();
if (snapshotTreeView.SelectedItems.Count > 1)
snapshotTreeView.SelectedItems.Clear();
}
}
@ -1517,8 +1449,8 @@ namespace XenAdmin.TabPages
private void snapshotTreeView_DragDrop(object sender, DragEventArgs e)
{
Point hitPoint = TreeView.PointToClient(new Point(e.X, e.Y));
ListViewHitTestInfo info = TreeView.HitTest(hitPoint);
Point hitPoint = snapshotTreeView.PointToClient(new Point(e.X, e.Y));
ListViewHitTestInfo info = snapshotTreeView.HitTest(hitPoint);
SnapshotIcon icon = info.Item as SnapshotIcon;
if (icon != null && (icon.ImageIndex == SnapshotIcon.DiskAndMemorySnapshot || icon.ImageIndex == SnapshotIcon.DiskSnapshot))
{
@ -1533,7 +1465,7 @@ namespace XenAdmin.TabPages
private void snapshotTreeView_MouseMove(object sender, MouseEventArgs e)
{
SnapshotIcon icon = TreeView.HitTest(e.X, e.Y).Item as SnapshotIcon;
SnapshotIcon icon = snapshotTreeView.HitTest(e.X, e.Y).Item as SnapshotIcon;
if (icon != null && icon.ImageIndex == SnapshotIcon.VMImageIndex)
{
this.Cursor = Cursors.Hand;
@ -1544,55 +1476,6 @@ namespace XenAdmin.TabPages
}
}
private void archiveToolStripMenuItem_Click(object sender, EventArgs e)
{
var vmpp = VM.Connection.Resolve(VM.protection_policy);
if (vmpp.archive_frequency != vmpp_archive_frequency.never)
{
var selectedSnapshots = GetSelectedSnapshots();
string text = "";
if (selectedSnapshots.Count == 1)
text = string.Format(Messages.ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE, VM.Connection.Resolve(VM.protection_policy).archive_target_config_location);
else
text = string.Format(Messages.ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE, VM.Connection.Resolve(VM.protection_policy).archive_target_config_location);
DialogResult dialogResult;
using (var dlg = new ThreeButtonDialog(
new ThreeButtonDialog.Details(SystemIcons.Information, text, Messages.ARCHIVE_VM_PROTECTION_TITLE),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo))
{
dialogResult = dlg.ShowDialog(this);
}
if (dialogResult == DialogResult.Yes)
{
foreach (var snapshot in selectedSnapshots)
{
new ArchiveNowAction(snapshot).RunAsync();
}
}
}
else
{
DialogResult dialogResult;
using (var dlg = new ThreeButtonDialog(
new ThreeButtonDialog.Details(SystemIcons.Error, Messages.POLICY_DOES_NOT_HAVE_ARCHIVE, Messages.POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo))
{
dialogResult = dlg.ShowDialog(this);
}
if (dialogResult == DialogResult.Yes)
{
using (var dialog = new PropertiesDialog(vmpp))
{
dialog.SelectNewPolicyArchivePage();
dialog.ShowDialog(this);
}
}
}
}
private void button1_Click(object sender, EventArgs e)
{
contextMenuStripView.Show(buttonView, 0, buttonView.Height);
@ -1606,45 +1489,25 @@ namespace XenAdmin.TabPages
private void linkLabelVMPPInfo_Click(object sender, LinkLabelLinkClickedEventArgs e)
{
if (Helpers.DundeeOrGreater(VM.Connection))
if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMSnapshotSchedule))
{
if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection))
{
VMGroupCommand<VMSS>.ShowUpsellDialog(this);
}
else
{
var command = new VMGroupCommand<VMSS>(Program.MainWindow, VM);
command.Execute();
}
VMGroupCommand<VMSS>.ShowUpsellDialog(this);
}
else
{
if (Helpers.FeatureForbidden(VM.Connection, Host.RestrictVMProtection))
{
VMGroupCommand<VMPP>.ShowUpsellDialog(this);
}
else
{
var command = new VMGroupCommand<VMPP>(Program.MainWindow, VM);
command.Execute();
}
var command = new VMGroupCommand<VMSS>(Program.MainWindow, VM);
command.Execute();
}
}
private void saveMenuStrip_Opening(object sender, CancelEventArgs e)
{
saveMenuStrip.Items[saveMenuStrip.Items.Count - 1].Available = CanArchive;
}
private void snapshotTreeView_Leave(object sender, EventArgs e)
{
TreeView.Invalidate();
snapshotTreeView.Invalidate();
}
private void snapshotTreeView_Enter(object sender, EventArgs e)
{
TreeView.Invalidate();
snapshotTreeView.Invalidate();
}
}
}

View File

@ -85,7 +85,6 @@ namespace XenAdmin.TabPages
this.saveVMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.archiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.separatorDeleteToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sortByToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -114,7 +113,6 @@ namespace XenAdmin.TabPages
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.saveAsTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportAsBackupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.archiveSnapshotNowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStripView = new XenAdmin.Controls.NonReopeningContextMenuStrip(this.components);
this.toolStripButtonListView = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripButtonTreeView = new System.Windows.Forms.ToolStripMenuItem();
@ -461,7 +459,6 @@ namespace XenAdmin.TabPages
this.saveVMToolStripMenuItem,
this.saveTemplateToolStripMenuItem,
this.exportToolStripMenuItem,
this.archiveToolStripMenuItem,
this.separatorDeleteToolStripSeparator,
this.viewToolStripMenuItem,
this.sortByToolStripMenuItem,
@ -507,12 +504,6 @@ namespace XenAdmin.TabPages
resources.ApplyResources(this.exportToolStripMenuItem, "exportToolStripMenuItem");
this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportSnapshotToolStripMenuItem_Click);
//
// archiveToolStripMenuItem
//
this.archiveToolStripMenuItem.Name = "archiveToolStripMenuItem";
resources.ApplyResources(this.archiveToolStripMenuItem, "archiveToolStripMenuItem");
this.archiveToolStripMenuItem.Click += new System.EventHandler(this.archiveToolStripMenuItem_Click);
//
// separatorDeleteToolStripSeparator
//
this.separatorDeleteToolStripSeparator.Name = "separatorDeleteToolStripSeparator";
@ -696,11 +687,9 @@ namespace XenAdmin.TabPages
this.saveAsVMToolStripMenuItem,
this.toolStripSeparator2,
this.saveAsTemplateToolStripMenuItem,
this.exportAsBackupToolStripMenuItem,
this.archiveSnapshotNowToolStripMenuItem});
this.exportAsBackupToolStripMenuItem});
this.saveMenuStrip.Name = "saveMenuStrip";
resources.ApplyResources(this.saveMenuStrip, "saveMenuStrip");
this.saveMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.saveMenuStrip_Opening);
//
// saveAsVMToolStripMenuItem
//
@ -726,12 +715,6 @@ namespace XenAdmin.TabPages
resources.ApplyResources(this.exportAsBackupToolStripMenuItem, "exportAsBackupToolStripMenuItem");
this.exportAsBackupToolStripMenuItem.Click += new System.EventHandler(this.exportAsBackupToolStripMenuItem_Click);
//
// archiveSnapshotNowToolStripMenuItem
//
this.archiveSnapshotNowToolStripMenuItem.Name = "archiveSnapshotNowToolStripMenuItem";
resources.ApplyResources(this.archiveSnapshotNowToolStripMenuItem, "archiveSnapshotNowToolStripMenuItem");
this.archiveSnapshotNowToolStripMenuItem.Click += new System.EventHandler(this.archiveToolStripMenuItem_Click);
//
// contextMenuStripView
//
this.contextMenuStripView.ImageScalingSize = new System.Drawing.Size(20, 20);
@ -868,7 +851,6 @@ namespace XenAdmin.TabPages
private ToolTipContainer toolTipContainerRevertButton;
private Label labelModeTitle;
private Label labelMode;
private ToolStripMenuItem archiveToolStripMenuItem;
private Panel panelPropertiesColumn;
private Panel panelVMPP;
private Label labelVMPPInfo;
@ -880,7 +862,6 @@ namespace XenAdmin.TabPages
private ToolStripMenuItem toolStripButtonTreeView;
private ToolStripSeparator toolStripSeparatorView;
private ToolStripMenuItem toolStripMenuItemScheduledSnapshots;
private ToolStripMenuItem archiveSnapshotNowToolStripMenuItem;
private ToolStripSeparator toolStripSeparator2;
private DataGridViewTextBoxColumn Live;
private DataGridViewTextBoxColumn Snapshot;

View File

@ -1411,7 +1411,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;pageContainerPanel.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<metadata name="contextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>105, 0</value>
@ -1449,12 +1449,6 @@
<data name="exportToolStripMenuItem.Text" xml:space="preserve">
<value>E&amp;xport to File...</value>
</data>
<data name="archiveToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>209, 22</value>
</data>
<data name="archiveToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Archive Now</value>
</data>
<data name="separatorDeleteToolStripSeparator.Size" type="System.Drawing.Size, System.Drawing">
<value>206, 6</value>
</data>
@ -1513,7 +1507,7 @@
<value>P&amp;roperties</value>
</data>
<data name="contextMenuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>210, 242</value>
<value>210, 220</value>
</data>
<data name="&gt;&gt;contextMenuStrip.Name" xml:space="preserve">
<value>contextMenuStrip</value>
@ -1788,14 +1782,8 @@
<data name="exportAsBackupToolStripMenuItem.Text" xml:space="preserve">
<value>E&amp;xport to File...</value>
</data>
<data name="archiveSnapshotNowToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>209, 22</value>
</data>
<data name="archiveSnapshotNowToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Archive Now</value>
</data>
<data name="saveMenuStrip.Size" type="System.Drawing.Size, System.Drawing">
<value>210, 98</value>
<value>210, 76</value>
</data>
<data name="&gt;&gt;saveMenuStrip.Name" xml:space="preserve">
<value>saveMenuStrip</value>
@ -1890,12 +1878,6 @@
<data name="&gt;&gt;exportToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;archiveToolStripMenuItem.Name" xml:space="preserve">
<value>archiveToolStripMenuItem</value>
</data>
<data name="&gt;&gt;archiveToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;separatorDeleteToolStripSeparator.Name" xml:space="preserve">
<value>separatorDeleteToolStripSeparator</value>
</data>
@ -2016,12 +1998,6 @@
<data name="&gt;&gt;exportAsBackupToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;archiveSnapshotNowToolStripMenuItem.Name" xml:space="preserve">
<value>archiveSnapshotNowToolStripMenuItem</value>
</data>
<data name="&gt;&gt;archiveSnapshotNowToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripButtonListView.Name" xml:space="preserve">
<value>toolStripButtonListView</value>
</data>

View File

@ -218,16 +218,13 @@ namespace XenAdmin.Wizards.GenericPages
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
if (!VMGroup<T>.isQuescingSupported)
{
this.dataGridView1.Columns["ColumnQuiesceSupported"].Visible = false;
}
RefreshTab(null);
}
private T _group = null;
private void RefreshTab(T group)
{
ColumnQuiesceSupported.Visible = VMGroup<T>.isQuescingSupported;
_group = group;
if (Pool != null)
{

View File

@ -1,366 +0,0 @@
namespace XenAdmin.Wizards.NewPolicyWizard
{
partial class NewPolicyArchivePage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewPolicyArchivePage));
this.radioButtonArchiveWeekly = new System.Windows.Forms.RadioButton();
this.radioButtonArchiveDaily = new System.Windows.Forms.RadioButton();
this.radioButtonArchiveASAP = new System.Windows.Forms.RadioButton();
this.radioButtonDoNotArchive = new System.Windows.Forms.RadioButton();
this.m_tlpDestination = new System.Windows.Forms.TableLayoutPanel();
this.label2 = new System.Windows.Forms.Label();
this.textBoxPath = new System.Windows.Forms.TextBox();
this.buttonTest = new System.Windows.Forms.Button();
this.pictureBoxTest = new System.Windows.Forms.PictureBox();
this.checkBoxCredentials = new System.Windows.Forms.CheckBox();
this.m_tlpCredentials = new System.Windows.Forms.TableLayoutPanel();
this.labelUser = new System.Windows.Forms.Label();
this.textBoxUser = new System.Windows.Forms.TextBox();
this.labelPassword = new System.Windows.Forms.Label();
this.textBoxPassword = new System.Windows.Forms.TextBox();
this.m_labelError = new XenAdmin.Controls.Common.AutoHeightLabel();
this.toolTipContainer1 = new XenAdmin.Controls.ToolTipContainer();
this.labelDivider = new System.Windows.Forms.Label();
this.labelRecurDaily = new System.Windows.Forms.Label();
this.dateTimePickerDaily = new XenAdmin.Controls.DateTimeMinutes15();
this.daysWeekCheckboxes1 = new XenAdmin.Wizards.NewPolicyWizard.DaysWeekCheckboxes();
this.labelDays = new System.Windows.Forms.Label();
this.labelRecurWeekly = new System.Windows.Forms.Label();
this.dateTimePickerWeekly = new XenAdmin.Controls.DateTimeMinutes15();
this.localServerTime1 = new XenAdmin.Wizards.NewPolicyWizard.LocalServerTime();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.autoHeightLabel1 = new XenAdmin.Controls.Common.AutoHeightLabel();
this.sectionLabelSchedule = new XenAdmin.Controls.SectionHeaderLabel();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.m_tlpRecur = new System.Windows.Forms.TableLayoutPanel();
this.sectionLabelDest = new XenAdmin.Controls.SectionHeaderLabel();
this.m_tlpDestination.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxTest)).BeginInit();
this.m_tlpCredentials.SuspendLayout();
this.toolTipContainer1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.m_tlpRecur.SuspendLayout();
this.SuspendLayout();
//
// radioButtonArchiveWeekly
//
resources.ApplyResources(this.radioButtonArchiveWeekly, "radioButtonArchiveWeekly");
this.radioButtonArchiveWeekly.Name = "radioButtonArchiveWeekly";
this.radioButtonArchiveWeekly.UseVisualStyleBackColor = true;
this.radioButtonArchiveWeekly.CheckedChanged += new System.EventHandler(this.radioButtonArchiveWeekly_CheckedChanged);
//
// radioButtonArchiveDaily
//
resources.ApplyResources(this.radioButtonArchiveDaily, "radioButtonArchiveDaily");
this.radioButtonArchiveDaily.Name = "radioButtonArchiveDaily";
this.radioButtonArchiveDaily.TabStop = true;
this.radioButtonArchiveDaily.UseVisualStyleBackColor = true;
this.radioButtonArchiveDaily.CheckedChanged += new System.EventHandler(this.radioButtonArchiveDaily_CheckedChanged);
//
// radioButtonArchiveASAP
//
resources.ApplyResources(this.radioButtonArchiveASAP, "radioButtonArchiveASAP");
this.radioButtonArchiveASAP.Name = "radioButtonArchiveASAP";
this.radioButtonArchiveASAP.UseVisualStyleBackColor = true;
this.radioButtonArchiveASAP.CheckedChanged += new System.EventHandler(this.radioButtonArchiveASAP_CheckedChanged);
//
// radioButtonDoNotArchive
//
resources.ApplyResources(this.radioButtonDoNotArchive, "radioButtonDoNotArchive");
this.radioButtonDoNotArchive.Name = "radioButtonDoNotArchive";
this.radioButtonDoNotArchive.UseVisualStyleBackColor = true;
this.radioButtonDoNotArchive.CheckedChanged += new System.EventHandler(this.radioButtonDoNotArchive_CheckedChanged);
//
// m_tlpDestination
//
resources.ApplyResources(this.m_tlpDestination, "m_tlpDestination");
this.m_tlpDestination.Controls.Add(this.label2, 0, 0);
this.m_tlpDestination.Controls.Add(this.textBoxPath, 1, 0);
this.m_tlpDestination.Controls.Add(this.buttonTest, 2, 0);
this.m_tlpDestination.Controls.Add(this.pictureBoxTest, 3, 0);
this.m_tlpDestination.Controls.Add(this.checkBoxCredentials, 0, 2);
this.m_tlpDestination.Controls.Add(this.m_tlpCredentials, 0, 3);
this.m_tlpDestination.Controls.Add(this.m_labelError, 1, 1);
this.m_tlpDestination.Name = "m_tlpDestination";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// textBoxPath
//
resources.ApplyResources(this.textBoxPath, "textBoxPath");
this.textBoxPath.Name = "textBoxPath";
this.textBoxPath.TextChanged += new System.EventHandler(this.textBoxPath_TextChanged);
//
// buttonTest
//
resources.ApplyResources(this.buttonTest, "buttonTest");
this.buttonTest.Name = "buttonTest";
this.buttonTest.UseVisualStyleBackColor = true;
this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click);
//
// pictureBoxTest
//
resources.ApplyResources(this.pictureBoxTest, "pictureBoxTest");
this.pictureBoxTest.Cursor = System.Windows.Forms.Cursors.Default;
this.pictureBoxTest.Image = global::XenAdmin.Properties.Resources.ajax_loader;
this.pictureBoxTest.Name = "pictureBoxTest";
this.pictureBoxTest.TabStop = false;
//
// checkBoxCredentials
//
resources.ApplyResources(this.checkBoxCredentials, "checkBoxCredentials");
this.m_tlpDestination.SetColumnSpan(this.checkBoxCredentials, 4);
this.checkBoxCredentials.Name = "checkBoxCredentials";
this.checkBoxCredentials.UseVisualStyleBackColor = true;
this.checkBoxCredentials.CheckedChanged += new System.EventHandler(this.checkBoxCredentials_CheckedChanged);
//
// m_tlpCredentials
//
resources.ApplyResources(this.m_tlpCredentials, "m_tlpCredentials");
this.m_tlpDestination.SetColumnSpan(this.m_tlpCredentials, 2);
this.m_tlpCredentials.Controls.Add(this.labelUser, 1, 0);
this.m_tlpCredentials.Controls.Add(this.textBoxUser, 2, 0);
this.m_tlpCredentials.Controls.Add(this.labelPassword, 3, 0);
this.m_tlpCredentials.Controls.Add(this.textBoxPassword, 4, 0);
this.m_tlpCredentials.Name = "m_tlpCredentials";
//
// labelUser
//
resources.ApplyResources(this.labelUser, "labelUser");
this.labelUser.Name = "labelUser";
//
// textBoxUser
//
resources.ApplyResources(this.textBoxUser, "textBoxUser");
this.textBoxUser.Name = "textBoxUser";
this.textBoxUser.TextChanged += new System.EventHandler(this.textBoxUser_TextChanged);
//
// labelPassword
//
resources.ApplyResources(this.labelPassword, "labelPassword");
this.labelPassword.Name = "labelPassword";
//
// textBoxPassword
//
resources.ApplyResources(this.textBoxPassword, "textBoxPassword");
this.textBoxPassword.Name = "textBoxPassword";
this.textBoxPassword.TextChanged += new System.EventHandler(this.textBoxPassword_TextChanged);
//
// m_labelError
//
resources.ApplyResources(this.m_labelError, "m_labelError");
this.m_labelError.ForeColor = System.Drawing.Color.Red;
this.m_labelError.Name = "m_labelError";
//
// toolTipContainer1
//
resources.ApplyResources(this.toolTipContainer1, "toolTipContainer1");
this.toolTipContainer1.Controls.Add(this.radioButtonArchiveDaily);
this.toolTipContainer1.Name = "toolTipContainer1";
this.toolTipContainer1.TabStop = true;
//
// labelDivider
//
this.labelDivider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
resources.ApplyResources(this.labelDivider, "labelDivider");
this.labelDivider.Name = "labelDivider";
this.tableLayoutPanel5.SetRowSpan(this.labelDivider, 4);
//
// labelRecurDaily
//
resources.ApplyResources(this.labelRecurDaily, "labelRecurDaily");
this.labelRecurDaily.Name = "labelRecurDaily";
//
// dateTimePickerDaily
//
resources.ApplyResources(this.dateTimePickerDaily, "dateTimePickerDaily");
this.dateTimePickerDaily.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePickerDaily.Name = "dateTimePickerDaily";
this.dateTimePickerDaily.ShowUpDown = true;
this.dateTimePickerDaily.Value = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
//
// daysWeekCheckboxes1
//
resources.ApplyResources(this.daysWeekCheckboxes1, "daysWeekCheckboxes1");
this.m_tlpRecur.SetColumnSpan(this.daysWeekCheckboxes1, 2);
this.daysWeekCheckboxes1.Days = "";
this.daysWeekCheckboxes1.Name = "daysWeekCheckboxes1";
//
// labelDays
//
resources.ApplyResources(this.labelDays, "labelDays");
this.m_tlpRecur.SetColumnSpan(this.labelDays, 2);
this.labelDays.Name = "labelDays";
//
// labelRecurWeekly
//
resources.ApplyResources(this.labelRecurWeekly, "labelRecurWeekly");
this.labelRecurWeekly.Name = "labelRecurWeekly";
//
// dateTimePickerWeekly
//
resources.ApplyResources(this.dateTimePickerWeekly, "dateTimePickerWeekly");
this.dateTimePickerWeekly.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePickerWeekly.Name = "dateTimePickerWeekly";
this.dateTimePickerWeekly.ShowUpDown = true;
this.dateTimePickerWeekly.Value = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
//
// localServerTime1
//
resources.ApplyResources(this.localServerTime1, "localServerTime1");
this.localServerTime1.Name = "localServerTime1";
this.localServerTime1.TabStop = false;
//
// tableLayoutPanel2
//
resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2");
this.tableLayoutPanel2.Controls.Add(this.autoHeightLabel1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.sectionLabelSchedule, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.localServerTime1, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel4, 0, 3);
this.tableLayoutPanel2.Controls.Add(this.sectionLabelDest, 0, 4);
this.tableLayoutPanel2.Controls.Add(this.m_tlpDestination, 0, 5);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
//
// autoHeightLabel1
//
resources.ApplyResources(this.autoHeightLabel1, "autoHeightLabel1");
this.autoHeightLabel1.Name = "autoHeightLabel1";
//
// sectionLabelSchedule
//
resources.ApplyResources(this.sectionLabelSchedule, "sectionLabelSchedule");
this.sectionLabelSchedule.LineColor = System.Drawing.SystemColors.Window;
this.sectionLabelSchedule.LineLocation = XenAdmin.Controls.SectionHeaderLabel.VerticalAlignment.Middle;
this.sectionLabelSchedule.Name = "sectionLabelSchedule";
this.sectionLabelSchedule.TabStop = false;
//
// tableLayoutPanel4
//
resources.ApplyResources(this.tableLayoutPanel4, "tableLayoutPanel4");
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel5, 0, 0);
this.tableLayoutPanel4.Controls.Add(this.m_tlpRecur, 1, 0);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
//
// tableLayoutPanel5
//
resources.ApplyResources(this.tableLayoutPanel5, "tableLayoutPanel5");
this.tableLayoutPanel5.Controls.Add(this.radioButtonDoNotArchive, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.radioButtonArchiveASAP, 0, 1);
this.tableLayoutPanel5.Controls.Add(this.toolTipContainer1, 0, 2);
this.tableLayoutPanel5.Controls.Add(this.radioButtonArchiveWeekly, 0, 3);
this.tableLayoutPanel5.Controls.Add(this.labelDivider, 1, 0);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
//
// m_tlpRecur
//
resources.ApplyResources(this.m_tlpRecur, "m_tlpRecur");
this.m_tlpRecur.Controls.Add(this.labelRecurDaily, 0, 0);
this.m_tlpRecur.Controls.Add(this.dateTimePickerDaily, 1, 0);
this.m_tlpRecur.Controls.Add(this.labelRecurWeekly, 0, 1);
this.m_tlpRecur.Controls.Add(this.dateTimePickerWeekly, 1, 1);
this.m_tlpRecur.Controls.Add(this.labelDays, 0, 2);
this.m_tlpRecur.Controls.Add(this.daysWeekCheckboxes1, 0, 3);
this.m_tlpRecur.Name = "m_tlpRecur";
//
// sectionLabelDest
//
resources.ApplyResources(this.sectionLabelDest, "sectionLabelDest");
this.sectionLabelDest.LineColor = System.Drawing.SystemColors.Window;
this.sectionLabelDest.LineLocation = XenAdmin.Controls.SectionHeaderLabel.VerticalAlignment.Middle;
this.sectionLabelDest.Name = "sectionLabelDest";
this.sectionLabelDest.TabStop = false;
//
// NewPolicyArchivePage
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanel2);
this.Name = "NewPolicyArchivePage";
this.m_tlpDestination.ResumeLayout(false);
this.m_tlpDestination.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxTest)).EndInit();
this.m_tlpCredentials.ResumeLayout(false);
this.m_tlpCredentials.PerformLayout();
this.toolTipContainer1.ResumeLayout(false);
this.toolTipContainer1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel5.PerformLayout();
this.m_tlpRecur.ResumeLayout(false);
this.m_tlpRecur.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RadioButton radioButtonArchiveWeekly;
private System.Windows.Forms.RadioButton radioButtonArchiveDaily;
private System.Windows.Forms.RadioButton radioButtonArchiveASAP;
private System.Windows.Forms.RadioButton radioButtonDoNotArchive;
private System.Windows.Forms.Label labelPassword;
private System.Windows.Forms.TextBox textBoxPassword;
private System.Windows.Forms.Label labelUser;
private System.Windows.Forms.TextBox textBoxUser;
private System.Windows.Forms.Button buttonTest;
private System.Windows.Forms.CheckBox checkBoxCredentials;
private System.Windows.Forms.Label labelRecurDaily;
private XenAdmin.Controls.DateTimeMinutes15 dateTimePickerDaily;
private DaysWeekCheckboxes daysWeekCheckboxes1;
private System.Windows.Forms.Label labelDays;
private System.Windows.Forms.Label labelRecurWeekly;
private XenAdmin.Controls.DateTimeMinutes15 dateTimePickerWeekly;
private System.Windows.Forms.PictureBox pictureBoxTest;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TableLayoutPanel m_tlpCredentials;
private System.Windows.Forms.Label labelDivider;
private LocalServerTime localServerTime1;
private XenAdmin.Controls.ToolTipContainer toolTipContainer1;
private System.Windows.Forms.TableLayoutPanel m_tlpDestination;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private XenAdmin.Controls.Common.AutoHeightLabel autoHeightLabel1;
private XenAdmin.Controls.SectionHeaderLabel sectionLabelSchedule;
private XenAdmin.Controls.SectionHeaderLabel sectionLabelDest;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.TableLayoutPanel m_tlpRecur;
private XenAdmin.Controls.Common.AutoHeightLabel m_labelError;
private System.Windows.Forms.TextBox textBoxPath;
}
}

View File

@ -1,592 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAdmin.Dialogs;
using XenAdmin.SettingsPanels;
using XenAdmin.Wizards.NewSRWizard_Pages;
using XenAPI;
namespace XenAdmin.Wizards.NewPolicyWizard
{
public partial class NewPolicyArchivePage : XenTabPage, IEditPage
{
public NewPolicyArchivePage()
{
InitializeComponent();
CueBannersManager.SetWatermark(textBoxPath, Messages.ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH);
m_labelError.Visible = false;
radioButtonDoNotArchive.Checked = true;
ArchiveTargetType = vmpp_archive_target_type.none;
daysWeekCheckboxes1.CheckBoxChanged += checkBox_CheckedChanged;
}
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
RefreshEnablementCheckBoxes();
}
private void RefreshEnablementCheckBoxes()
{
if ((_clone == null && daysWeekCheckboxes1.Days != "" && BackupDaysCount <= daysWeekCheckboxes1.Days.Split(',').Length) && SnapshotFrequency == vmpp_backup_frequency.weekly
|| (_clone != null && daysWeekCheckboxes1.Days != "" && new List<DayOfWeek>(_clone.DaysOfWeekBackup).Count <= daysWeekCheckboxes1.Days.Split(',').Length) && _clone.backup_frequency == vmpp_backup_frequency.weekly)
daysWeekCheckboxes1.DisableUnSelected();
else
daysWeekCheckboxes1.EnableAll();
OnPageUpdated();
EnableOkButton();
}
public override string Text
{
get
{
return Messages.ARCHIVE_SNAPSHOTS;
}
}
public string SubText
{
get { return NewPolicyWizardSpecific<VMPP>.FormatSchedule(Schedule, ArchiveFrequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); }
}
public override string HelpID
{
get { return "Archivesnapshots"; }
}
public Image Image
{
get { return Properties.Resources._000_BackupMetadata_h32bit_16; }
}
public override string PageTitle
{
get
{
return Messages.ARCHIVE_SNAPSHOTS_TITLE;
}
}
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
RefreshDailyEnabled(SnapshotFrequency);
}
public vmpp_backup_frequency SnapshotFrequency { private get; set; }
public int BackupDaysCount { private get; set; }
private void RepositionArchiveDailyRadioButton()
{
tableLayoutPanel5.SuspendLayout();
try
{
//Enabled radioButtonArchiveDaily should be in one container with other radio buttons
if (radioButtonArchiveDaily.Enabled && radioButtonArchiveDaily.Parent == toolTipContainer1)
{
toolTipContainer1.Controls.Remove(radioButtonArchiveDaily);
radioButtonArchiveDaily.Dock = DockStyle.None;
tableLayoutPanel5.Controls.Add(radioButtonArchiveDaily, 0, 2);
toolTipContainer1.Visible = false;
}
//Disabled radioButtonArchiveDaily should be in the toolTipContainer1 to display tool tip correctly
if (!radioButtonArchiveDaily.Enabled && radioButtonArchiveDaily.Parent == tableLayoutPanel5)
{
tableLayoutPanel5.Controls.Remove(radioButtonArchiveDaily);
radioButtonArchiveDaily.Dock = DockStyle.Fill;
toolTipContainer1.Controls.Add(radioButtonArchiveDaily);
toolTipContainer1.Visible = true;
}
}
finally
{
tableLayoutPanel5.ResumeLayout();
}
}
private void RefreshDailyEnabled(vmpp_backup_frequency snapshotFrequency)
{
bool controlsEnabled = snapshotFrequency != vmpp_backup_frequency.weekly;
radioButtonArchiveDaily.Enabled = dateTimePickerDaily.Enabled = controlsEnabled;
RepositionArchiveDailyRadioButton();
if (controlsEnabled)
toolTipContainer1.RemoveAll();
else
toolTipContainer1.SetToolTip(Messages.CANNOT_CONFIGURE_MORE_FREQ_ARCHIVE);
}
public vmpp_archive_frequency ArchiveFrequency
{
get
{
if (radioButtonDoNotArchive.Checked)
return vmpp_archive_frequency.never;
else if (radioButtonArchiveASAP.Checked)
return vmpp_archive_frequency.always_after_backup;
else if (radioButtonArchiveDaily.Checked)
return vmpp_archive_frequency.daily;
else if (radioButtonArchiveWeekly.Checked)
return vmpp_archive_frequency.weekly;
else return vmpp_archive_frequency.unknown;
}
}
public Dictionary<string, string> ArchiveConfig
{
get
{
var result = new Dictionary<string, string>();
if (ArchiveFrequency != vmpp_archive_frequency.never)
{
result.Add("location", textBoxPath.Text);
if (ArchiveTargetType == vmpp_archive_target_type.cifs && checkBoxCredentials.Checked)
{
result.Add("username", textBoxUser.Text);
result.Add("password", textBoxPassword.Text);
}
}
return result;
}
}
private bool ValidateArchiveScheduleDetails
{
get
{
return radioButtonArchiveDaily.Checked || radioButtonArchiveWeekly.Checked ||
radioButtonArchiveASAP.Checked;
}
}
private bool IsPathValid
{
get
{
return (pathTestStatus == PathTestStatus.NotStarted || pathTestStatus == PathTestStatus.Success) &&
(ArchiveTargetType == vmpp_archive_target_type.cifs ||
ArchiveTargetType == vmpp_archive_target_type.nfs);
}
}
private bool DifferentUserCredentialsRequired
{
get { return ArchiveTargetType == vmpp_archive_target_type.cifs && checkBoxCredentials.Checked; }
}
public override bool EnableNext()
{
if (pathTestStatus == PathTestStatus.InProgress)
return false;
if (ValidateArchiveScheduleDetails)
{
if (!IsPathValid)
return false;
if (radioButtonArchiveWeekly.Checked && daysWeekCheckboxes1.Days == "")
return false;
if (radioButtonArchiveDaily.Checked && !radioButtonArchiveDaily.Enabled)
return false;
if (DifferentUserCredentialsRequired)
return !string.IsNullOrEmpty(textBoxUser.Text);
}
return true;
}
public Dictionary<string, string> Schedule
{
get
{
var result = new Dictionary<string, string>();
if (ArchiveFrequency == vmpp_archive_frequency.daily || ArchiveFrequency == vmpp_archive_frequency.weekly)
{
result.Add("hour", radioButtonArchiveDaily.Checked ? dateTimePickerDaily.Value.Hour.ToString() : dateTimePickerWeekly.Value.Hour.ToString());
result.Add("min", radioButtonArchiveDaily.Checked ? dateTimePickerDaily.Value.Minute.ToString() : dateTimePickerWeekly.Value.Minute.ToString());
}
if (ArchiveFrequency == vmpp_archive_frequency.weekly)
{
result.Add("days", daysWeekCheckboxes1.Days);
}
return result;
}
}
private void RefreshTab(VMPP vmpp)
{
sectionLabelSchedule.LineColor = sectionLabelDest.LineColor =
PropertiesDialog == null ? SystemColors.Window : SystemColors.ActiveBorder;
switch (vmpp.archive_frequency)
{
case vmpp_archive_frequency.always_after_backup:
radioButtonArchiveASAP.Checked = true;
break;
case vmpp_archive_frequency.daily:
radioButtonArchiveDaily.Checked = true;
dateTimePickerDaily.Value = new DateTime(1970, 1, 1, Convert.ToInt32(vmpp.archive_schedule["hour"]),
Convert.ToInt32(vmpp.archive_schedule["min"]), 0);
break;
case vmpp_archive_frequency.weekly:
radioButtonArchiveWeekly.Checked = true;
dateTimePickerWeekly.Value = new DateTime(1970, 1, 1, Convert.ToInt32(vmpp.archive_schedule["hour"]),
Convert.ToInt32(vmpp.archive_schedule["min"]), 0);
daysWeekCheckboxes1.Days = vmpp.archive_schedule["days"];
break;
case vmpp_archive_frequency.never:
radioButtonDoNotArchive.Checked = true;
break;
}
if (vmpp.archive_frequency != vmpp_archive_frequency.never)
{
if (vmpp.archive_target_type == vmpp_archive_target_type.nfs)
{
textBoxPath.Text = vmpp.archive_target_config_location;
}
else
{
textBoxPath.Text = vmpp.archive_target_config_location;
}
if (vmpp.archive_target_type == vmpp_archive_target_type.cifs)
{
if (vmpp.archive_target_config_username != "")
{
checkBoxCredentials.Checked = true;
textBoxUser.Text = vmpp.archive_target_config_username;
textBoxPassword.Text = vmpp.archive_target_config_password_value;
}
}
}
RefreshDailyEnabled(vmpp.backup_frequency);
RefreshEnablementCheckBoxes();
}
private Pool _pool;
public Pool Pool
{
get { return _pool; }
set
{
_pool = value;
localServerTime1.Pool = value;
}
}
private void buttonTest_Click(object sender, EventArgs e)
{
TestPath();
}
private enum PathTestStatus { NotStarted, InProgress, Success, Error }
private PathTestStatus pathTestStatus = PathTestStatus.NotStarted;
private void ResetPathTestStatus()
{
if (pathTestStatus != PathTestStatus.NotStarted)
{
m_labelError.Visible = false;
pictureBoxTest.Visible = false;
pathTestStatus = PathTestStatus.NotStarted;
}
}
private void TestPath()
{
textBoxPath.Enabled = false;
m_labelError.Visible = false;
pictureBoxTest.Image = Properties.Resources.ajax_loader;
pictureBoxTest.Visible = true;
var archiveConfig = ArchiveConfig;
//todo: get string for archive destination
archiveConfig.Add("type", vmpp_archive_target_type_helper.ToString(ArchiveTargetType));
var action = new TestArchiveTargetAction(Pool.Connection, archiveConfig);
action.Completed += action_Completed;
// mark test as in progress; this will disable the Next button (or OK button for Properties dialog) until the test is complete
pathTestStatus = PathTestStatus.InProgress;
OnPageUpdated();
EnableOkButton();
action.RunAsync();
}
private void action_Completed(ActionBase sender)
{
AsyncAction action = (AsyncAction)sender;
Program.Invoke(this, () =>
{
if (action.Result != "True" || action.Result == null)
{
m_labelError.Visible = true;
pathTestStatus = PathTestStatus.Error;
pictureBoxTest.Image = Properties.Resources._000_Abort_h32bit_16;
}
else
{
pathTestStatus = PathTestStatus.Success;
pictureBoxTest.Image = Properties.Resources._000_Tick_h32bit_16;
}
textBoxPath.Enabled = true;
OnPageUpdated();
EnableOkButton();
});
}
public vmpp_archive_target_type ArchiveTargetType { get; private set; }
public AsyncAction SaveSettings()
{
_clone.archive_frequency = ArchiveFrequency;
_clone.archive_schedule = Schedule;
_clone.archive_target_type = ArchiveTargetType;
_clone.archive_target_config = ArchiveConfig;
return null;
}
private VMPP _clone;
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
if (_clone != null && clone == null)
{
RefreshDailyEnabled(_clone.backup_frequency);
RefreshEnablementCheckBoxes();
}
else
{
_clone = (VMPP)clone;
RefreshTab(_clone);
}
}
public bool ValidToSave
{
get
{
return EnableNext();
}
}
public void ShowLocalValidationMessages()
{
}
public void Cleanup()
{
}
public bool HasChanged
{
get
{
if (!Helper.AreEqual2(_clone.archive_frequency, ArchiveFrequency))
return true;
if (!Helper.DictEquals<string, string>(_clone.archive_schedule, Schedule))
return true;
if (!ArchiveConfigIsEqual)
return true;
if (!Helper.AreEqual2(_clone.archive_target_type, ArchiveTargetType))
return true;
return false;
}
}
private bool ArchiveConfigIsEqual
{
get
{
var archiveConfig = ArchiveConfig;
if (string.IsNullOrEmpty(_clone.archive_target_config_location))
{
if (archiveConfig.ContainsKey("location") && !string.IsNullOrEmpty(archiveConfig["location"]))
return false;
}
else if (!archiveConfig.ContainsKey("location") || _clone.archive_target_config_location != archiveConfig["location"])
return false;
if (string.IsNullOrEmpty(_clone.archive_target_config_username))
{
if (archiveConfig.ContainsKey("username") && !string.IsNullOrEmpty(archiveConfig["username"]))
return false;
}
else if (!archiveConfig.ContainsKey("username") || _clone.archive_target_config_username != archiveConfig["username"])
return false;
if (string.IsNullOrEmpty(_clone.archive_target_config_password_value))
{
if (archiveConfig.ContainsKey("password") && !string.IsNullOrEmpty(archiveConfig["password"]))
return false;
}
else if (!archiveConfig.ContainsKey("password") || _clone.archive_target_config_password_value != archiveConfig["password"])
return false;
return true;
}
}
private vmpp_archive_target_type GetArchiveTargetType(string path)
{
if (SrWizardHelpers.ValidateNfsSharename(path))
return vmpp_archive_target_type.nfs;
if (SrWizardHelpers.ValidateCifsSharename(path))
return vmpp_archive_target_type.cifs;
return vmpp_archive_target_type.none;
}
private void textBoxPath_TextChanged(object sender, EventArgs e)
{
ResetPathTestStatus();
ArchiveTargetType = GetArchiveTargetType(textBoxPath.Text);
buttonTest.Enabled = ArchiveTargetType == vmpp_archive_target_type.cifs ||
ArchiveTargetType == vmpp_archive_target_type.nfs;
checkBoxCredentials.Enabled = m_tlpCredentials.Enabled = ArchiveTargetType == vmpp_archive_target_type.cifs;
OnPageUpdated();
EnableOkButton();
}
private void textBoxUser_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBoxUser.Text))
checkBoxCredentials.Checked = true;
OnPageUpdated();
EnableOkButton();
}
private void checkBoxCredentials_CheckedChanged(object sender, EventArgs e)
{
OnPageUpdated();
EnableOkButton();
}
private void radioButtonArchiveASAP_CheckedChanged(object sender, EventArgs e)
{
if (!radioButtonArchiveASAP.Checked)
return;
//radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others
radioButtonArchiveDaily.Checked = false;
ToggleRecurranceVisible(false);
ToggleDestinationVisible(true);
OnPageUpdated();
EnableOkButton();
}
private void radioButtonArchiveDaily_CheckedChanged(object sender, EventArgs e)
{
if (!radioButtonArchiveDaily.Checked)
return;
//radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others
radioButtonArchiveASAP.Checked = radioButtonDoNotArchive.Checked = radioButtonArchiveWeekly.Checked = false;
ToggleRecurranceVisible(true);
ToggleDailyWeekly(true);
ToggleDestinationVisible(true);
OnPageUpdated();
EnableOkButton();
}
private void radioButtonArchiveWeekly_CheckedChanged(object sender, EventArgs e)
{
if (!radioButtonArchiveWeekly.Checked)
return;
//radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others
radioButtonArchiveDaily.Checked = false;
ToggleRecurranceVisible(true);
ToggleDailyWeekly(false);
ToggleDestinationVisible(true);
OnPageUpdated();
EnableOkButton();
}
private void radioButtonDoNotArchive_CheckedChanged(object sender, EventArgs e)
{
if (!radioButtonDoNotArchive.Checked)
return;
//radioButtonArchiveDaily is in the toolTipContainer and therefore not grouped with the others
radioButtonArchiveDaily.Checked = false;
ToggleRecurranceVisible(false);
ToggleDestinationVisible(false);
OnPageUpdated();
EnableOkButton();
}
private void ToggleDestinationVisible(bool show)
{
sectionLabelDest.Visible = m_tlpDestination.Visible = show;
}
private void ToggleRecurranceVisible(bool show)
{
labelDivider.Visible = m_tlpRecur.Visible = show;
}
private void ToggleDailyWeekly(bool showDaily)
{
m_tlpRecur.SuspendLayout();
labelRecurDaily.Visible = dateTimePickerDaily.Visible = showDaily;
labelRecurWeekly.Visible = dateTimePickerWeekly.Visible = labelDays.Visible = daysWeekCheckboxes1.Visible = !showDaily;
m_tlpRecur.ResumeLayout();
}
private void EnableOkButton()
{
if (PropertiesDialog != null)
PropertiesDialog.okButton.Enabled = EnableNext();
}
public PropertiesDialog PropertiesDialog { private get; set; }
private void textBoxPassword_TextChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(textBoxPassword.Text))
checkBoxCredentials.Checked = true;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,169 +0,0 @@
namespace XenAdmin.Wizards.NewPolicyWizard
{
partial class NewPolicyEmailPage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewPolicyEmailPage));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBoxEmailAddress = new System.Windows.Forms.TextBox();
this.textBoxSMTP = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBoxPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.errorPanel = new System.Windows.Forms.Panel();
this.errorMessageLabel = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.errorPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// tableLayoutPanel1
//
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.textBoxEmailAddress, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.textBoxSMTP, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.label4, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.textBoxPort, 3, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// textBoxEmailAddress
//
this.tableLayoutPanel1.SetColumnSpan(this.textBoxEmailAddress, 3);
resources.ApplyResources(this.textBoxEmailAddress, "textBoxEmailAddress");
this.textBoxEmailAddress.Name = "textBoxEmailAddress";
//
// textBoxSMTP
//
resources.ApplyResources(this.textBoxSMTP, "textBoxSMTP");
this.textBoxSMTP.Name = "textBoxSMTP";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4";
//
// textBoxPort
//
resources.ApplyResources(this.textBoxPort, "textBoxPort");
this.textBoxPort.Name = "textBoxPort";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// checkBox1
//
resources.ApplyResources(this.checkBox1, "checkBox1");
this.checkBox1.Name = "checkBox1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// errorPanel
//
this.errorPanel.Controls.Add(this.errorMessageLabel);
this.errorPanel.Controls.Add(this.pictureBox1);
resources.ApplyResources(this.errorPanel, "errorPanel");
this.errorPanel.Name = "errorPanel";
//
// errorMessageLabel
//
resources.ApplyResources(this.errorMessageLabel, "errorMessageLabel");
this.errorMessageLabel.ForeColor = System.Drawing.Color.Red;
this.errorMessageLabel.Name = "errorMessageLabel";
//
// pictureBox1
//
this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_error_h32bit_16;
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false;
//
// NewPolicyEmailPage
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.errorPanel);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.groupBox1);
this.Name = "NewPolicyEmailPage";
this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.errorPanel.ResumeLayout(false);
this.errorPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBoxEmailAddress;
private System.Windows.Forms.TextBox textBoxSMTP;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBoxPort;
private System.Windows.Forms.Panel errorPanel;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label errorMessageLabel;
}
}

View File

@ -1,257 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Drawing;
using XenAdmin.Actions;
using XenAdmin.Alerts;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAdmin.Dialogs;
using XenAdmin.SettingsPanels;
using XenAPI;
using XenCenterLib;
namespace XenAdmin.Wizards.NewPolicyWizard
{
public partial class NewPolicyEmailPage : XenTabPage, IEditPage
{
readonly EmailAddressValidator emailAddressValidator = new EmailAddressValidator();
public NewPolicyEmailPage()
{
InitializeComponent();
textBoxPort.Text = 25.ToString();
RegisterEvents();
}
private void RegisterEvents()
{
textBoxEmailAddress.LostFocus += UpdatePageAndEnableOK_EventHandler;
textBoxEmailAddress.TextChanged += UpdatePageAndEnableOKWhileInError_EventHandler;
textBoxPort.TextChanged += UpdatePageAndEnableOK_EventHandler;
textBoxSMTP.TextChanged += UpdatePageAndEnableOK_EventHandler;
}
private Pool _pool;
public Pool Pool
{
get { return _pool; }
set
{
_pool = value;
if (value != null)
{
var options = PerfmonOptionsDefinition.GetPerfmonOptionsDefinitions(_pool);
if (options != null)
{
textBoxSMTP.Text = PerfmonOptionsDefinition.GetSmtpServerAddress(options.MailHub);
textBoxPort.Text = PerfmonOptionsDefinition.GetSmtpPort(options.MailHub);
textBoxEmailAddress.Text = options.MailDestination;
}
}
}
}
public override string Text
{
get { return Messages.EMAIL_ALERTS; }
}
public string SubText
{
get { return EmailEnabled ? Messages.ENABLED : Messages.DISABLED; }
}
public override string HelpID
{
get { return "Emailalerts"; }
}
public Image Image
{
get { return Properties.Resources._000_Email_h32bit_16; }
}
public override string PageTitle
{
get
{
return Messages.EMAIL_ALERTS_TITLE;
}
}
public Dictionary<string, string> EmailSettings
{
get
{
var result = new Dictionary<string, string>();
if (checkBox1.Checked)
{
result.Add("email_address", textBoxEmailAddress.Text);
result.Add("smtp_server", textBoxSMTP.Text);
result.Add("smtp_port", textBoxPort.Text);
}
return result;
}
}
public bool EmailEnabled
{
get { return checkBox1.Checked; }
}
private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
groupBox1.Enabled = checkBox1.Checked;
OnPageUpdated();
EnableOkButton();
}
private void RefreshTab(VMPP vmpp)
{
checkBox1.Checked = vmpp.is_alarm_enabled;
if (vmpp.is_alarm_enabled)
{
textBoxSMTP.Text = vmpp.alarm_config_smtp_server;
textBoxPort.Text = vmpp.alarm_config_smtp_port;
textBoxEmailAddress.Text = vmpp.alarm_config_email_address;
}
}
private void EnableOkButton()
{
if (PropertiesDialog != null)
PropertiesDialog.okButton.Enabled = EnableNext();
}
public PropertiesDialog PropertiesDialog { private get; set; }
public AsyncAction SaveSettings()
{
_clone.is_alarm_enabled = EmailEnabled;
_clone.alarm_config = EmailSettings;
return null;
}
private VMPP _clone;
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
_clone = (VMPP)clone;
Pool = Helpers.GetPoolOfOne(_clone.Connection);
RefreshTab(_clone);
}
/// <summary>
/// Set the visibilty of the error warning message panel (picture and text)
/// </summary>
private bool ErrorWarningMessageIsVisible
{
set { errorPanel.Visible = value; }
get { return errorPanel.Visible; }
}
public override bool EnableNext()
{
ErrorWarningMessageIsVisible = false;
//Display the email error warning?
if (checkBox1.Checked && !string.IsNullOrEmpty(textBoxEmailAddress.Text) &&
!emailAddressValidator.IsValid(textBoxEmailAddress.Text))
{
ErrorWarningMessageIsVisible = true;
return false;
}
//Check all required boxes have text
if (checkBox1.Checked &&
(string.IsNullOrEmpty(textBoxEmailAddress.Text) || string.IsNullOrEmpty(textBoxSMTP.Text) || string.IsNullOrEmpty(textBoxPort.Text)))
return false;
return true;
}
public bool ValidToSave
{
get { return EnableNext(); }
}
public void ShowLocalValidationMessages()
{
}
public void Cleanup()
{
checkBox1.Checked = false;
}
public bool HasChanged
{
get
{
if (EmailEnabled != _clone.is_alarm_enabled)
return true;
if (!Helper.AreEqual2(_clone.alarm_config, EmailSettings))
return true;
return false;
}
}
private void UpdatePageAndEnableOK_EventHandler(object sender, EventArgs e)
{
UpdatePageAndEnableOK();
}
private void UpdatePageAndEnableOKWhileInError_EventHandler(object sender, EventArgs e)
{
if (!ErrorWarningMessageIsVisible)
return;
UpdatePageAndEnableOK();
}
private void UpdatePageAndEnableOK()
{
OnPageUpdated();
EnableOkButton();
}
}
}

View File

@ -1,501 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element msdata:IsDataSet="true" name="root">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="value" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/>
<xsd:element minOccurs="0" msdata:Ordinal="2" name="comment" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute msdata:Ordinal="1" name="name" type="xsd:string" use="required"/>
<xsd:attribute msdata:Ordinal="3" name="type" type="xsd:string"/>
<xsd:attribute msdata:Ordinal="4" name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 6</value>
</data>
<data name="label2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>99, 23</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>メール アドレス(&amp;M):</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 35</value>
</data>
<data name="label3.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>99, 23</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>SMTP サーバー(&amp;S):</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="textBoxEmailAddress.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxEmailAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>108, 3</value>
</data>
<data name="textBoxEmailAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>343, 19</value>
</data>
<data name="textBoxEmailAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Name" xml:space="preserve">
<value>textBoxEmailAddress</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="textBoxSMTP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxSMTP.Location" type="System.Drawing.Point, System.Drawing">
<value>108, 32</value>
</data>
<data name="textBoxSMTP.Size" type="System.Drawing.Size, System.Drawing">
<value>210, 19</value>
</data>
<data name="textBoxSMTP.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Name" xml:space="preserve">
<value>textBoxSMTP</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxSMTP.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>324, 35</value>
</data>
<data name="label4.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>63, 23</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>ポート(&amp;O):</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="textBoxPort.Location" type="System.Drawing.Point, System.Drawing">
<value>393, 32</value>
</data>
<data name="textBoxPort.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 19</value>
</data>
<data name="textBoxPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;textBoxPort.Name" xml:space="preserve">
<value>textBoxPort</value>
</data>
<data name="&gt;&gt;textBoxPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxPort.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxPort.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 18</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>454, 58</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?>&lt;TableLayoutSettings>&lt;Controls>&lt;Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" />&lt;Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" />&lt;Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" />&lt;Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" />&lt;/Controls>&lt;Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" />&lt;Rows Styles="Percent,50,Percent,50,Absolute,20" />&lt;/TableLayoutSettings></value>
</data>
<data name="groupBox1.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 87</value>
</data>
<data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 7, 3, 3</value>
</data>
<data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>6, 6, 6, 6</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 82</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>送信先</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 57</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>[XenServer] での VM 保護ジョブに関するアラート (VM スナップショットが作成またはアーカイブされた場合や、スナップショットまたはアーカイブが失敗した場合など) が生成されたときに、通知メールが送信されるように設定できます。</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="checkBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="checkBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 60</value>
</data>
<data name="checkBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>249, 18</value>
</data>
<data name="checkBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="checkBox1.Text" xml:space="preserve">
<value>VM 保護ジョブのアラートをメールで送信する(&amp;E)</value>
</data>
<data name="&gt;&gt;checkBox1.Name" xml:space="preserve">
<value>checkBox1</value>
</data>
<data name="&gt;&gt;checkBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;checkBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;checkBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorMessageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="errorMessageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 3</value>
</data>
<data name="errorMessageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 17</value>
</data>
<data name="errorMessageLabel.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="errorMessageLabel.Text" xml:space="preserve">
<value>入力したメール アドレスの書式が無効です</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Name" xml:space="preserve">
<value>errorMessageLabel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="pictureBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>18, 19</value>
</data>
<data name="pictureBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pictureBox1.Name" xml:space="preserve">
<value>pictureBox1</value>
</data>
<data name="&gt;&gt;pictureBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox1.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 176</value>
</data>
<data name="errorPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 25</value>
</data>
<data name="errorPanel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="errorPanel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;errorPanel.Name" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorPanel.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorPanel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;errorPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 301</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>NewPolicyEmailPage</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -1,501 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 6</value>
</data>
<data name="label2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 22</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>E&amp;mail address:</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 34</value>
</data>
<data name="label3.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>96, 23</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>&amp;SMTP server:</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="textBoxEmailAddress.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxEmailAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>105, 3</value>
</data>
<data name="textBoxEmailAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>346, 20</value>
</data>
<data name="textBoxEmailAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Name" xml:space="preserve">
<value>textBoxEmailAddress</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="textBoxSMTP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxSMTP.Location" type="System.Drawing.Point, System.Drawing">
<value>105, 31</value>
</data>
<data name="textBoxSMTP.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 20</value>
</data>
<data name="textBoxSMTP.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Name" xml:space="preserve">
<value>textBoxSMTP</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxSMTP.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>346, 34</value>
</data>
<data name="label4.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>41, 23</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>P&amp;ort:</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="textBoxPort.Location" type="System.Drawing.Point, System.Drawing">
<value>393, 31</value>
</data>
<data name="textBoxPort.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 20</value>
</data>
<data name="textBoxPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;textBoxPort.Name" xml:space="preserve">
<value>textBoxPort</value>
</data>
<data name="&gt;&gt;textBoxPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxPort.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxPort.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 19</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>454, 57</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" /&gt;&lt;Rows Styles="Percent,50,Percent,50,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="groupBox1.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 87</value>
</data>
<data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 7, 3, 3</value>
</data>
<data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>6, 6, 6, 6</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 82</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Delivery address</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 57</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>[XenServer] can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails.</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="checkBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="checkBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 60</value>
</data>
<data name="checkBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>281, 17</value>
</data>
<data name="checkBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="checkBox1.Text" xml:space="preserve">
<value>Send &amp;email notifications about VM protection job alerts</value>
</data>
<data name="&gt;&gt;checkBox1.Name" xml:space="preserve">
<value>checkBox1</value>
</data>
<data name="&gt;&gt;checkBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;checkBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;checkBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorMessageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="errorMessageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 3</value>
</data>
<data name="errorMessageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>232, 13</value>
</data>
<data name="errorMessageLabel.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="errorMessageLabel.Text" xml:space="preserve">
<value>The email address entered has an invalid format</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Name" xml:space="preserve">
<value>errorMessageLabel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="pictureBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>18, 19</value>
</data>
<data name="pictureBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pictureBox1.Name" xml:space="preserve">
<value>pictureBox1</value>
</data>
<data name="&gt;&gt;pictureBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox1.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 176</value>
</data>
<data name="errorPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 25</value>
</data>
<data name="errorPanel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="errorPanel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;errorPanel.Name" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorPanel.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorPanel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;errorPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 301</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>NewPolicyEmailPage</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -1,501 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element msdata:IsDataSet="true" name="root">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="value" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/>
<xsd:element minOccurs="0" msdata:Ordinal="2" name="comment" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute msdata:Ordinal="1" name="name" type="xsd:string" use="required"/>
<xsd:attribute msdata:Ordinal="3" name="type" type="xsd:string"/>
<xsd:attribute msdata:Ordinal="4" name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 6</value>
</data>
<data name="label2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 22</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>电子邮件地址(&amp;M):</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 34</value>
</data>
<data name="label3.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 23</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>SMTP 服务器(&amp;S):</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="textBoxEmailAddress.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxEmailAddress.Location" type="System.Drawing.Point, System.Drawing">
<value>85, 3</value>
</data>
<data name="textBoxEmailAddress.Size" type="System.Drawing.Size, System.Drawing">
<value>366, 20</value>
</data>
<data name="textBoxEmailAddress.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Name" xml:space="preserve">
<value>textBoxEmailAddress</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxEmailAddress.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="textBoxSMTP.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="textBoxSMTP.Location" type="System.Drawing.Point, System.Drawing">
<value>85, 31</value>
</data>
<data name="textBoxSMTP.Size" type="System.Drawing.Size, System.Drawing">
<value>235, 20</value>
</data>
<data name="textBoxSMTP.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Name" xml:space="preserve">
<value>textBoxSMTP</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxSMTP.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxSMTP.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>326, 34</value>
</data>
<data name="label4.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>41, 43</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>端口(&amp;O):</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="textBoxPort.Location" type="System.Drawing.Point, System.Drawing">
<value>393, 31</value>
</data>
<data name="textBoxPort.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 20</value>
</data>
<data name="textBoxPort.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;textBoxPort.Name" xml:space="preserve">
<value>textBoxPort</value>
</data>
<data name="&gt;&gt;textBoxPort.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBoxPort.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;textBoxPort.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 19</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>454, 57</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?>&lt;TableLayoutSettings>&lt;Controls>&lt;Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="textBoxEmailAddress" Row="0" RowSpan="1" Column="1" ColumnSpan="3" />&lt;Control Name="textBoxSMTP" Row="1" RowSpan="1" Column="1" ColumnSpan="1" />&lt;Control Name="label4" Row="1" RowSpan="1" Column="2" ColumnSpan="1" />&lt;Control Name="textBoxPort" Row="1" RowSpan="1" Column="3" ColumnSpan="1" />&lt;/Controls>&lt;Columns Styles="Percent,29.68198,Percent,70.31802,Absolute,47,Absolute,63" />&lt;Rows Styles="Percent,50,Percent,50,Absolute,20" />&lt;/TableLayoutSettings></value>
</data>
<data name="groupBox1.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 87</value>
</data>
<data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 7, 3, 3</value>
</data>
<data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>6, 6, 6, 6</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 82</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>收件人地址</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 57</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>在产生与 VM 保护作业相关联的警报时(例如创建或存档 VM 快照时或者快照生成或存档操作失败时)[XenServer] 可以向您发送电子邮件通知。</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="checkBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="checkBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 60</value>
</data>
<data name="checkBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>281, 17</value>
</data>
<data name="checkBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="checkBox1.Text" xml:space="preserve">
<value>发送有关 VM 保护作业警报的电子邮件通知(&amp;E)</value>
</data>
<data name="&gt;&gt;checkBox1.Name" xml:space="preserve">
<value>checkBox1</value>
</data>
<data name="&gt;&gt;checkBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;checkBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;checkBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorMessageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="errorMessageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 3</value>
</data>
<data name="errorMessageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>252, 17</value>
</data>
<data name="errorMessageLabel.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="errorMessageLabel.Text" xml:space="preserve">
<value>输入的电子邮件地址格式不正确</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Name" xml:space="preserve">
<value>errorMessageLabel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorMessageLabel.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorMessageLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="pictureBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>18, 19</value>
</data>
<data name="pictureBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pictureBox1.Name" xml:space="preserve">
<value>pictureBox1</value>
</data>
<data name="&gt;&gt;pictureBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox1.Parent" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="errorPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 176</value>
</data>
<data name="errorPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>466, 25</value>
</data>
<data name="errorPanel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="errorPanel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;errorPanel.Name" xml:space="preserve">
<value>errorPanel</value>
</data>
<data name="&gt;&gt;errorPanel.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;errorPanel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;errorPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 301</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>NewPolicyEmailPage</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -29,18 +29,13 @@
* SUCH DAMAGE.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Actions;
using XenAdmin.Controls;
using XenAdmin.Properties;
using XenAdmin.SettingsPanels;
using XenAPI;
namespace XenAdmin.Wizards.NewPolicyWizard
{
public partial class NewPolicyPolicyNamePage : XenTabPage, IEditPage
public partial class NewPolicyPolicyNamePage : XenTabPage
{
private readonly string _tabName;
private readonly string _tabTitle;
@ -104,42 +99,5 @@ namespace XenAdmin.Wizards.NewPolicyWizard
{
OnPageUpdated();
}
private void RefreshTab(VMPP vmpp)
{
textBoxName.Text = vmpp.Name;
textBoxDescription.Text = vmpp.Description;
labelwizard.Visible = false;
}
public AsyncAction SaveSettings()
{
return null;
}
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
RefreshTab((VMPP) orig);
}
public bool ValidToSave
{
get { return false; }
}
public void ShowLocalValidationMessages()
{
}
public void Cleanup()
{
}
public bool HasChanged
{
get { return false; }
}
}
}

View File

@ -71,7 +71,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard
public string SubText
{
get { return NewPolicyWizardSpecific<VMPP>.FormatSchedule(Schedule, Frequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); }
get { return NewPolicyWizard.FormatSchedule(Schedule, Frequency, DaysWeekCheckboxes.DaysMode.L10N_SHORT); }
}
public Image Image
@ -100,14 +100,14 @@ namespace XenAdmin.Wizards.NewPolicyWizard
{
var result = new Dictionary<string, string>();
if (Frequency == policy_frequency.hourly)
if (Frequency == vmss_frequency.hourly)
result.Add("min", comboBoxMin.SelectedItem.ToString());
else if (Frequency == policy_frequency.daily)
else if (Frequency == vmss_frequency.daily)
{
result.Add("hour", dateTimePickerDaily.Value.Hour.ToString());
result.Add("min", dateTimePickerDaily.Value.Minute.ToString());
}
else if (Frequency == policy_frequency.weekly)
else if (Frequency == vmss_frequency.weekly)
{
result.Add("hour", dateTimePickerWeekly.Value.Hour.ToString());
result.Add("min", dateTimePickerWeekly.Value.Minute.ToString());
@ -118,13 +118,13 @@ namespace XenAdmin.Wizards.NewPolicyWizard
}
}
public policy_frequency Frequency
public vmss_frequency Frequency
{
get
{
if (radioButtonHourly.Checked) return policy_frequency.hourly;
else if (radioButtonDaily.Checked) return policy_frequency.daily;
else if (radioButtonWeekly.Checked) return policy_frequency.weekly;
if (radioButtonHourly.Checked) return vmss_frequency.hourly;
else if (radioButtonDaily.Checked) return vmss_frequency.daily;
else if (radioButtonWeekly.Checked) return vmss_frequency.weekly;
throw new ArgumentException("Wrong value");
}
@ -165,7 +165,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard
OnPageUpdated();
}
private void RefreshTab(IVMPolicy policy)
private void RefreshTab(VMSS policy)
{
if (ParentForm != null)
{
@ -177,18 +177,18 @@ namespace XenAdmin.Wizards.NewPolicyWizard
sectionLabelSchedule.LineColor = sectionLabelNumber.LineColor = SystemColors.ActiveBorder;
}
switch (policy.policy_frequency)
switch (policy.frequency)
{
case policy_frequency.hourly:
case vmss_frequency.hourly:
radioButtonHourly.Checked = true;
SetHourlyMinutes(Convert.ToDecimal(policy.backup_schedule_min));
break;
case policy_frequency.daily:
case vmss_frequency.daily:
radioButtonDaily.Checked = true;
dateTimePickerDaily.Value = new DateTime(1970, 1, 1, Convert.ToInt32(policy.backup_schedule_hour),
Convert.ToInt32(policy.backup_schedule_min), 0);
break;
case policy_frequency.weekly:
case vmss_frequency.weekly:
radioButtonWeekly.Checked = true;
dateTimePickerWeekly.Value = new DateTime(1970, 1, 1, Convert.ToInt32(policy.backup_schedule_hour),
Convert.ToInt32(policy.backup_schedule_min), 0);
@ -196,7 +196,7 @@ namespace XenAdmin.Wizards.NewPolicyWizard
break;
}
numericUpDownRetention.Value = policy.policy_retention;
numericUpDownRetention.Value = policy.retained_snapshots;
}
private void SetHourlyMinutes(decimal min)
@ -224,17 +224,17 @@ namespace XenAdmin.Wizards.NewPolicyWizard
public AsyncAction SaveSettings()
{
_policyCopy.policy_frequency = Frequency;
_policyCopy.policy_schedule = Schedule;
_policyCopy.policy_retention = BackupRetention;
_policyCopy.frequency = Frequency;
_policyCopy.schedule = Schedule;
_policyCopy.retained_snapshots = BackupRetention;
return null;
}
private IVMPolicy _policyCopy;
private VMSS _policyCopy;
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
_policyCopy = (IVMPolicy)clone;
_policyCopy = (VMSS)clone;
RefreshTab(_policyCopy);
}
@ -242,9 +242,9 @@ namespace XenAdmin.Wizards.NewPolicyWizard
{
get
{
_policyCopy.policy_frequency = Frequency;
_policyCopy.policy_schedule = Schedule;
_policyCopy.policy_retention = BackupRetention;
_policyCopy.frequency = Frequency;
_policyCopy.schedule = Schedule;
_policyCopy.retained_snapshots = BackupRetention;
return true;
}
}
@ -261,11 +261,11 @@ namespace XenAdmin.Wizards.NewPolicyWizard
{
get
{
if (!Helper.AreEqual2(_policyCopy.policy_frequency, Frequency))
if (!Helper.AreEqual2(_policyCopy.frequency, Frequency))
return true;
if (!Helper.AreEqual2(_policyCopy.policy_schedule, Schedule))
if (!Helper.AreEqual2(_policyCopy.schedule, Schedule))
return true;
if (!Helper.AreEqual2(_policyCopy.policy_retention, BackupRetention))
if (!Helper.AreEqual2(_policyCopy.retained_snapshots, BackupRetention))
return true;
return false;

View File

@ -41,16 +41,7 @@ using XenAPI;
namespace XenAdmin.Wizards.NewPolicyWizard
{
// This class acts as the base class for NewPolicySnapshotTypePageSpecific. It's only here
// because of a bug in Visual Studio: the Designer can't design classes of a
// generic class. The workaround is to do the design in this non-generic class,
// and then inherit the generic class from it. See
// http://stackoverflow.com/questions/1627431/fix-embedded-resources-for-generic-usercontrol
// http://bytes.com/topic/c-sharp/answers/537310-can-you-have-generic-type-windows-form
// http://connect.microsoft.com/VisualStudio/feedback/details/115397/component-resource-manager-doesnt-work-with-generic-form-classes
// (or search on Google for [ComponentResourceManager generic]).
public abstract partial class NewPolicySnapshotTypePage : XenTabPage, IEditPage
public partial class NewPolicySnapshotTypePage : XenTabPage, IEditPage
{
protected List<VM> _selectedVMs;
public List<VM> SelectedVMs
@ -61,32 +52,245 @@ namespace XenAdmin.Wizards.NewPolicyWizard
_selectedVMs = value;
}
}
public abstract AsyncAction SaveSettings();
public abstract string SubText { get; }
public abstract bool HasChanged { get; }
public abstract void SetXenObjects(IXenObject orig, IXenObject clone);
public abstract Image Image { get; }
public abstract bool ValidToSave { get; }
public abstract void ShowLocalValidationMessages();
public abstract void Cleanup();
public abstract void checkpointInfoPictureBox_Click(object sender, System.EventArgs e);
public abstract void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e);
public abstract void pictureBoxVSS_Click(object sender, System.EventArgs e);
public abstract void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e);
public abstract void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e);
public abstract void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e);
public NewPolicySnapshotTypePage()
{
InitializeComponent();
this.labelWarning.Text = string.Format(this.labelWarning.Text, Messages.VMSS_TYPE);
}
public NewPolicySnapshotTypePage(List<VM> selectedVMS)
public string SubText
{
InitializeComponent();
SelectedVMs = selectedVMS;
get
{
if (BackupType == vmss_type.snapshot)
return Messages.DISKS_ONLY;
else if (BackupType == vmss_type.snapshot_with_quiesce)
return Messages.QUIESCED_SNAPSHOTS;
else
return Messages.DISKS_AND_MEMORY;
}
}
public override string HelpID
{
get { return "Snapshottype"; }
}
public override string PageTitle
{
get
{
return Messages.SNAPSHOT_TYPE_TITLE;
}
}
public override string Text
{
get
{
return Messages.SNAPSHOT_TYPE;
}
}
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
if (direction == PageLoadedDirection.Forward)
EnableShapshotTypes(Connection, false);
}
public Image Image
{
get { return Properties.Resources._000_VMSession_h32bit_16; }
}
public bool ValidToSave
{
get { return true; }
}
public void ShowLocalValidationMessages()
{
}
public void Cleanup()
{
radioButtonDiskOnly.Checked = true;
}
private void checkpointInfoPictureBox_Click(object sender, System.EventArgs e)
{
toolTip.Show(Messages.FIELD_DISABLED, checkpointInfoPictureBox, 20, 0);
}
private void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e)
{
toolTip.Hide(checkpointInfoPictureBox);
}
private void pictureBoxVSS_Click(object sender, System.EventArgs e)
{
string tt = Messages.INFO_QUIESCE_MODE.Replace("\\n", "\n"); // This says that VSS must be enabled. This is a guess, because we can't tell whether it is or not.
toolTip.Show(tt, pictureBoxVSS, 20, 0);
}
private void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e)
{
toolTip.Hide(pictureBoxVSS);
}
private void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e)
{
if (this.quiesceCheckBox.Checked)
{
this.radioButtonDiskOnly.Checked = true;
}
}
public vmss_type BackupType
{
get
{
if (quiesceCheckBox.Checked)
return vmss_type.snapshot_with_quiesce;
if (radioButtonDiskOnly.Checked)
return vmss_type.snapshot;
else if (radioButtonDiskAndMemory.Checked)
return vmss_type.checkpoint;
else
{
return vmss_type.unknown;
}
}
}
public void ToggleQuiesceCheckBox(List<VM> SelectedVMs)
{
switch (BackupType)
{
case vmss_type.snapshot:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = false;
break;
case vmss_type.snapshot_with_quiesce:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = true;
break;
case vmss_type.checkpoint:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = false;
break;
}
foreach (VM vm in SelectedVMs)
{
if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss))
{
quiesceCheckBox.Enabled = false;
quiesceCheckBox.Checked = false;
break;
}
}
}
private void RefreshTab(VMSS policy)
{
/* when a policy does not have any VMs, irrespective of
* the snapshot type, enable Quiesce
*/
quiesceCheckBox.Enabled = (policy.VMs.Count == 0);
switch (policy.type)
{
case vmss_type.checkpoint:
radioButtonDiskAndMemory.Checked = true;
quiesceCheckBox.Enabled = false;
break;
case vmss_type.snapshot:
radioButtonDiskOnly.Checked = true;
break;
case vmss_type.snapshot_with_quiesce:
radioButtonDiskOnly.Checked = true;
/* when the snapshot type itself is quiesce then we need to
* enable it irrespective of the number of VMs ( > 1 condition)
*/
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = true;
break;
}
EnableShapshotTypes(policy.Connection, quiesceCheckBox.Enabled);
}
private void EnableShapshotTypes(IXenConnection connection, bool isQuiesceEnabled)
{
radioButtonDiskAndMemory.Enabled =
label3.Enabled = !Helpers.FeatureForbidden(connection, Host.RestrictCheckpoint);
checkpointInfoPictureBox.Visible = !radioButtonDiskAndMemory.Enabled;
pictureBoxWarning.Visible = labelWarning.Visible = radioButtonDiskAndMemory.Enabled;
this.quiesceCheckBox.Enabled = true;
this.quiesceCheckBox.Visible = true;
if (this._selectedVMs != null)
{
if (this._selectedVMs.Count > 0)
{
foreach (VM vm in this._selectedVMs)
{
if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) ||
Helpers.FeatureForbidden(vm, Host.RestrictVss))
{
this.quiesceCheckBox.Enabled = false;
this.quiesceCheckBox.Checked = false;
break;
}
}
}
}
else /* we enter this block only when we are editing a policy, in that case the decision has already been taken in RefreshTab function */
{
this.quiesceCheckBox.Enabled = isQuiesceEnabled;
}
this.pictureBoxVSS.Visible = !this.quiesceCheckBox.Enabled;
}
public AsyncAction SaveSettings()
{
_policy.type = BackupType;
return null;
}
private VMSS _policy;
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
_policy = (VMSS)clone;
RefreshTab(_policy);
}
public bool HasChanged
{
get
{
return BackupType != _policy.type;
}
}
private void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e)
{
if (this.quiesceCheckBox.Enabled)
{
this.quiesceCheckBox.Checked = false;
}
}
}
}

View File

@ -1,304 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Drawing;
using XenAdmin.Actions;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAdmin.Network;
using XenAdmin.SettingsPanels;
using XenAPI;
namespace XenAdmin.Wizards.NewPolicyWizard
{
//See notes in base class
public partial class NewPolicySnapshotTypePageSpecific<T> : NewPolicySnapshotTypePage where T : XenObject<T>
{
public NewPolicySnapshotTypePageSpecific() : base()
{
this.labelWarning.Text = string.Format(this.labelWarning.Text, VMGroup<T>.VMPolicyTypeName);
}
public NewPolicySnapshotTypePageSpecific(List<VM> selectedVMS)
: base(selectedVMS)
{
}
public override string SubText
{
get
{
if (BackupType == policy_backup_type.snapshot)
return Messages.DISKS_ONLY;
else if (BackupType == policy_backup_type.snapshot_with_quiesce)
return Messages.QUIESCED_SNAPSHOTS;
else
return Messages.DISKS_AND_MEMORY;
}
}
public override string HelpID
{
get { return "Snapshottype"; }
}
public override string PageTitle
{
get
{
return Messages.SNAPSHOT_TYPE_TITLE;
}
}
public override string Text
{
get
{
return Messages.SNAPSHOT_TYPE;
}
}
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
if (direction == PageLoadedDirection.Forward)
EnableShapshotTypes(Connection, false);
}
public override Image Image
{
get { return Properties.Resources._000_VMSession_h32bit_16; }
}
public override bool ValidToSave
{
get { return true; }
}
public override void ShowLocalValidationMessages()
{
}
public override void Cleanup()
{
radioButtonDiskOnly.Checked = true;
}
public override void checkpointInfoPictureBox_Click(object sender, System.EventArgs e)
{
toolTip.Show(Messages.FIELD_DISABLED, checkpointInfoPictureBox, 20, 0);
}
public override void checkpointInfoPictureBox_MouseLeave(object sender, System.EventArgs e)
{
toolTip.Hide(checkpointInfoPictureBox);
}
public override void pictureBoxVSS_Click(object sender, System.EventArgs e)
{
string tt = Messages.INFO_QUIESCE_MODE.Replace("\\n", "\n"); // This says that VSS must be enabled. This is a guess, because we can't tell whether it is or not.
toolTip.Show(tt, pictureBoxVSS, 20, 0);
}
public override void pictureBoxVSS_MouseLeave(object sender, System.EventArgs e)
{
toolTip.Hide(pictureBoxVSS);
}
public override void quiesceCheckBox_CheckedChanged(object sender, System.EventArgs e)
{
if (this.quiesceCheckBox.Checked)
{
this.radioButtonDiskOnly.Checked = true;
}
}
public policy_backup_type BackupType
{
get
{
if (quiesceCheckBox.Checked)
return policy_backup_type.snapshot_with_quiesce;
if (radioButtonDiskOnly.Checked)
return policy_backup_type.snapshot;
else if (radioButtonDiskAndMemory.Checked)
return policy_backup_type.checkpoint;
else
{
return policy_backup_type.unknown;
}
}
}
public void ToggleQuiesceCheckBox(List <VM> SelectedVMs)
{
switch (BackupType)
{
case policy_backup_type.snapshot:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = false;
break;
case policy_backup_type.snapshot_with_quiesce:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = true;
break;
case policy_backup_type.checkpoint:
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = false;
break;
}
foreach (VM vm in SelectedVMs)
{
if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss))
{
quiesceCheckBox.Enabled = false;
quiesceCheckBox.Checked = false;
break;
}
}
}
private void RefreshTab(IVMPolicy policy)
{
/* when a policy does not have any VMs, irrespective of
* the snapshot type, enable Quiesce
*/
quiesceCheckBox.Enabled = (policy.VMs.Count == 0);
switch (policy.policy_type)
{
case policy_backup_type.checkpoint:
radioButtonDiskAndMemory.Checked = true;
quiesceCheckBox.Enabled = false;
break;
case policy_backup_type.snapshot:
radioButtonDiskOnly.Checked = true;
break;
case policy_backup_type.snapshot_with_quiesce:
radioButtonDiskOnly.Checked = true;
/* when the snapshot type itself is quiesce then we need to
* enable it irrespective of the number of VMs ( > 1 condition)
*/
quiesceCheckBox.Enabled = true;
quiesceCheckBox.Checked = true;
break;
}
EnableShapshotTypes(policy.Connection, quiesceCheckBox.Enabled);
}
private void EnableShapshotTypes(IXenConnection connection, bool isQuiesceEnabled)
{
radioButtonDiskAndMemory.Enabled = label3.Enabled = !Helpers.FeatureForbidden(connection, Host.RestrictCheckpoint);
checkpointInfoPictureBox.Visible = !radioButtonDiskAndMemory.Enabled;
pictureBoxWarning.Visible = labelWarning.Visible = radioButtonDiskAndMemory.Enabled;
this.quiesceCheckBox.Enabled = true;
if (VMGroup<T>.isQuescingSupported)
{
this.quiesceCheckBox.Visible = true;
if (this._selectedVMs != null)
{
if (this._selectedVMs.Count > 0)
{
foreach (VM vm in this._selectedVMs)
{
if (!vm.allowed_operations.Contains(vm_operations.snapshot_with_quiesce) || Helpers.FeatureForbidden(vm, Host.RestrictVss))
{
this.quiesceCheckBox.Enabled = false;
this.quiesceCheckBox.Checked = false;
break;
}
}
}
}
else /* we enter this block only when we are editing a policy, in that case the decision has already been taken in RefreshTab function */
{
this.quiesceCheckBox.Enabled = isQuiesceEnabled;
}
this.pictureBoxVSS.Visible = !this.quiesceCheckBox.Enabled;
}
else /*quiescing snapshots are not supported in VMPP*/
{
this.quiesceCheckBox.Visible = false;
this.pictureBoxVSS.Visible = false;
}
}
public override AsyncAction SaveSettings()
{
_policy.policy_type = BackupType;
return null;
}
private IVMPolicy _policy;
public override void SetXenObjects(IXenObject orig, IXenObject clone)
{
_policy = (IVMPolicy)clone;
RefreshTab(_policy);
}
public override bool HasChanged
{
get
{
return BackupType != _policy.policy_type;
}
}
public override void radioButtonDiskAndMemory_CheckedChanged(object sender, System.EventArgs e)
{
if(this.quiesceCheckBox.Enabled)
{
this.quiesceCheckBox.Checked = false;
}
}
}
}

View File

@ -41,23 +41,14 @@ using XenAdmin.Wizards.GenericPages;
namespace XenAdmin.Wizards.NewPolicyWizard
{
// This class acts as the base class for NewPolicyWizardSpecific. It's only here
// because of a bug in Visual Studio: the Designer can't design classes of a
// generic class. The workaround is to do the design in this non-generic class,
// and then inherit the generic class from it. See
// http://stackoverflow.com/questions/1627431/fix-embedded-resources-for-generic-usercontrol
// http://bytes.com/topic/c-sharp/answers/537310-can-you-have-generic-type-windows-form
// http://connect.microsoft.com/VisualStudio/feedback/details/115397/component-resource-manager-doesnt-work-with-generic-form-classes
// (or search on Google for [ComponentResourceManager generic]).
public partial class NewPolicyWizard : XenWizardBase
{
protected NewPolicyPolicyNamePage xenTabPagePolicy;
protected NewPolicySnapshotFrequencyPage xenTabPageSnapshotFrequency;
protected NewPolicyArchivePage xenTabPageArchive;
protected NewPolicyEmailPage xenTabPageEmail;
protected NewPolicyFinishPage xenTabPageFinish;
protected RBACWarningPage xenTabPageRBAC;
private readonly NewPolicyPolicyNamePage xenTabPagePolicy;
private readonly NewVMGroupVMsPage<VMSS> xenTabPageVMsPage;
private readonly NewPolicySnapshotTypePage xenTabPageSnapshotType;
private readonly NewPolicySnapshotFrequencyPage xenTabPageSnapshotFrequency;
private readonly NewPolicyFinishPage xenTabPageFinish;
private readonly RBACWarningPage xenTabPageRBAC;
public readonly Pool Pool;
public NewPolicyWizard(Pool pool)
@ -65,7 +56,151 @@ namespace XenAdmin.Wizards.NewPolicyWizard
{
InitializeComponent();
Pool = pool;
}
this.Text = Messages.VMSS_WIZARD_TITLE;
xenTabPagePolicy = new NewPolicyPolicyNamePage(Messages.NEW_VMSS_PAGE_TEXT, Messages.NEW_VMSS_PAGE_TEXT_MORE,
Messages.VMSS_NAME, Messages.VMSS_NAME_TITLE, Messages.VMSS_NAME_FIELD_TEXT);
xenTabPageSnapshotType = new NewPolicySnapshotTypePage();
xenTabPageVMsPage = new NewVMGroupVMsPage<VMSS>();
xenTabPageFinish = new NewPolicyFinishPage(Messages.VMSS_FINISH_PAGE_TEXT, Messages.VMSS_FINISH_PAGE_CHECKBOX_TEXT, Messages.VMSS_FINISH_TITLE);
xenTabPageRBAC = new RBACWarningPage();
xenTabPageVMsPage.Pool = pool;
xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage();
xenTabPageSnapshotFrequency.Pool = pool;
#region RBAC Warning Page Checks
if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
{
//do nothing
}
else
{
RBACWarningPage.WizardPermissionCheck check;
check = new RBACWarningPage.WizardPermissionCheck(Messages.RBAC_WARNING_VMSS);
check.AddApiCheck("VMSS.async_create");
check.Blocking = true;
xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
AddPage(xenTabPageRBAC, 0);
}
#endregion
AddPages(xenTabPagePolicy, xenTabPageVMsPage);
AddPage(xenTabPageSnapshotType);
AddPages(xenTabPageSnapshotFrequency);
AddPages(xenTabPageFinish);
}
public NewPolicyWizard(Pool pool, List<VM> selection)
: this(pool)
{
this.xenTabPageVMsPage.SelectedVMs = selection;
}
private new string GetSummary()
{
return string.Format(Messages.VMSS_POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs),
FormatBackupType(xenTabPageSnapshotType.BackupType),
FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG));
}
private static string FormatBackupType(vmss_type backupType)
{
if (backupType == vmss_type.snapshot)
return Messages.DISKS_ONLY;
else if (backupType == vmss_type.checkpoint)
return Messages.DISKS_AND_MEMORY;
else if (backupType == vmss_type.snapshot_with_quiesce)
return Messages.QUIESCED_SNAPSHOTS;
throw new ArgumentException("wrong argument");
}
internal static string FormatSchedule(Dictionary<string, string> schedule, vmss_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode)
{
if (backupFrequency == vmss_frequency.hourly)
{
return string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"]);
}
else if (backupFrequency == vmss_frequency.daily)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true));
}
else if (backupFrequency == vmss_frequency.weekly)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode));
}
return "";
}
private static string CommaSeparated(IEnumerable<VM> selectedVMs)
{
var sb = new StringBuilder();
foreach (var selectedVM in selectedVMs)
{
sb.Append(selectedVM.Name);
sb.Append(", ");
}
if (sb.Length > 2)
sb.Remove(sb.Length - 2, 2);
return sb.ToString();
}
protected override void UpdateWizardContent(XenTabPage senderPage)
{
var prevPageType = senderPage.GetType();
if (prevPageType == typeof(NewPolicyPolicyNamePage))
{
xenTabPageVMsPage.GroupName = xenTabPagePolicy.PolicyName;
}
else
{
if (prevPageType == typeof(NewPolicySnapshotFrequencyPage))
{
xenTabPageFinish.Summary = GetSummary();
xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count;
}
else if (prevPageType == typeof(NewVMGroupVMsPage<VMSS>))
{
xenTabPageSnapshotType.SelectedVMs = xenTabPageVMsPage.SelectedVMs;
}
}
}
protected override void FinishWizard()
{
var vmss = new VMSS
{
name_label = xenTabPagePolicy.PolicyName,
name_description = xenTabPagePolicy.PolicyDescription,
type = (vmss_type)xenTabPageSnapshotType.BackupType,
frequency = (vmss_frequency)xenTabPageSnapshotFrequency.Frequency,
schedule = xenTabPageSnapshotFrequency.Schedule,
retained_snapshots = xenTabPageSnapshotFrequency.BackupRetention,
enabled = xenTabPageVMsPage.SelectedVMs.Count == 0 ? false : true,
Connection = Pool.Connection
};
var action = new CreateVMPolicy(vmss, xenTabPageVMsPage.SelectedVMs, xenTabPageFinish.RunNow);
action.RunAsync();
base.FinishWizard();
}
protected override string WizardPaneHelpID()
{
if (CurrentStepTabPage is RBACWarningPage)
{
return FormatHelpId("Rbac");
}
return "NewPolicyWizardVMSS_" + CurrentStepTabPage.HelpID + "Pane";
}
}
}

View File

@ -1,278 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Globalization;
using System.Text;
using XenAdmin.Actions;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenAPI;
using XenAdmin.Wizards.GenericPages;
namespace XenAdmin.Wizards.NewPolicyWizard
{
//See notes in base class
public class NewPolicyWizardSpecific<T> : NewPolicyWizard where T : XenObject<T>
{
private readonly NewVMGroupVMsPage<T> xenTabPageVMsPage;
private readonly NewPolicySnapshotTypePageSpecific<T> xenTabPageSnapshotType;
public NewPolicyWizardSpecific(Pool pool)
:base(pool)
{
this.Text = VMGroup<T>.VMPolicyWizardTitle;
xenTabPagePolicy = new NewPolicyPolicyNamePage(VMGroup<T>.VMPolicyNamePageText, VMGroup<T>.VMPolicyNamePageTextMore,
VMGroup<T>.VMPolicyNamePageTabName, VMGroup<T>.VMPolicyNamePageTabText, VMGroup<T>.VMPolicyNamePageNameFieldText);
xenTabPageSnapshotType = new NewPolicySnapshotTypePageSpecific<T>();
xenTabPageVMsPage = new NewVMGroupVMsPage<T>();
xenTabPageFinish = new NewPolicyFinishPage(VMGroup<T>.VMPolicyFinishPageText, VMGroup<T>.VMPolicyFinishPageCheckboxText, VMGroup<T>.VMPolicyFinishPageTitle);
xenTabPageRBAC = new RBACWarningPage();
xenTabPageVMsPage.Pool = pool;
xenTabPageSnapshotFrequency = new NewPolicySnapshotFrequencyPage();
xenTabPageSnapshotFrequency.Pool = pool;
#region RBAC Warning Page Checks
if (Pool.Connection.Session.IsLocalSuperuser || Helpers.GetMaster(Pool.Connection).external_auth_type == Auth.AUTH_TYPE_NONE)
{
//do nothing
}
else
{
RBACWarningPage.WizardPermissionCheck check;
check = new RBACWarningPage.WizardPermissionCheck(VMGroup<T>.VMPolicyRBACWarning);
check.AddApiCheck(VMGroup<T>.VMPolicyRBACapiCheck);
check.Blocking = true;
xenTabPageRBAC.AddPermissionChecks(xenConnection, check);
AddPage(xenTabPageRBAC, 0);
}
#endregion
AddPages(xenTabPagePolicy, xenTabPageVMsPage);
AddPage(xenTabPageSnapshotType);
AddPages(xenTabPageSnapshotFrequency);
if (VMGroup<T>.isVMPolicyVMPP)
{
xenTabPageArchive = new NewPolicyArchivePage();
xenTabPageArchive.Pool = pool;
AddPage(xenTabPageArchive);
xenTabPageEmail = new NewPolicyEmailPage();
xenTabPageEmail.Pool = pool;
AddPages(xenTabPageEmail);
}
AddPages(xenTabPageFinish);
}
public NewPolicyWizardSpecific(Pool pool, List<VM> selection)
: this(pool)
{
this.xenTabPageVMsPage.SelectedVMs = selection;
}
private new string GetSummary()
{
if (VMGroup<T>.isVMPolicyVMPP)
{
return string.Format(Messages.POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs),
FormatBackupType(xenTabPageSnapshotType.BackupType),
FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG),
FormatSchedule(xenTabPageArchive.Schedule, xenTabPageArchive.ArchiveFrequency, DaysWeekCheckboxes.DaysMode.L10N_LONG));
}
else
{
return string.Format(Messages.VMSS_POLICY_SUMMARY.Replace("\\n", "\n").Replace("\\r", "\r"), xenTabPagePolicy.PolicyName, CommaSeparated(xenTabPageVMsPage.SelectedVMs),
FormatBackupType(xenTabPageSnapshotType.BackupType),
FormatSchedule(xenTabPageSnapshotFrequency.Schedule, xenTabPageSnapshotFrequency.Frequency, DaysWeekCheckboxes.DaysMode.L10N_LONG));
}
}
private int GetBackupDaysCount()
{
string days;
return xenTabPageSnapshotFrequency.Schedule.TryGetValue("days", out days) ? days.Split(',').Length : 0;
}
private static string FormatBackupType(policy_backup_type backupType)
{
if (backupType == policy_backup_type.snapshot)
return Messages.DISKS_ONLY;
else if (backupType == policy_backup_type.checkpoint)
return Messages.DISKS_AND_MEMORY;
else if (backupType == policy_backup_type.snapshot_with_quiesce)
return Messages.QUIESCED_SNAPSHOTS;
throw new ArgumentException("wrong argument");
}
// These two instances of FormatSchedule used to be in the VMPP class. That's probably where
// they really belong, but because of the way they're constructed (see DaysWeekCheckboxes.L10NDays())
// they had to move into the View. (CA-51612).
internal static string FormatSchedule(Dictionary<string, string> schedule, vmpp_archive_frequency archiveType, DaysWeekCheckboxes.DaysMode mode)
{
if (archiveType == vmpp_archive_frequency.always_after_backup)
{
return Messages.ASAPSNAPSHOTTAKEN;
}
else if (archiveType == vmpp_archive_frequency.never)
{
return Messages.NEVER;
}
else if (archiveType == vmpp_archive_frequency.daily)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true));
}
else if (archiveType == vmpp_archive_frequency.weekly)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode));
}
return "";
}
internal static string FormatSchedule(Dictionary<string, string> schedule, policy_frequency backupFrequency, DaysWeekCheckboxes.DaysMode mode)
{
if (backupFrequency == policy_frequency.hourly)
{
return string.Format(Messages.HOURLY_SCHEDULE_FORMAT, schedule["min"]);
}
else if (backupFrequency == policy_frequency.daily)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.DAILY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true));
}
else if (backupFrequency == policy_frequency.weekly)
{
DateTime value = DateTime.Parse(string.Format("{0}:{1}", schedule["hour"], schedule["min"]), CultureInfo.InvariantCulture);
return string.Format(Messages.WEEKLY_SCHEDULE_FORMAT, HelpersGUI.DateTimeToString(value, Messages.DATEFORMAT_HM, true), DaysWeekCheckboxes.L10NDays(schedule["days"], mode));
}
return "";
}
private static string CommaSeparated(IEnumerable<VM> selectedVMs)
{
var sb = new StringBuilder();
foreach (var selectedVM in selectedVMs)
{
sb.Append(selectedVM.Name);
sb.Append(", ");
}
if (sb.Length > 2)
sb.Remove(sb.Length - 2, 2);
return sb.ToString();
}
protected override void UpdateWizardContent(XenTabPage senderPage)
{
var prevPageType = senderPage.GetType();
if (prevPageType == typeof(NewPolicyPolicyNamePage))
{
xenTabPageVMsPage.GroupName = xenTabPagePolicy.PolicyName;
}
else if (VMGroup<T>.isVMPolicyVMPP)
{
if (prevPageType == typeof(NewPolicySnapshotFrequencyPage))
{
xenTabPageArchive.SnapshotFrequency = (vmpp_backup_frequency)xenTabPageSnapshotFrequency.Frequency;
xenTabPageArchive.BackupDaysCount = GetBackupDaysCount();
}
else if (prevPageType == typeof(NewPolicyEmailPage))
{
xenTabPageFinish.Summary = GetSummary();
xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count;
}
}
else
{
if (prevPageType == typeof(NewPolicySnapshotFrequencyPage))
{
xenTabPageFinish.Summary = GetSummary();
xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count;
}
else if (prevPageType == typeof(NewVMGroupVMsPage<T>))
{
xenTabPageSnapshotType.SelectedVMs = xenTabPageVMsPage.SelectedVMs;
}
}
}
protected override void FinishWizard()
{
var action = VMGroup<T>.VMCreateObjectAction(
xenTabPagePolicy.PolicyName,
xenTabPagePolicy.PolicyDescription,
xenTabPageSnapshotType.BackupType,
xenTabPageSnapshotFrequency.Frequency,
xenTabPageSnapshotFrequency.Schedule,
xenTabPageSnapshotFrequency.BackupRetention,
xenTabPageArchive != null ? xenTabPageArchive.ArchiveFrequency : vmpp_archive_frequency.unknown,
xenTabPageArchive != null ? xenTabPageArchive.ArchiveConfig : null,
xenTabPageArchive != null ? xenTabPageArchive.ArchiveTargetType : vmpp_archive_target_type.unknown,
xenTabPageArchive != null ? xenTabPageArchive.Schedule : null,
xenTabPageEmail != null ? xenTabPageEmail.EmailEnabled : false,
xenTabPageEmail != null ? xenTabPageEmail.EmailSettings : null,
xenTabPageVMsPage.SelectedVMs.Count == 0 ? false : true,
xenTabPageVMsPage.SelectedVMs,
xenTabPageFinish.RunNow,
Pool.Connection);
action.RunAsync();
base.FinishWizard();
}
protected override string WizardPaneHelpID()
{
if (CurrentStepTabPage is RBACWarningPage)
{
return FormatHelpId("Rbac");
}
else if (!VMGroup<T>.isVMPolicyVMPP)
{
return "NewPolicyWizardVMSS_" + CurrentStepTabPage.HelpID + "Pane";
}
return "NewPolicyWizard_" + CurrentStepTabPage.HelpID + "Pane";
}
}
}

View File

@ -167,6 +167,7 @@
<Compile Include="Controls\DataGridViewEx\DataGridViewEx.Designer.cs">
<DependentUpon>DataGridViewEx.cs</DependentUpon>
</Compile>
<Compile Include="Controls\DataGridViewTextAndImageCell.cs" />
<Compile Include="Controls\FolderChangeDialogTreeView.cs">
<SubType>Component</SubType>
</Compile>
@ -705,12 +706,6 @@
<Compile Include="Wizards\CrossPoolMigrateWizard\IntraPoolCopyPage.Designer.cs">
<DependentUpon>IntraPoolCopyPage.cs</DependentUpon>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicySnapshotTypePageSpecific.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyWizardSpecific.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Wizards\ImportWizard\HardwareCompatibilityFilter.cs" />
<Compile Include="Wizards\NewSRWizard_Pages\Frontends\CIFSFrontend.cs">
<SubType>UserControl</SubType>
@ -3453,18 +3448,17 @@
<Compile Include="Dialogs\VMDialogs\MoveVMDialog.Designer.cs">
<DependentUpon>MoveVMDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\VMProtectionRecovery\DataGridViewTextAndImageCell.cs" />
<Compile Include="Dialogs\VMProtectionRecovery\PolicyHistory.cs">
<Compile Include="Dialogs\ScheduledSnapshots\PolicyHistory.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Dialogs\VMProtectionRecovery\PolicyHistory.Designer.cs">
<Compile Include="Dialogs\ScheduledSnapshots\PolicyHistory.Designer.cs">
<DependentUpon>PolicyHistory.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\VMProtectionRecovery\VMProtectionPoliciesDialog.cs">
<Compile Include="Dialogs\ScheduledSnapshots\ScheduledSnapshotsDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Dialogs\VMProtectionRecovery\VMProtectionPoliciesDialog.Designer.cs">
<DependentUpon>VMProtectionPoliciesDialog.cs</DependentUpon>
<Compile Include="Dialogs\ScheduledSnapshots\ScheduledSnapshotsDialog.Designer.cs">
<DependentUpon>ScheduledSnapshotsDialog.cs</DependentUpon>
</Compile>
<Compile Include="Dialogs\Wlb\ConfirmDeconfigureWLBDialog.cs">
<SubType>Form</SubType>
@ -3672,18 +3666,6 @@
<Compile Include="Wizards\NewPolicyWizard\LocalServerTime.Designer.cs">
<DependentUpon>LocalServerTime.cs</DependentUpon>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyArchivePage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyArchivePage.Designer.cs">
<DependentUpon>NewPolicyArchivePage.cs</DependentUpon>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyEmailPage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyEmailPage.Designer.cs">
<DependentUpon>NewPolicyEmailPage.cs</DependentUpon>
</Compile>
<Compile Include="Wizards\NewPolicyWizard\NewPolicyFinishPage.cs">
<SubType>UserControl</SubType>
</Compile>
@ -5545,24 +5527,24 @@
<EmbeddedResource Include="Dialogs\VMDialogs\SelectVMsToSuspendDialog.zh-CN.resx">
<DependentUpon>SelectVMsToSuspendDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\PolicyHistory.ja.resx">
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\PolicyHistory.ja.resx">
<DependentUpon>PolicyHistory.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\PolicyHistory.resx">
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\PolicyHistory.resx">
<DependentUpon>PolicyHistory.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\PolicyHistory.zh-CN.resx">
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\PolicyHistory.zh-CN.resx">
<DependentUpon>PolicyHistory.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\VMProtectionPoliciesDialog.ja.resx">
<DependentUpon>VMProtectionPoliciesDialog.cs</DependentUpon>
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\ScheduledSnapshotsDialog.ja.resx">
<DependentUpon>ScheduledSnapshotsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\VMProtectionPoliciesDialog.resx">
<DependentUpon>VMProtectionPoliciesDialog.cs</DependentUpon>
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\ScheduledSnapshotsDialog.resx">
<DependentUpon>ScheduledSnapshotsDialog.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VMProtectionRecovery\VMProtectionPoliciesDialog.zh-CN.resx">
<DependentUpon>VMProtectionPoliciesDialog.cs</DependentUpon>
<EmbeddedResource Include="Dialogs\ScheduledSnapshots\ScheduledSnapshotsDialog.zh-CN.resx">
<DependentUpon>ScheduledSnapshotsDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Dialogs\VmSnapshotDialog.ja.resx">
<DependentUpon>VmSnapshotDialog.cs</DependentUpon>
@ -6339,25 +6321,6 @@
<EmbeddedResource Include="Wizards\NewPolicyWizard\LocalServerTime.zh-CN.resx">
<DependentUpon>LocalServerTime.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyArchivePage.ja.resx">
<DependentUpon>NewPolicyArchivePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyArchivePage.resx">
<DependentUpon>NewPolicyArchivePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyArchivePage.zh-CN.resx">
<DependentUpon>NewPolicyArchivePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyEmailPage.ja.resx">
<DependentUpon>NewPolicyEmailPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyEmailPage.resx">
<DependentUpon>NewPolicyEmailPage.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyEmailPage.zh-CN.resx">
<DependentUpon>NewPolicyEmailPage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Wizards\NewPolicyWizard\NewPolicyFinishPage.ja.resx">
<DependentUpon>NewPolicyFinishPage.cs</DependentUpon>
</EmbeddedResource>

View File

@ -36,7 +36,7 @@ using System.Windows.Forms;
using NUnit.Framework;
using XenAdmin.Controls;
using XenAdmin.Dialogs;
using XenAdmin.Dialogs.VMProtection_Recovery;
using XenAdmin.Dialogs.ScheduledSnapshots;
namespace XenAdminTests.DialogTests.state1_xml.DialogsForPool
{
@ -76,11 +76,11 @@ namespace XenAdminTests.DialogTests.state2_xml.DialogsForPool
namespace XenAdminTests.DialogTests.cowleyPolicies_xml.DialogsForPool
{
[TestFixture, Category(TestCategories.UICategoryA)]
public class VMProtectionPoliciesDialogTest : DialogTest<VMProtectionPoliciesDialog>
public class VMProtectionPoliciesDialogTest : DialogTest<ScheduledSnapshotsDialog>
{
protected override VMProtectionPoliciesDialog NewDialog()
protected override ScheduledSnapshotsDialog NewDialog()
{
return new VMProtectionPoliciesDialog(GetAnyPool());
return new ScheduledSnapshotsDialog(GetAnyPool());
}
}
}

View File

@ -188,7 +188,7 @@ namespace XenAdminTests
caches[connectionId].Setup(c => c.VDIs).Returns(GeneratedXenObjects<VDI>(connectionId));
caches[connectionId].Setup(c => c.VGPUs).Returns(GeneratedXenObjects<VGPU>(connectionId));
caches[connectionId].Setup(c => c.VIFs).Returns(GeneratedXenObjects<VIF>(connectionId));
caches[connectionId].Setup(c => c.VMPPs).Returns(GeneratedXenObjects<VMPP>(connectionId));
caches[connectionId].Setup(c => c.VMSSs).Returns(GeneratedXenObjects<VMSS>(connectionId));
caches[connectionId].Setup(c => c.VM_appliances).Returns(GeneratedXenObjects<VM_appliance>(connectionId));
caches[connectionId].Setup(c => c.VMs).Returns(GeneratedXenObjects<VM>(connectionId));
}

View File

@ -74,7 +74,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -117,7 +116,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -186,7 +184,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)}),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -229,7 +226,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -300,7 +296,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -343,7 +338,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -414,7 +408,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -457,7 +450,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -529,7 +521,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -572,7 +563,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", true),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -646,7 +636,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -689,7 +678,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -764,7 +752,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -807,7 +794,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -885,7 +871,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -928,7 +913,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1007,7 +991,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -1050,7 +1033,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1130,7 +1112,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -1173,7 +1154,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1254,7 +1234,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", false, false ),
new ExpectedTextMenuItem("Di&saster Recovery", false, false ),
new ExpectedTextMenuItem("VM &Protection Policies...", false, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", false, false ),
@ -1297,7 +1276,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", false, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1373,7 +1351,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -1416,7 +1393,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1485,7 +1461,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -1528,7 +1503,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&New VM...", true, false ),
new ExpectedTextMenuItem("&Start/Shut down", false, false, new ExpectedMenuItem[]{new ExpectedTextMenuItem("&Start", false),new ExpectedTextMenuItem("S&uspend", false),new ExpectedTextMenuItem("Reb&oot", false),new ExpectedTextMenuItem("Start in Reco&very Mode", false),new ExpectedSeparator(),new ExpectedTextMenuItem("Force Shut&down", false),new ExpectedTextMenuItem("Force Re&boot", false )}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false ),
new ExpectedTextMenuItem("Assign to vA&pp", false, false ),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false ),
@ -1601,7 +1575,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -1674,7 +1647,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&Migrate VM wizard...", false, false)
}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false),
new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false),
@ -1745,7 +1717,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -1801,7 +1772,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("Shut Dow&n vApp", false)
}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false),
new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", false, false),
@ -1873,7 +1843,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true, false ),
new ExpectedTextMenuItem("Di&saster Recovery", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Configure...", true), new ExpectedTextMenuItem("&Disaster Recovery Wizard...", true)} ),
new ExpectedTextMenuItem("VM &Protection Policies...", true, false ),
new ExpectedTextMenuItem("E&xport Resource Data...", false, false ),
new ExpectedTextMenuItem("View Wor&kload Reports...", false, false ),
new ExpectedTextMenuItem("Disconnect Workload &Balancing Server", true, false ),
@ -1938,7 +1907,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("incubus (INTERNAL_ERROR)", false, false, true)
}),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", false, false),
new ExpectedTextMenuItem("Assign to vA&pp", true, false, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Copy VM...", true, false),

View File

@ -181,13 +181,13 @@ namespace XenAdminTests.TabsAndMenus
Assert.AreEqual("view_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.ViewMenu.DropDownItems)[5].Text);
MainWindowWrapper.PoolMenu.ShowDropDown();
Assert.AreEqual("pool_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.PoolMenu.DropDownItems)[20].Text);
Assert.AreEqual("pool_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.PoolMenu.DropDownItems)[19].Text);
MainWindowWrapper.HostMenu.ShowDropDown();
Assert.AreEqual("server_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.HostMenu.DropDownItems)[21].Text);
MainWindowWrapper.VMMenu.ShowDropDown();
Assert.AreEqual("vm_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.VMMenu.DropDownItems)[19].Text);
Assert.AreEqual("vm_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.VMMenu.DropDownItems)[18].Text);
MainWindowWrapper.TemplatesMenu.ShowDropDown();
Assert.AreEqual("templates_ShellTest1", GetVisibleToolStripItems(MainWindowWrapper.TemplatesMenu.DropDownItems)[7].Text);

View File

@ -304,7 +304,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedSeparator(),
new ExpectedTextMenuItem("&High Availability...", true)
};
expected.Add(new ExpectedTextMenuItem("VM Pr&otection Policies...", true));
expected.Add(new ExpectedTextMenuItem("Manage &vApps...", true));
expected.Add(new ExpectedTextMenuItem("Di&saster Recovery", true, new ExpectedMenuItem[]
{
@ -410,7 +409,6 @@ namespace XenAdminTests.TabsAndMenus
expectedMenuItems.Add(new ExpectedTextMenuItem("Ta&ke a Snapshot...", true));
expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) }));
expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }));
expectedMenuItems.Add(new ExpectedSeparator());
expectedMenuItems.Add(new ExpectedTextMenuItem("P&roperties", true));
@ -429,7 +427,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("Force Re&boot", true),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Ta&ke a Snapshot...", true),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) }),
new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }),
new ExpectedSeparator(),
new ExpectedTextMenuItem("Inst&all " + Branding.PRODUCT_BRAND + " Tools...", true),
@ -459,7 +456,6 @@ namespace XenAdminTests.TabsAndMenus
new ExpectedTextMenuItem("&Export...", true),
new ExpectedTextMenuItem("Ta&ke a Snapshot...", true),
new ExpectedTextMenuItem("Co&nvert to Template...", true),
new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true) }),
new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true) }),
new ExpectedSeparator(),
new ExpectedTextMenuItem("&Delete VM...", true),

View File

@ -268,7 +268,7 @@ namespace XenAdminTests.TabsAndMenus
{
foreach (VM vm in GetAllXenObjects<VM>(HasTools))
{
if(vm.Name.Contains("23")) //Skip over the slave servers VMs
if(vm.Name.Contains("22")) //Skip over the slave servers VMs
continue;
List<ExpectedMenuItem> expectedMenuItems = new List<ExpectedMenuItem>();
@ -298,7 +298,6 @@ namespace XenAdminTests.TabsAndMenus
}));
expectedMenuItems.Add(new ExpectedSeparator());
expectedMenuItems.Add(new ExpectedTextMenuItem("Ta&ke a Snapshot...", true));
expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to VM Protection Polic&y", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New Policy...", true)}));
expectedMenuItems.Add(new ExpectedTextMenuItem("Assign to vA&pp", true, new ExpectedMenuItem[] { new ExpectedTextMenuItem("&New vApp...", true)}));

View File

@ -44,7 +44,7 @@ namespace XenAdminTests.UnitTests
public void Test1()
{
//Test when the day this week already past
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Tuesday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Tuesday });
Assert.AreEqual(new DateTime(2010, 10, 26, 10, 15, 0), time);
}
@ -52,7 +52,7 @@ namespace XenAdminTests.UnitTests
public void Test2()
{
//Test when the day is today but the time alreday past
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 59, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday });
Assert.AreEqual(new DateTime(2010, 10, 27, 10, 15, 0), time);
}
@ -60,7 +60,7 @@ namespace XenAdminTests.UnitTests
public void Test3()
{
//Test when the day is today but the time did not pass
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday });
Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time);
}
@ -68,7 +68,7 @@ namespace XenAdminTests.UnitTests
public void Test4()
{
//Test when the day is today but the time did not pass with more than one day
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday,DayOfWeek.Monday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 00, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Monday });
Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time);
}
@ -76,7 +76,7 @@ namespace XenAdminTests.UnitTests
public void Test5()
{
//Today already past take next day in same week
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Thursday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Thursday });
Assert.AreEqual(new DateTime(2010, 10, 21, 10, 15, 0), time);
}
@ -84,7 +84,7 @@ namespace XenAdminTests.UnitTests
public void Test6()
{
//Today already past take next day in next week
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Monday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 30, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Monday });
Assert.AreEqual(new DateTime(2010, 10, 25, 10, 15, 0), time);
}
@ -92,7 +92,7 @@ namespace XenAdminTests.UnitTests
public void Test7()
{
//Today already past take next day in next week
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 15, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Monday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 20, 10, 15, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Wednesday, DayOfWeek.Monday });
Assert.AreEqual(new DateTime(2010, 10, 20, 10, 15, 0), time);
}
@ -100,7 +100,7 @@ namespace XenAdminTests.UnitTests
public void Test8()
{
//Check Sunday and unsorted list
var time = VMPP.GetWeeklyDate(new DateTime(2010, 10, 24, 10, 16, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Sunday, DayOfWeek.Monday });
var time = VMSS.GetWeeklyDate(new DateTime(2010, 10, 24, 10, 16, 0), 10, 15, new List<DayOfWeek> { DayOfWeek.Sunday, DayOfWeek.Monday });
Assert.AreEqual(new DateTime(2010, 10, 25, 10, 15, 0), time);
}

View File

@ -29,8 +29,6 @@
* SUCH DAMAGE.
*/
using System.Threading;
using System.Windows.Forms;
using NUnit.Framework;
using XenAdmin.Wizards.NewPolicyWizard;
@ -38,21 +36,21 @@ namespace XenAdminTests.WizardTests.cowleyPolicies_xml
{
[TestFixture, Category(TestCategories.UICategoryB)]
class NewPolicyWizardTest : WizardTest<NewPolicyWizardSpecific<XenAPI.VMPP>>
class NewPolicyWizardTest : WizardTest<NewPolicyWizard>
{
public NewPolicyWizardTest()
: base(new string[] { "Policy Name", "Protected VMs", "Snapshot Type", "Snapshot schedule","Archive Options","Email Alerts","Finish" }
: base(new string[] { "Schedule Name", "VMs in the snapshot schedule", "Snapshot Type", "Snapshot schedule","Finish" }
, true, false)
{ }
protected override NewPolicyWizardSpecific<XenAPI.VMPP> NewWizard()
protected override NewPolicyWizard NewWizard()
{
return new NewPolicyWizardSpecific<XenAPI.VMPP>(base.GetAnyPool());
return new NewPolicyWizard(base.GetAnyPool());
}
protected override void TestPage(string pageName)
{
if (pageName == "Policy Name")
if (pageName == "Schedule Name")
{
MW(() => (TestUtils.GetTextBox(wizard, "xenTabPagePolicy.textBoxName")).Text = "policy");
}

View File

@ -47,7 +47,7 @@ namespace XenAdminTests.XenModelTests
[Test]
public void TestEmptyList()
{
var action = new DestroyPolicyAction<VMPP>(mockConnection.Object, new List<IVMPolicy>());
var action = new DestroyPolicyAction(mockConnection.Object, new List<VMSS>());
action.Completed += action_Completed;
action.RunAsync();
_autoResetEvent.WaitOne();
@ -62,30 +62,30 @@ namespace XenAdminTests.XenModelTests
[Test]
public void TestOneInList()
{
mockProxy.Setup(x => x.vmpp_destroy(It.IsAny<string>(), "1")).Returns(new Response<string>(""));
mockProxy.Setup(x => x.vm_set_protection_policy(It.IsAny<string>(), "1", It.IsAny<string>())).Returns(new Response<string>(""));
var action = new DestroyPolicyAction<VMPP>(mockConnection.Object, new List<IVMPolicy>()
{new VMPP(){opaque_ref = "1",VMs = new List<XenRef<VM>>(){new XenRef<VM>("1")}}});
mockProxy.Setup(x => x.vmss_destroy(It.IsAny<string>(), "1")).Returns(new Response<string>(""));
mockProxy.Setup(x => x.vm_set_snapshot_schedule(It.IsAny<string>(), "1", It.IsAny<string>())).Returns(new Response<string>(""));
var action = new DestroyPolicyAction(mockConnection.Object, new List<VMSS>()
{new VMSS(){opaque_ref = "1",VMs = new List<XenRef<VM>>(){new XenRef<VM>("1")}}});
action.Completed += action_Completed;
action.RunAsync();
_autoResetEvent.WaitOne();
Assert.True(action.Succeeded,action.Exception!=null?action.Exception.ToString():"");
mockProxy.VerifyAll();
mockProxy.Verify(x => x.vm_set_protection_policy(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Once());
mockProxy.Verify(x => x.vm_set_snapshot_schedule(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Once());
}
[Test]
public void TestOneWithTwonVMsInList()
{
mockProxy.Setup(x => x.vmpp_destroy(It.IsAny<string>(),"1")).Returns(new Response<string>(""));
mockProxy.Setup(x => x.vm_set_protection_policy(It.IsAny<string>(), It.Is<string>(s=>s=="1"||s=="2"), It.IsAny<string>())).Returns(new Response<string>(""));
var action = new DestroyPolicyAction<VMPP>(mockConnection.Object, new List<IVMPolicy>()
{ new VMPP() { opaque_ref = "1", VMs = new List<XenRef<VM>>() { new XenRef<VM>("1"), new XenRef<VM>("2") } } });
mockProxy.Setup(x => x.vmss_destroy(It.IsAny<string>(),"1")).Returns(new Response<string>(""));
mockProxy.Setup(x => x.vm_set_snapshot_schedule(It.IsAny<string>(), It.Is<string>(s => s == "1" || s == "2"), It.IsAny<string>())).Returns(new Response<string>(""));
var action = new DestroyPolicyAction(mockConnection.Object, new List<VMSS>()
{ new VMSS() { opaque_ref = "1", VMs = new List<XenRef<VM>>() { new XenRef<VM>("1"), new XenRef<VM>("2") } } });
action.Completed += action_Completed;
action.RunAsync();
_autoResetEvent.WaitOne();
Assert.True(action.Succeeded, action.Exception != null ? action.Exception.ToString() : "");
mockProxy.Verify(x => x.vm_set_protection_policy(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Exactly(2));
mockProxy.Verify(x => x.vm_set_snapshot_schedule(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()), Times.Exactly(2));
mockProxy.VerifyAll();
}

View File

@ -46,24 +46,6 @@ namespace XenAdminTests.XenModelTests
public class PureAsyncActionTests : ActionTestBase
{
readonly AutoResetEvent _autoResetEvent = new AutoResetEvent(false);
[Test]
public void VMTestPureAsyncAction()
{
mockProxy.Setup(x => x.vmpp_archive_now(It.IsAny<string>(), "testvm")).Returns(new Response<string>(""));
mockProxy.Setup(x => x.task_add_to_other_config(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())).Returns(new Response<string>(""));
mockProxy.Setup(x => x.task_remove_from_other_config(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())).Returns(new Response<string>(""));
VM vm = GetVM();
SetupPureAsyncAction(vm);
//Async call pure async action extra setups needed
ExtraAsyncMethodsSetup();
var action = new ArchiveNowAction(vm);
action.Completed += action_Completed;
action.RunAsync();
_autoResetEvent.WaitOne();
Assert.True(action.Succeeded);
mockProxy.VerifyAll();
}
private void ExtraAsyncMethodsSetup()
{
@ -137,7 +119,7 @@ namespace XenAdminTests.XenModelTests
mockConnection.Setup(x => x.Cache).Returns(cache);
mockConnection.Setup(x => x.ResolveAll(It.IsAny<IEnumerable<XenRef<Role>>>()))
.Returns(new List<Role>() {
new Role() { name_label = "vmpp.archive_now" }
new Role() { name_label = "vm.set_is_a_template" }
,new Role() { name_label = "vm.destroy" }
,new Role() { name_label = "vm.clean_shutdown" }
, new Role() { name_label = "task.add_to_other_config/key:xencenteruuid" }

View File

@ -1,76 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Text;
using XenAPI;
namespace XenAdmin.Actions
{
public class ArchiveNowAction : PureAsyncAction
{
private VM _snapshot;
public ArchiveNowAction(VM snapshot)
: base(snapshot.Connection, string.Format(Messages.ARCHIVE_SNAPSHOT_X, snapshot.Name))
{
_snapshot = snapshot;
VM = snapshot.Connection.Resolve(snapshot.snapshot_of);
}
protected override void Run()
{
try
{
Description = string.Format(Messages.ARCHIVING_SNAPSHOT_X, _snapshot.Name);
RelatedTask=new XenRef<Task>(VMPP.archive_now(Session, _snapshot.opaque_ref));
PollToCompletion();
Description = string.Format(Messages.ARCHIVED_SNAPSHOT_X, _snapshot.Name);
}
catch (Exception e)
{
Failure f = e as Failure;
if (f != null)
{
string msg = "";
if (f.ErrorDescription.Count > 3)
{
msg = XenAPI.Message.FriendlyName(f.ErrorDescription[3]);
}
throw new Exception(msg);
}
throw;
}
}
}
}

View File

@ -1,65 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Text;
using XenAdmin.Network;
using XenAPI;
using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class ChangePolicyEnabledAction<T> : PureAsyncAction where T : XenObject<T>
{
private IVMPolicy _policy;
public ChangePolicyEnabledAction(IVMPolicy policy)
: base(policy.Connection, string.Format(Messages.CHANGE_POLICY_STATUS, policy.Name))
{
_policy = policy;
Pool = Helpers.GetPool(_policy.Connection);
}
protected override void Run()
{
bool value = !_policy.is_enabled;
Description = value ? string.Format(typeof(T) == typeof(VMPP) ? Messages.ENABLING_VMPP : Messages.ENABLING_VMSS, _policy.Name) :
string.Format(typeof(T) == typeof(VMPP) ? Messages.DISABLING_VMPP : Messages.DISABLING_VMSS, _policy.Name);
_policy.set_is_enabled(Session, _policy.opaque_ref, !_policy.is_enabled);
Description = value ? string.Format(typeof(T) == typeof(VMPP) ? Messages.ENABLED_VMPP : Messages.ENABLED_VMSS, _policy.Name) :
string.Format(typeof(T) == typeof(VMPP) ? Messages.DISABLED_VMPP : Messages.DISABLED_VMSS, _policy.Name);
}
}
}

View File

@ -1,68 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using System.Text;
using XenAdmin.Alerts;
using XenAPI;
using System.Diagnostics;
namespace XenAdmin.Actions
{
public class GetVMPPAlertsAction : PureAsyncAction
{
public readonly VMPP VMPP;
private int _hoursFromNow;
public GetVMPPAlertsAction(VMPP vmpp,int hoursfromNow)
: base(vmpp.Connection, "", true)
{
VMPP = vmpp;
_hoursFromNow = hoursfromNow;
}
protected override void Run()
{
var now = DateTime.Now;
var result = new List<string>(VMPP.get_alerts(VMPP.Connection.Session, VMPP.opaque_ref, _hoursFromNow));
var listAlerts=new List<PolicyAlert>();
foreach(string item in result)
{
listAlerts.Add(new PolicyAlert(VMPP.Connection,item));
}
VMPP.Alerts=new List<PolicyAlert>(listAlerts);
Debug.WriteLine(string.Format("GetAlerts took: {0}", DateTime.Now - now));
}
}
}

View File

@ -36,14 +36,14 @@ using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class AssignVMsToPolicyAction<T>:PureAsyncAction where T : XenObject<T>
public class AssignVMsToPolicyAction : PureAsyncAction
{
private IVMPolicy _policy;
private VMSS _policy;
private List<XenRef<VM>> _selectedVMs;
public AssignVMsToPolicyAction(IVMPolicy policy, List<XenRef<VM>> selectedVMs, bool suppressHistory)
: base(policy.Connection, (typeof(T) == typeof(VMPP) ? Messages.ASSIGN_PROTECTION_POLICY_NOAMP : Messages.ASSIGN_VMSS_POLICY_NOAMP), suppressHistory)
public AssignVMsToPolicyAction(VMSS policy, List<XenRef<VM>> selectedVMs, bool suppressHistory)
: base(policy.Connection, Messages.ASSIGN_VMSS_POLICY_NOAMP, suppressHistory)
{
_policy = policy;
_selectedVMs = selectedVMs;
@ -53,32 +53,32 @@ namespace XenAdmin.Actions
protected override void Run()
{
Description = typeof(T) == typeof(VMPP) ? Messages.ASSIGNING_PROTECTION_POLICY : Messages.ASSIGNING_VMSS_POLICY;
Description = Messages.ASSIGNING_VMSS_POLICY;
foreach (var xenRef in _policy.VMs)
{
_policy.set_vm_policy(Session, xenRef, null);
VM.set_snapshot_schedule(Session, xenRef, null);
}
foreach (var xenRef in _selectedVMs)
{
_policy.set_vm_policy(Session, xenRef, _policy.opaque_ref);
VM.set_snapshot_schedule(Session, xenRef, _policy.opaque_ref);
}
Description = (typeof(T) == typeof(VMPP)) ? Messages.ASSIGNED_PROTECTION_POLICY : Messages.ASSIGNED_VMSS_POLICY;
Description = Messages.ASSIGNED_VMSS_POLICY;
}
}
public class RemoveVMsFromPolicyAction<T> : PureAsyncAction where T : XenObject<T>
public class RemoveVMsFromPolicyAction : PureAsyncAction
{
private List<XenRef<VM>> _selectedVMs;
private IVMPolicy _policy;
private VMSS _policy;
public RemoveVMsFromPolicyAction(IVMPolicy policy, List<XenRef<VM>> selectedVMs)
public RemoveVMsFromPolicyAction(VMSS policy, List<XenRef<VM>> selectedVMs)
: base(policy.Connection,
selectedVMs.Count == 1 ?
string.Format(typeof(T) == typeof(VMPP) ? Messages.REMOVE_VM_FROM_POLICY : Messages.REMOVE_VM_FROM_VMSS, policy.Connection.Resolve(selectedVMs[0]), policy.Name) :
string.Format(typeof(T) == typeof(VMPP) ? Messages.REMOVE_VMS_FROM_POLICY : Messages.REMOVE_VMS_FROM_VMSS, policy.Name))
string.Format(Messages.REMOVE_VM_FROM_VMSS, policy.Connection.Resolve(selectedVMs[0]), policy.Name) :
string.Format(Messages.REMOVE_VMS_FROM_VMSS, policy.Name))
{
_policy = policy;
_selectedVMs = selectedVMs;
@ -87,13 +87,13 @@ namespace XenAdmin.Actions
protected override void Run()
{
Description = typeof(T) == typeof(VMPP) ? Messages.REMOVING_VMS_FROM_POLICY : Messages.REMOVING_VMS_FROM_VMSS;
Description = Messages.REMOVING_VMS_FROM_VMSS;
foreach (var xenRef in _selectedVMs)
_policy.set_vm_policy(Session, xenRef, null);
VM.set_snapshot_schedule(Session, xenRef, null);
Description = typeof(T) == typeof(VMPP) ? Messages.REMOVED_VMS_FROM_POLICY : Messages.REMOVED_VMS_FROM_VMSS;
Description = Messages.REMOVED_VMS_FROM_VMSS;
}
}
}

View File

@ -29,38 +29,33 @@
* SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using XenAdmin.Network;
using XenAPI;
using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class TestArchiveTargetAction : PureAsyncAction
public class ChangePolicyEnabledAction : PureAsyncAction
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<string, string> _archiveConfig;
public TestArchiveTargetAction(IXenConnection connection, Dictionary<string, string> archiveConfig)
: base(connection, Messages.TEST_ARCHIVE_LOCATION,true)
private VMSS _policy;
public ChangePolicyEnabledAction(VMSS policy)
: base(policy.Connection, string.Format(Messages.CHANGE_POLICY_STATUS, policy.Name))
{
_archiveConfig = archiveConfig;
_policy = policy;
Pool = Helpers.GetPool(_policy.Connection);
}
protected override void Run()
{
try
{
Result = Pool.test_archive_target(Session, null, _archiveConfig);
}
catch(Exception e)
{
log.Error(e.Message, e);
}
}
bool value = !_policy.enabled;
Description = value ? string.Format(Messages.ENABLING_VMSS, _policy.Name) :
string.Format(Messages.DISABLING_VMSS, _policy.Name);
VMSS.set_enabled(Session, _policy.opaque_ref, !_policy.enabled);
Description = value ? string.Format(Messages.ENABLED_VMSS, _policy.Name) :
string.Format(Messages.DISABLED_VMSS, _policy.Name);
}
}
}

View File

@ -37,47 +37,38 @@ using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class CreateVMPolicy<T> : AsyncAction where T : XenObject<T>
public class CreateVMPolicy : AsyncAction
{
private IVMPolicy _record;
private VMSS _record;
private List<VM> _vms;
private bool _runNow = false;
public CreateVMPolicy(IVMPolicy record, List<VM> vms, bool runNow)
public CreateVMPolicy(VMSS record, List<VM> vms, bool runNow)
: base(record.Connection, Messages.CREATE_POLICY)
{
_record = record;
_vms = vms;
_runNow = runNow;
Pool = Helpers.GetPool(record.Connection);
if (typeof(T) == typeof(VMPP))
{
ApiMethodsToRoleCheck.Add("VMPP.async_create");
ApiMethodsToRoleCheck.Add("VM.set_protection_policy");
ApiMethodsToRoleCheck.Add("VMPP.protect_now");
}
else
{
ApiMethodsToRoleCheck.Add("VMSS.async_create");
ApiMethodsToRoleCheck.Add("VM.set_snapshot_schedule");
ApiMethodsToRoleCheck.Add("VMSS.snapshot_now");
}
ApiMethodsToRoleCheck.Add("VMSS.async_create");
ApiMethodsToRoleCheck.Add("VM.set_snapshot_schedule");
ApiMethodsToRoleCheck.Add("VMSS.snapshot_now");
}
protected override void Run()
{
Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATING_VMPP : Messages.CREATING_VMSS, _record.Name);
RelatedTask = _record.async_task_create(Session);
Description = string.Format(Messages.CREATING_VMSS, _record.Name);
RelatedTask = VMSS.async_create(Session, _record);
PollToCompletion();
var vmppref = new XenRef<T>(Result);
Connection.WaitForCache(vmppref);
var vmssref = new XenRef<VMSS>(Result);
Connection.WaitForCache(vmssref);
foreach (var selectedVM in _vms)
{
_record.set_policy(Session, selectedVM.opaque_ref, vmppref.opaque_ref);
VM.set_snapshot_schedule(Session, selectedVM.opaque_ref, vmssref.opaque_ref);
}
Description = string.Format(typeof(T) == typeof(VMPP) ? Messages.CREATED_VMPP : Messages.CREATED_VMSS, _record.Name);
Description = string.Format(Messages.CREATED_VMSS, _record.Name);
PercentComplete = 60;
if (_runNow)
_record.run_now (Session, vmppref);
VMSS.snapshot_now(Session, vmssref);
PercentComplete = 100;
}
}

View File

@ -39,10 +39,10 @@ using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class DestroyPolicyAction <T> :PureAsyncAction where T: XenObject<T>
public class DestroyPolicyAction: PureAsyncAction
{
private List<IVMPolicy> _selectedToDelete;
public DestroyPolicyAction(IXenConnection connection,List<IVMPolicy> deletePolicies) : base(connection, Messages.DELETE_POLICIES)
private List<VMSS> _selectedToDelete;
public DestroyPolicyAction(IXenConnection connection,List<VMSS> deletePolicies) : base(connection, Messages.DELETE_POLICIES)
{
_selectedToDelete = deletePolicies;
Pool = Helpers.GetPool(connection);
@ -53,14 +53,14 @@ namespace XenAdmin.Actions
foreach (var policy in _selectedToDelete)
{
Description = typeof(T) == typeof(VMPP) ? string.Format(Messages.DELETING_VMPP, policy.Name) : string.Format(Messages.DELETING_VMSS, policy.Name);
Description = string.Format(Messages.DELETING_VMSS, policy.Name);
foreach (var vmref in policy.VMs)
{
policy.set_vm_policy(Session, vmref.opaque_ref, null);
VM.set_snapshot_schedule(Session, vmref.opaque_ref, null);
}
try
{
policy.do_destroy(Session, policy.opaque_ref);
VMSS.destroy(Session, policy.opaque_ref);
}
catch (Exception e)
{
@ -68,7 +68,7 @@ namespace XenAdmin.Actions
throw e;
}
}
Description = typeof(T) == typeof(VMPP) ? Messages.DELETED_VMPP : Messages.DELETED_VMSS;
Description =Messages.DELETED_VMSS;
}
}
}

View File

@ -29,17 +29,16 @@
* SUCH DAMAGE.
*/
using XenAdmin.Network;
using XenAPI;
using XenAdmin.Core;
namespace XenAdmin.Actions
{
public class RunPolicyNowAction<T> : PureAsyncAction where T : XenObject<T>
public class RunPolicyNowAction : PureAsyncAction
{
private IVMPolicy _policy;
public RunPolicyNowAction(IVMPolicy policy)
private VMSS _policy;
public RunPolicyNowAction(VMSS policy)
: base(policy.Connection, string.Format(Messages.RUN_POLICY, policy.Name))
{
_policy = policy;
@ -48,7 +47,7 @@ namespace XenAdmin.Actions
protected override void Run()
{
Result = _policy.run_now(Session, _policy.opaque_ref);
Result = VMSS.snapshot_now(Session, _policy.opaque_ref);
Description = string.Format(Messages.RUN_POLICY_STARTED, _policy.Name);
}
}

View File

@ -45,14 +45,12 @@ namespace XenAdmin.Alerts
public readonly string Type;
public readonly string Text;
public readonly DateTime Time;
public readonly string PolicyType;
public readonly int numberOfVMsFailed;
public PolicyAlert(long priority, string name, DateTime _time, string body, string policyName)
{
Type = (priority == 4 ? "info": "error");
Time = _time;
PolicyType = "VMSS";
if(Type == "info")
{
@ -101,92 +99,24 @@ namespace XenAdmin.Alerts
Text = sb.ToString();
}
public PolicyAlert(IXenConnection connection, string body)
{
PolicyType = "VMPP";
var sb = new StringBuilder();
try
{
var xmlDocument = new XmlDocument();
xmlDocument.LoadXml(body);
XmlNodeList _fnames = xmlDocument.GetElementsByTagName("time");
Time = DateTime.Parse(_fnames[0].InnerText, CultureInfo.InvariantCulture);
_fnames = xmlDocument.GetElementsByTagName("messagetype");
if (_fnames[0].InnerText == "error")
{
Type = "error";
numberOfVMsFailed = 0;
_fnames = xmlDocument.GetElementsByTagName("error");
for (int i = 0; i < _fnames.Count; i++)
{
XmlNode item = _fnames[i];
foreach (XmlNode child in item.ChildNodes)
{
if (child.Name == "vm")
{
var vm = connection.Cache.Find_By_Uuid<VM>(child.InnerText);
if (vm == null)
continue;
sb.AppendFormat("VM '{0}': ", vm.Name);
numberOfVMsFailed++;
}
if (child.Name == "errorcode")
{
string text = FriendlyErrorNames.ResourceManager.GetString(child.InnerText);
if (string.IsNullOrEmpty(text))
text = Message.FriendlyBody(child.InnerText);
sb.Append(string.IsNullOrEmpty(text) ? child.InnerText : text);
}
}
if (i + 1 < _fnames.Count)
sb.AppendLine();
}
Text = sb.ToString();
}
else if (_fnames[0].InnerText == "info" || _fnames[0].InnerText == "warn")
{
Type = _fnames[0].InnerText;
XmlNodeList _messages = xmlDocument.GetElementsByTagName("message");
foreach (XmlNode node in _messages)
{
if (node.InnerText == node.InnerXml)
{
Text = Message.FriendlyBody(node.InnerText);
break;
}
}
}
}
catch (Exception) { }
}
public string ShortFormatBody
{
get
{
if (Type == "error")
{
if (Type == "error")
{
if (PolicyType == "VMSS")
{
if (numberOfVMsFailed == 0)
{
return Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString());
}
else
{
return string.Format(Messages.VM_SNAPSHOT_SCHEDULE_FAILED, Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()), numberOfVMsFailed);
}
}
else
{
return string.Format(Messages.VM_PROTECTION_POLICY_FAILED, Message.FriendlyName(XenAPI.Message.MessageType.VMPP_SNAPSHOT_FAILED.ToString()), numberOfVMsFailed);
}
if (numberOfVMsFailed == 0)
{
return Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString());
}
else
{
return string.Format(Messages.VM_SNAPSHOT_SCHEDULE_FAILED,
Message.FriendlyName(XenAPI.Message.MessageType.VMSS_SNAPSHOT_FAILED.ToString()),
numberOfVMsFailed);
}
else return Text;
}
return Text;
}
}

View File

@ -842,7 +842,7 @@ namespace XenAdmin {
return ResourceManager.GetString("Label-host.edition-per-socket", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to [Citrix] [XenServer product] Ultimate Edition.
/// </summary>
@ -3905,132 +3905,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to The archive operation for this protection policy could not be completed..
/// </summary>
public static string Message_body_vmpp_archive_failed_0 {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_failed_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please run the protection policy again later..
/// </summary>
public static string Message_body_vmpp_archive_lock_failed {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_lock_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please check that the archive schedules for the protection policies in this pool do not clash..
/// </summary>
public static string Message_body_vmpp_archive_missed_event {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_missed_event", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Scheduled snapshot(s) have been archived successfully..
/// </summary>
public static string Message_body_vmpp_archive_succeeded {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be mounted. Please check the VMPR archive target configuration settings..
/// </summary>
public static string Message_body_vmpp_archive_target_mount_failed {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_target_mount_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be unmounted. Please make sure than the local directory was mounted successfully and has no open handles..
/// </summary>
public static string Message_body_vmpp_archive_target_unmount_failed {
get {
return ResourceManager.GetString("Message.body-vmpp_archive_target_unmount_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Backup succeeded.
/// </summary>
public static string Message_body_vmpp_backup_succeeded {
get {
return ResourceManager.GetString("Message.body-vmpp_backup_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The [XenServer product] license you are using does not allow you to use the VMPR feature. VMPR is available in [Citrix] [XenServer product] Advanced Edition or higher..
/// </summary>
public static string Message_body_vmpp_license_error {
get {
return ResourceManager.GetString("Message.body-vmpp_license_error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The snapshot is already archived..
/// </summary>
public static string Message_body_vmpp_snapshot_archive_already_exists {
get {
return ResourceManager.GetString("Message.body-vmpp_snapshot_archive_already_exists", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The VM protection policy failed to run because a snapshot could not be created..
/// </summary>
public static string Message_body_vmpp_snapshot_failed {
get {
return ResourceManager.GetString("Message.body-vmpp_snapshot_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to create snapshots at this time because the scheduled snapshot operation for this policy is already in progress. Please try again later..
/// </summary>
public static string Message_body_vmpp_snapshot_lock_failed {
get {
return ResourceManager.GetString("Message.body-vmpp_snapshot_lock_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to create snapshots at this time because a scheduled snapshot operation is already in progress in this pool. One only VMPR snapshot operation can run at a time in the same pool. Please check that the snapshot schedules for the protection policies in this pool do not clash..
/// </summary>
public static string Message_body_vmpp_snapshot_missed_event {
get {
return ResourceManager.GetString("Message.body-vmpp_snapshot_missed_event", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Scheduled snapshot(s) have been successfully created..
/// </summary>
public static string Message_body_vmpp_snapshot_succeeded {
get {
return ResourceManager.GetString("Message.body-vmpp_snapshot_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to log in to XAPI session..
/// </summary>
public static string Message_body_vmpp_xapi_logon_failure {
get {
return ResourceManager.GetString("Message.body-vmpp_xapi_logon_failure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The XenServer license you are using does not allow you to use the Scheduled Snapshots feature..
/// </summary>
@ -4796,132 +4670,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VMPR archive operation failed.
/// </summary>
public static string Message_name_vmpp_archive_failed_0 {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_failed_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR archive operation failed.
/// </summary>
public static string Message_name_vmpp_archive_lock_failed {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_lock_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR archive operation failed.
/// </summary>
public static string Message_name_vmpp_archive_missed_event {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_missed_event", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Scheduled snapshot archive succeeded.
/// </summary>
public static string Message_name_vmpp_archive_succeeded {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR archive operation failed.
/// </summary>
public static string Message_name_vmpp_archive_target_mount_failed {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_target_mount_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to unmount VMPR archive target.
/// </summary>
public static string Message_name_vmpp_archive_target_unmount_failed {
get {
return ResourceManager.GetString("Message.name-vmpp_archive_target_unmount_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Backup succeeded.
/// </summary>
public static string Message_name_vmpp_backup_succeeded {
get {
return ResourceManager.GetString("Message.name-vmpp_backup_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR failed: insufficient license for VMPR.
/// </summary>
public static string Message_name_vmpp_license_error {
get {
return ResourceManager.GetString("Message.name-vmpp_license_error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to archive snapshot.
/// </summary>
public static string Message_name_vmpp_snapshot_archive_already_exists {
get {
return ResourceManager.GetString("Message.name-vmpp_snapshot_archive_already_exists", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR failed: snapshot could not be created.
/// </summary>
public static string Message_name_vmpp_snapshot_failed {
get {
return ResourceManager.GetString("Message.name-vmpp_snapshot_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR failed: snapshot could not be created.
/// </summary>
public static string Message_name_vmpp_snapshot_lock_failed {
get {
return ResourceManager.GetString("Message.name-vmpp_snapshot_lock_failed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPR failed: snapshot could not be created.
/// </summary>
public static string Message_name_vmpp_snapshot_missed_event {
get {
return ResourceManager.GetString("Message.name-vmpp_snapshot_missed_event", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Scheduled snapshot succeeded.
/// </summary>
public static string Message_name_vmpp_snapshot_succeeded {
get {
return ResourceManager.GetString("Message.name-vmpp_snapshot_succeeded", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMPP XAPI logon failure.
/// </summary>
public static string Message_name_vmpp_xapi_logon_failure {
get {
return ResourceManager.GetString("Message.name-vmpp_xapi_logon_failure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Snapshot schedule failed: insufficient license for Scheduled snapshots.
/// </summary>

View File

@ -1103,48 +1103,6 @@
<data name="Message.body-vm_uncooperative" xml:space="preserve">
<value>Virtual machine '{0}' did not reduce its memory usage when requested.</value>
</data>
<data name="Message.body-vmpp_archive_failed_0" xml:space="preserve">
<value>The archive operation for this protection policy could not be completed.</value>
</data>
<data name="Message.body-vmpp_archive_lock_failed" xml:space="preserve">
<value>Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please run the protection policy again later.</value>
</data>
<data name="Message.body-vmpp_archive_missed_event" xml:space="preserve">
<value>Unable to archive a snapshot at this time because an archive operation is already in progress. One only VMPR archive operation can run at a time in the same pool. Please check that the archive schedules for the protection policies in this pool do not clash.</value>
</data>
<data name="Message.body-vmpp_archive_succeeded" xml:space="preserve">
<value>Scheduled snapshot(s) have been archived successfully.</value>
</data>
<data name="Message.body-vmpp_archive_target_mount_failed" xml:space="preserve">
<value>The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be mounted. Please check the VMPR archive target configuration settings.</value>
</data>
<data name="Message.body-vmpp_archive_target_unmount_failed" xml:space="preserve">
<value>The remote CIFS or NFS share specified as the archive target in this VM protection policy could not be unmounted. Please make sure than the local directory was mounted successfully and has no open handles.</value>
</data>
<data name="Message.body-vmpp_backup_succeeded" xml:space="preserve">
<value>Backup succeeded</value>
</data>
<data name="Message.body-vmpp_license_error" xml:space="preserve">
<value>The [XenServer product] license you are using does not allow you to use the VMPR feature. VMPR is available in [Citrix] [XenServer product] Advanced Edition or higher.</value>
</data>
<data name="Message.body-vmpp_snapshot_archive_already_exists" xml:space="preserve">
<value>The snapshot is already archived.</value>
</data>
<data name="Message.body-vmpp_snapshot_failed" xml:space="preserve">
<value>The VM protection policy failed to run because a snapshot could not be created.</value>
</data>
<data name="Message.body-vmpp_snapshot_lock_failed" xml:space="preserve">
<value>Unable to create snapshots at this time because the scheduled snapshot operation for this policy is already in progress. Please try again later.</value>
</data>
<data name="Message.body-vmpp_snapshot_missed_event" xml:space="preserve">
<value>Unable to create snapshots at this time because a scheduled snapshot operation is already in progress in this pool. One only VMPR snapshot operation can run at a time in the same pool. Please check that the snapshot schedules for the protection policies in this pool do not clash.</value>
</data>
<data name="Message.body-vmpp_snapshot_succeeded" xml:space="preserve">
<value>Scheduled snapshot(s) have been successfully created.</value>
</data>
<data name="Message.body-vmpp_xapi_logon_failure" xml:space="preserve">
<value>Unable to log in to XAPI session.</value>
</data>
<data name="Message.body-vmss_license_error" xml:space="preserve">
<value>The XenServer license you are using does not allow you to use the Scheduled Snapshots feature.</value>
</data>
@ -1346,48 +1304,6 @@
<data name="Message.name-vm_uncooperative" xml:space="preserve">
<value>VM Uncooperative</value>
</data>
<data name="Message.name-vmpp_archive_failed_0" xml:space="preserve">
<value>VMPR archive operation failed</value>
</data>
<data name="Message.name-vmpp_archive_lock_failed" xml:space="preserve">
<value>VMPR archive operation failed</value>
</data>
<data name="Message.name-vmpp_archive_missed_event" xml:space="preserve">
<value>VMPR archive operation failed</value>
</data>
<data name="Message.name-vmpp_archive_succeeded" xml:space="preserve">
<value>Scheduled snapshot archive succeeded</value>
</data>
<data name="Message.name-vmpp_archive_target_mount_failed" xml:space="preserve">
<value>VMPR archive operation failed</value>
</data>
<data name="Message.name-vmpp_archive_target_unmount_failed" xml:space="preserve">
<value>Unable to unmount VMPR archive target</value>
</data>
<data name="Message.name-vmpp_backup_succeeded" xml:space="preserve">
<value>Backup succeeded</value>
</data>
<data name="Message.name-vmpp_license_error" xml:space="preserve">
<value>VMPR failed: insufficient license for VMPR</value>
</data>
<data name="Message.name-vmpp_snapshot_archive_already_exists" xml:space="preserve">
<value>Unable to archive snapshot</value>
</data>
<data name="Message.name-vmpp_snapshot_failed" xml:space="preserve">
<value>VMPR failed: snapshot could not be created</value>
</data>
<data name="Message.name-vmpp_snapshot_lock_failed" xml:space="preserve">
<value>VMPR failed: snapshot could not be created</value>
</data>
<data name="Message.name-vmpp_snapshot_missed_event" xml:space="preserve">
<value>VMPR failed: snapshot could not be created</value>
</data>
<data name="Message.name-vmpp_snapshot_succeeded" xml:space="preserve">
<value>Scheduled snapshot succeeded</value>
</data>
<data name="Message.name-vmpp_xapi_logon_failure" xml:space="preserve">
<value>VMPP XAPI logon failure</value>
</data>
<data name="Message.name-vmss_license_error" xml:space="preserve">
<value>Snapshot schedule failed: insufficient license for Scheduled snapshots</value>
</data>

View File

@ -384,15 +384,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to http://www.citrix.com/xenserver/le/features/vmpr.
/// </summary>
public static string UPSELL_LEARNMOREURL_VM_PROTECTION {
get {
return ResourceManager.GetString("UPSELL_LEARNMOREURL_VM_PROTECTION", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to .
/// </summary>
@ -420,15 +411,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to http://support.citrix.com/article/CTX137335.
/// </summary>
public static string VMPR_DEPRECATION_URL {
get {
return ResourceManager.GetString("VMPR_DEPRECATION_URL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to xensearch.
/// </summary>

View File

@ -225,18 +225,12 @@
<data name="UPSELL_LEARNMOREURL_VM_APPLIANCES" xml:space="preserve">
<value>http://www.citrix.com/xenserver/le/features/vapps</value>
</data>
<data name="UPSELL_LEARNMOREURL_VM_PROTECTION" xml:space="preserve">
<value>http://www.citrix.com/xenserver/le/features/vmpr</value>
</data>
<data name="UPSELL_LEARNMOREURL_WLB" xml:space="preserve">
<value>http://www.citrix.com/xenserver/le/features/wlb</value>
</data>
<data name="UPSELL_SA" xml:space="preserve">
<value>http://store.citrix.com/XSInProduct</value>
</data>
<data name="VMPR_DEPRECATION_URL" xml:space="preserve">
<value>http://support.citrix.com/article/CTX137335</value>
</data>
<data name="XENDESKTOP_URL" xml:space="preserve">
<value>http://www.citrix.com/TryXenDesktop</value>
</data>

View File

@ -5164,89 +5164,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Do you want to archive the selected snapshots now?
///Archive destination: {0}.
/// </summary>
public static string ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE {
get {
return ResourceManager.GetString("ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Do you want to archive the selected snapshot now?
///Archive destination: {0}.
/// </summary>
public static string ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE {
get {
return ResourceManager.GetString("ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive snapshot &apos;{0}&apos;.
/// </summary>
public static string ARCHIVE_SNAPSHOT_X {
get {
return ResourceManager.GetString("ARCHIVE_SNAPSHOT_X", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive Options.
/// </summary>
public static string ARCHIVE_SNAPSHOTS {
get {
return ResourceManager.GetString("ARCHIVE_SNAPSHOTS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Automatically archive scheduled snapshots.
/// </summary>
public static string ARCHIVE_SNAPSHOTS_TITLE {
get {
return ResourceManager.GetString("ARCHIVE_SNAPSHOTS_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive Snapshot Now.
/// </summary>
public static string ARCHIVE_VM_PROTECTION_TITLE {
get {
return ResourceManager.GetString("ARCHIVE_VM_PROTECTION_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Example: \\server\sharename (CIFS) or server:/sharename (NFS).
/// </summary>
public static string ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH {
get {
return ResourceManager.GetString("ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archived snapshot &apos;{0}&apos;.
/// </summary>
public static string ARCHIVED_SNAPSHOT_X {
get {
return ResourceManager.GetString("ARCHIVED_SNAPSHOT_X", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archiving snapshot &apos;{0}&apos;.
/// </summary>
public static string ARCHIVING_SNAPSHOT_X {
get {
return ResourceManager.GetString("ARCHIVING_SNAPSHOT_X", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to are empty.
/// </summary>
@ -5319,33 +5236,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Assign to VM Protection Polic&amp;y.
/// </summary>
public static string ASSIGN_PROTECTION_POLICY {
get {
return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Assign to VM Protection Polic&amp;y.
/// </summary>
public static string ASSIGN_PROTECTION_POLICY_CONTEXT_MENU {
get {
return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY_CONTEXT_MENU", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Assign to VM Protection Policy....
/// </summary>
public static string ASSIGN_PROTECTION_POLICY_NOAMP {
get {
return ResourceManager.GetString("ASSIGN_PROTECTION_POLICY_NOAMP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Assign to vA&amp;pp.
/// </summary>
@ -5400,15 +5290,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Protection policy assigned..
/// </summary>
public static string ASSIGNED_PROTECTION_POLICY {
get {
return ResourceManager.GetString("ASSIGNED_PROTECTION_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to vApp assigned..
/// </summary>
@ -5427,15 +5308,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Assigning protection policy....
/// </summary>
public static string ASSIGNING_PROTECTION_POLICY {
get {
return ResourceManager.GetString("ASSIGNING_PROTECTION_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Assigning vApp....
/// </summary>
@ -6812,37 +6684,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Some of the VMs you selected are already assigned to a different protection policy.
///
///Do you want to assign these VMs to the policy &apos;{0}&apos; instead?.
/// </summary>
public static string CHANGE_VMS_POLICIES_WARNING {
get {
return ResourceManager.GetString("CHANGE_VMS_POLICIES_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Assign VM to Protection Policy.
/// </summary>
public static string CHANGE_VMS_POLICY {
get {
return ResourceManager.GetString("CHANGE_VMS_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The VM &apos;{0}&apos; is already assigned to the protection policy &apos;{1}&apos;.
///
///Do you want to assign it to the policy &apos;{2}&apos; instead?.
/// </summary>
public static string CHANGE_VMS_POLICY_WARNING {
get {
return ResourceManager.GetString("CHANGE_VMS_POLICY_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Some of the VMs you selected are already assigned to a different snapshot schedule.
///
@ -7070,15 +6911,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Select a checkbox to add a VM to the protection policy; clear its checkbox to remove it from the policy..
/// </summary>
public static string CHOOSE_VMS_VMPP_RUBRIC {
get {
return ResourceManager.GetString("CHOOSE_VMS_VMPP_RUBRIC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Select a checkbox to add a VM to the snapshot schedule; clear its checkbox to remove it from the schedule..
/// </summary>
@ -9664,15 +9496,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policy &apos;{0}&apos; created..
/// </summary>
public static string CREATED_VMPP {
get {
return ResourceManager.GetString("CREATED_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Snapshot schedule &apos;{0}&apos; created..
/// </summary>
@ -9835,15 +9658,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Creating VM protection policy &apos;{0}&apos;....
/// </summary>
public static string CREATING_VMPP {
get {
return ResourceManager.GetString("CREATING_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Creating snapshot schedule &apos;{0}&apos;....
/// </summary>
@ -10761,11 +10575,11 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Delete VM Protection Policy.
/// Looks up a localized string similar to Delete Snapshot Schedule.
/// </summary>
public static string DELETE_VM_PROTECTION_TITLE {
public static string DELETE_VMSS_TITLE {
get {
return ResourceManager.GetString("DELETE_VM_PROTECTION_TITLE", resourceCulture);
return ResourceManager.GetString("DELETE_VMSS_TITLE", resourceCulture);
}
}
@ -10850,15 +10664,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policies deleted..
/// </summary>
public static string DELETED_VMPP {
get {
return ResourceManager.GetString("DELETED_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Snapshot schedules deleted..
/// </summary>
@ -10940,15 +10745,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Deleting VM protection policy &apos;{0}&apos;.
/// </summary>
public static string DELETING_VMPP {
get {
return ResourceManager.GetString("DELETING_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Deleting snapshot schedule &apos;{0}&apos;.
/// </summary>
@ -11282,15 +11078,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policy &apos;{0}&apos; disabled..
/// </summary>
public static string DISABLED_VMPP {
get {
return ResourceManager.GetString("DISABLED_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Snapshot schedule &apos;{0}&apos; disabled..
/// </summary>
@ -11345,15 +11132,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Disabling VM protection policy &apos;{0}&apos;....
/// </summary>
public static string DISABLING_VMPP {
get {
return ResourceManager.GetString("DISABLING_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disabling snapshot schedule &apos;{0}&apos;....
/// </summary>
@ -13590,15 +13368,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policy &apos;{0}&apos; enabled..
/// </summary>
public static string ENABLED_VMPP {
get {
return ResourceManager.GetString("ENABLED_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Snapshot schedule &apos;{0}&apos; enabled..
/// </summary>
@ -13653,15 +13422,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Enabling VM protection policy &apos;{0}&apos;....
/// </summary>
public static string ENABLING_VMPP {
get {
return ResourceManager.GetString("ENABLING_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enabling snapshot schedule &apos;{0}&apos;....
/// </summary>
@ -15931,15 +15691,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Enter the VM Protection Policy name and an optional description..
/// </summary>
public static string GENERAL_PAGE_VMPP_SETTINGS {
get {
return ResourceManager.GetString("GENERAL_PAGE_VMPP_SETTINGS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter the snapshot schedule name and an optional description..
/// </summary>
@ -23525,24 +23276,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Use this wizard to define a VM protection policy that will ensure your critical VMs are protected via automatic scheduled snapshot jobs..
/// </summary>
public static string NEW_VMPP_PAGE_TEXT {
get {
return ResourceManager.GetString("NEW_VMPP_PAGE_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to To begin, enter a name for the policy and a description (optional), then click Next..
/// </summary>
public static string NEW_VMPP_PAGE_TEXT_MORE {
get {
return ResourceManager.GetString("NEW_VMPP_PAGE_TEXT_MORE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use this wizard to define a snapshot schedule that will create automatic scheduled snapshot jobs for your VMs..
/// </summary>
@ -27665,26 +27398,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Unable to archive the selected snapshot(s).
///
///The VM protection policy for this VM does not have automatic archiving configured. Do you want to edit the policy and configure it now?.
/// </summary>
public static string POLICY_DOES_NOT_HAVE_ARCHIVE {
get {
return ResourceManager.GetString("POLICY_DOES_NOT_HAVE_ARCHIVE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive Snapshot Now.
/// </summary>
public static string POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE {
get {
return ResourceManager.GetString("POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Policy Name.
/// </summary>
@ -28788,15 +28501,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to A {0} user cannot create VM protection policies. Log in as a different user with sufficient privileges and try again..
/// </summary>
public static string RBAC_WARNING_VMPP {
get {
return ResourceManager.GetString("RBAC_WARNING_VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A {0} user cannot create a snapshot schedule. Log in as a different user with sufficient privileges and try again..
/// </summary>
@ -29128,15 +28832,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Remove VM &apos;{0}&apos; from VM Protection Policy &apos;{1}&apos;.
/// </summary>
public static string REMOVE_VM_FROM_POLICY {
get {
return ResourceManager.GetString("REMOVE_VM_FROM_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove VM &apos;{0}&apos; from snapshot schedule &apos;{1}&apos;.
/// </summary>
@ -29155,15 +28850,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Remove VMs from VM Protection Policy &apos;{1}&apos;.
/// </summary>
public static string REMOVE_VMS_FROM_POLICY {
get {
return ResourceManager.GetString("REMOVE_VMS_FROM_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Remove VMs from snapshot schedule &apos;{1}&apos;.
/// </summary>
@ -29200,15 +28886,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Removed from VM Protection Policy.
/// </summary>
public static string REMOVED_VMS_FROM_POLICY {
get {
return ResourceManager.GetString("REMOVED_VMS_FROM_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Removed from snapshot schedule.
/// </summary>
@ -29263,15 +28940,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Removing from VM Protection Policy.
/// </summary>
public static string REMOVING_VMS_FROM_POLICY {
get {
return ResourceManager.GetString("REMOVING_VMS_FROM_POLICY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Removing from snapshot schedule.
/// </summary>
@ -32643,24 +32311,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to This VM is not currently protected with a VM protection policy.
/// </summary>
public static string THIS_VM_IS_NOT_PROTECTED {
get {
return ResourceManager.GetString("THIS_VM_IS_NOT_PROTECTED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This VM is currently protected with VM protection policy &apos;{0}&apos;.
/// </summary>
public static string THIS_VM_IS_PROTECTED {
get {
return ResourceManager.GetString("THIS_VM_IS_PROTECTED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to is this week.
/// </summary>
@ -34849,26 +34499,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Upgrade your [XenServer] license to enable VM Protection and Recovery. VM Protection and Recovery allows you to protect your critical VMs by scheduling automatic snapshots, and optionally, archiving those snapshots to a CIFS or NFS share..
/// </summary>
public static string UPSELL_BLURB_VM_PROTECTION {
get {
return ResourceManager.GetString("UPSELL_BLURB_VM_PROTECTION", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to
///
///To learn more about the [XenServer] VM Protection and Recovery feature or to start a [XenServer] trial, click the button below..
/// </summary>
public static string UPSELL_BLURB_VM_PROTECTION_MORE {
get {
return ResourceManager.GetString("UPSELL_BLURB_VM_PROTECTION_MORE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Upgrade your [XenServer] license to enable VM Scheduled Snapshots. VM Scheduled Snapshost allows you to create automatic snapshots for your critical VMs..
/// </summary>
@ -35431,15 +35061,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to View VM Protection Policies.
/// </summary>
public static string VIEW_POLICIES {
get {
return ResourceManager.GetString("VIEW_POLICIES", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to View tag....
/// </summary>
@ -36115,51 +35736,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM Pr&amp;otection Policies....
/// </summary>
public static string VM_PROTECTION_CONTEXT_MENU {
get {
return ResourceManager.GetString("VM_PROTECTION_CONTEXT_MENU", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VM &amp;Protection Policies....
/// </summary>
public static string VM_PROTECTION_MAIN_MENU {
get {
return ResourceManager.GetString("VM_PROTECTION_MAIN_MENU", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} ({1} VMs failed).
/// </summary>
public static string VM_PROTECTION_POLICY_FAILED {
get {
return ResourceManager.GetString("VM_PROTECTION_POLICY_FAILED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pool master unreachable.
/// </summary>
public static string VM_PROTECTION_POLICY_HOST_NOT_LIVE {
get {
return ResourceManager.GetString("VM_PROTECTION_POLICY_HOST_NOT_LIVE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Succeeded.
/// </summary>
public static string VM_PROTECTION_POLICY_SUCCEEDED {
get {
return ResourceManager.GetString("VM_PROTECTION_POLICY_SUCCEEDED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This VM is not using read caching.
/// </summary>
@ -36349,114 +35925,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to VM Protection Policy.
/// </summary>
public static string VMPP {
get {
return ResourceManager.GetString("VMPP", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Protect your critical VMs with a protection policy that takes regular scheduled snapshots and, optionally, archives the snapshots to a CIFS or NFS share..
/// </summary>
public static string VMPP_DIALOG_TEXT {
get {
return ResourceManager.GetString("VMPP_DIALOG_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VM Protection Policies.
/// </summary>
public static string VMPP_DIALOG_TITLE {
get {
return ResourceManager.GetString("VMPP_DIALOG_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Send &amp;email notifications about VM protection job alerts.
/// </summary>
public static string VMPP_EMAIL_CHECKBOX_TEXT {
get {
return ResourceManager.GetString("VMPP_EMAIL_CHECKBOX_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to XenServer can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails..
/// </summary>
public static string VMPP_EMAIL_PAGE_TEXT {
get {
return ResourceManager.GetString("VMPP_EMAIL_PAGE_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &amp;Run the new VM protection job when I click Finish.
/// </summary>
public static string VMPP_FINISH_PAGE_CHECKBOX_TEXT {
get {
return ResourceManager.GetString("VMPP_FINISH_PAGE_CHECKBOX_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Review the new VM protection policy below and click Previous if you want to change any settings or Finish to create the new policy..
/// </summary>
public static string VMPP_FINISH_PAGE_TEXT {
get {
return ResourceManager.GetString("VMPP_FINISH_PAGE_TEXT", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Create the new policy.
/// </summary>
public static string VMPP_FINISH_TITLE {
get {
return ResourceManager.GetString("VMPP_FINISH_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policies defined in pool &apos;{0}&apos; ({1} out of {2} VMs currently protected):.
/// </summary>
public static string VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL {
get {
return ResourceManager.GetString("VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VM protection policies defined in server &apos;{0}&apos; ({1} out of {2} VMs currently protected):.
/// </summary>
public static string VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER {
get {
return ResourceManager.GetString("VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to protection policy.
/// </summary>
public static string VMPP_TYPE {
get {
return ResourceManager.GetString("VMPP_TYPE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to New VM Protection Policy.
/// </summary>
public static string VMPP_WIZARD_TITLE {
get {
return ResourceManager.GetString("VMPP_WIZARD_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VMs.
/// </summary>
@ -36592,6 +36060,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Pool master unreachable.
/// </summary>
public static string VMSS_HOST_NOT_LIVE {
get {
return ResourceManager.GetString("VMSS_HOST_NOT_LIVE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to VM Snaps&amp;hot Schedules....
/// </summary>
@ -36655,6 +36132,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Succeeded.
/// </summary>
public static string VMSS_SUCCEEDED {
get {
return ResourceManager.GetString("VMSS_SUCCEEDED", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to schedule.
/// </summary>

View File

@ -1897,35 +1897,6 @@ Apply update '{0}' to server '{1}'...
</value>
</data>
<data name="ARCHIVED_SNAPSHOT_X" xml:space="preserve">
<value>Archived snapshot '{0}'</value>
</data>
<data name="ARCHIVE_SNAPSHOTS" xml:space="preserve">
<value>Archive Options</value>
</data>
<data name="ARCHIVE_SNAPSHOTS_TITLE" xml:space="preserve">
<value>Automatically archive scheduled snapshots</value>
</data>
<data name="ARCHIVE_SNAPSHOT_NOW_TEXT_MULTIPLE" xml:space="preserve">
<value>Do you want to archive the selected snapshots now?
Archive destination: {0}</value>
</data>
<data name="ARCHIVE_SNAPSHOT_NOW_TEXT_SINGLE" xml:space="preserve">
<value>Do you want to archive the selected snapshot now?
Archive destination: {0}</value>
</data>
<data name="ARCHIVE_SNAPSHOT_X" xml:space="preserve">
<value>Archive snapshot '{0}'</value>
</data>
<data name="ARCHIVE_VMPP_EXAMPLE_STORAGE_PATH" xml:space="preserve">
<value>Example: \\server\sharename (CIFS) or server:/sharename (NFS)</value>
</data>
<data name="ARCHIVE_VM_PROTECTION_TITLE" xml:space="preserve">
<value>Archive Snapshot Now</value>
</data>
<data name="ARCHIVING_SNAPSHOT_X" xml:space="preserve">
<value>Archiving snapshot '{0}'</value>
</data>
<data name="ARE_EMPTY" xml:space="preserve">
<value>are empty</value>
</data>
@ -1944,18 +1915,12 @@ Archive destination: {0}</value>
<data name="ASSERT_VM_CAN_BE_RECOVERED_CHECK_DESCRIPTION" xml:space="preserve">
<value>{0}: Can recover VM check</value>
</data>
<data name="ASSIGNED_PROTECTION_POLICY" xml:space="preserve">
<value>Protection policy assigned.</value>
</data>
<data name="ASSIGNED_VMSS_POLICY" xml:space="preserve">
<value>Snapshot schedule assigned.</value>
</data>
<data name="ASSIGNED_VM_APPLIANCE" xml:space="preserve">
<value>vApp assigned.</value>
</data>
<data name="ASSIGNING_PROTECTION_POLICY" xml:space="preserve">
<value>Assigning protection policy...</value>
</data>
<data name="ASSIGNING_VMSS_POLICY" xml:space="preserve">
<value>Assigning to a snapshot schedule...</value>
</data>
@ -1968,15 +1933,6 @@ Archive destination: {0}</value>
<data name="ASSIGN_LICENSE_DIALOG_EXPAND_MESSAGE" xml:space="preserve">
<value>License Details</value>
</data>
<data name="ASSIGN_PROTECTION_POLICY" xml:space="preserve">
<value>Assign to VM Protection Polic&amp;y</value>
</data>
<data name="ASSIGN_PROTECTION_POLICY_CONTEXT_MENU" xml:space="preserve">
<value>Assign to VM Protection Polic&amp;y</value>
</data>
<data name="ASSIGN_PROTECTION_POLICY_NOAMP" xml:space="preserve">
<value>Assign to VM Protection Policy...</value>
</data>
<data name="ASSIGN_VMSS_POLICY" xml:space="preserve">
<value>Assign VM to snapsh&amp;ot schedule</value>
</data>
@ -2489,19 +2445,6 @@ Do you want to assign these VMs to the vApp '{0}' instead?</value>
<value>The VM '{0}' is already assigned to the vApp '{1}'.
Do you want to assign it to the vApp '{2}' instead?</value>
</data>
<data name="CHANGE_VMS_POLICIES_WARNING" xml:space="preserve">
<value>Some of the VMs you selected are already assigned to a different protection policy.
Do you want to assign these VMs to the policy '{0}' instead?</value>
</data>
<data name="CHANGE_VMS_POLICY" xml:space="preserve">
<value>Assign VM to Protection Policy</value>
</data>
<data name="CHANGE_VMS_POLICY_WARNING" xml:space="preserve">
<value>The VM '{0}' is already assigned to the protection policy '{1}'.
Do you want to assign it to the policy '{2}' instead?</value>
</data>
<data name="CHANGE_VMS_SNAPSHOT_SCHEDULE_WARNING" xml:space="preserve">
<value>Some of the VMs you selected are already assigned to a different snapshot schedule.
@ -2567,9 +2510,6 @@ Do you want to assign it to the schedule '{2}' instead?</value>
<data name="CHOOSE_VMS_VAPP_RUBRIC" xml:space="preserve">
<value>Select a checkbox to add a VM to the vApp; clear its checkbox to remove it from the vApp.</value>
</data>
<data name="CHOOSE_VMS_VMPP_RUBRIC" xml:space="preserve">
<value>Select a checkbox to add a VM to the protection policy; clear its checkbox to remove it from the policy.</value>
</data>
<data name="CHOOSE_VMS_VMSS_RUBRIC" xml:space="preserve">
<value>Select a checkbox to add a VM to the snapshot schedule; clear its checkbox to remove it from the schedule.</value>
</data>
@ -3459,9 +3399,6 @@ For optimal performance and reliability during VM migration, ensure that the net
<data name="CREATED_NEW_FOLDERS" xml:space="preserve">
<value>Created new folders</value>
</data>
<data name="CREATED_VMPP" xml:space="preserve">
<value>VM protection policy '{0}' created.</value>
</data>
<data name="CREATED_VMSS" xml:space="preserve">
<value>Snapshot schedule '{0}' created.</value>
</data>
@ -3537,9 +3474,6 @@ For optimal performance and reliability during VM migration, ensure that the net
<data name="CREATING_NEW_FOLDERS" xml:space="preserve">
<value>Creating new folders...</value>
</data>
<data name="CREATING_VMPP" xml:space="preserve">
<value>Creating VM protection policy '{0}'...</value>
</data>
<data name="CREATING_VMSS" xml:space="preserve">
<value>Creating snapshot schedule '{0}'...</value>
</data>
@ -3768,9 +3702,6 @@ For optimal performance and reliability during VM migration, ensure that the net
<data name="DELETED_TAGS" xml:space="preserve">
<value>Deleted tags</value>
</data>
<data name="DELETED_VMPP" xml:space="preserve">
<value>VM protection policies deleted.</value>
</data>
<data name="DELETED_VMSS" xml:space="preserve">
<value>Snapshot schedules deleted.</value>
</data>
@ -3874,15 +3805,15 @@ This will also delete its subfolders.</value>
<data name="DELETE_VIRTUAL_DISK" xml:space="preserve">
<value>&amp;Delete Virtual Disk</value>
</data>
<data name="DELETE_VMSS_TITLE" xml:space="preserve">
<value>Delete Snapshot Schedule</value>
</data>
<data name="DELETE_VM_APPLIANCES" xml:space="preserve">
<value>Delete vApps</value>
</data>
<data name="DELETE_VM_APPLIANCE_TITLE" xml:space="preserve">
<value>Delete vApp</value>
</data>
<data name="DELETE_VM_PROTECTION_TITLE" xml:space="preserve">
<value>Delete VM Protection Policy</value>
</data>
<data name="DELETE_WLB_OPTIMIZATION_SCHEDULE_CAPTION" xml:space="preserve">
<value>Delete WLB Optimization Scheduler</value>
</data>
@ -3910,9 +3841,6 @@ This will also delete its subfolders.</value>
<data name="DELETING_TAGS" xml:space="preserve">
<value>Deleting tags</value>
</data>
<data name="DELETING_VMPP" xml:space="preserve">
<value>Deleting VM protection policy '{0}'</value>
</data>
<data name="DELETING_VMSS" xml:space="preserve">
<value>Deleting snapshot schedule '{0}'</value>
</data>
@ -4003,9 +3931,6 @@ This will also delete its subfolders.</value>
<data name="DISABLED_UPDATE_AUTOMATIC_CHECK_WARNING" xml:space="preserve">
<value>No updates found because automatic checking for updates is disabled.</value>
</data>
<data name="DISABLED_VMPP" xml:space="preserve">
<value>VM protection policy '{0}' disabled.</value>
</data>
<data name="DISABLED_VMSS" xml:space="preserve">
<value>Snapshot schedule '{0}' disabled.</value>
</data>
@ -4048,9 +3973,6 @@ This will also delete its subfolders.</value>
<data name="DISABLING_HA_ON" xml:space="preserve">
<value>Disabling HA on pool '{0}'</value>
</data>
<data name="DISABLING_VMPP" xml:space="preserve">
<value>Disabling VM protection policy '{0}'...</value>
</data>
<data name="DISABLING_VMSS" xml:space="preserve">
<value>Disabling snapshot schedule '{0}'...</value>
</data>
@ -4784,9 +4706,6 @@ Would you like to eject these ISOs before continuing?</value>
<data name="ENABLED" xml:space="preserve">
<value>Enabled</value>
</data>
<data name="ENABLED_VMPP" xml:space="preserve">
<value>VM protection policy '{0}' enabled.</value>
</data>
<data name="ENABLED_VMSS" xml:space="preserve">
<value>Snapshot schedule '{0}' enabled.</value>
</data>
@ -4826,9 +4745,6 @@ Would you like to eject these ISOs before continuing?</value>
<data name="ENABLING_HA_ON" xml:space="preserve">
<value>Enabling HA on pool '{0}'</value>
</data>
<data name="ENABLING_VMPP" xml:space="preserve">
<value>Enabling VM protection policy '{0}'...</value>
</data>
<data name="ENABLING_VMSS" xml:space="preserve">
<value>Enabling snapshot schedule '{0}'...</value>
</data>
@ -5583,9 +5499,6 @@ Would you like to eject these ISOs before continuing?</value>
<data name="GENERAL_PAGE_KVP_SEPARATOR" xml:space="preserve">
<value>: </value>
</data>
<data name="GENERAL_PAGE_VMPP_SETTINGS" xml:space="preserve">
<value>Enter the VM Protection Policy name and an optional description.</value>
</data>
<data name="GENERAL_PAGE_VMSS_SETTINGS" xml:space="preserve">
<value>Enter the snapshot schedule name and an optional description.</value>
</data>
@ -8784,12 +8697,6 @@ It is strongly recommended that you Cancel and apply the latest version of the p
<data name="NEW_UPDATE_AVAILABLE" xml:space="preserve">
<value>New Update Available - {0}</value>
</data>
<data name="NEW_VMPP_PAGE_TEXT" xml:space="preserve">
<value>Use this wizard to define a VM protection policy that will ensure your critical VMs are protected via automatic scheduled snapshot jobs.</value>
</data>
<data name="NEW_VMPP_PAGE_TEXT_MORE" xml:space="preserve">
<value>To begin, enter a name for the policy and a description (optional), then click Next.</value>
</data>
<data name="NEW_VMSS_PAGE_TEXT" xml:space="preserve">
<value>Use this wizard to define a snapshot schedule that will create automatic scheduled snapshot jobs for your VMs.</value>
</data>
@ -9629,14 +9536,6 @@ Please reconnect the host and try again</value>
<data name="PM_MODE_WOL" xml:space="preserve">
<value>Wake on LAN</value>
</data>
<data name="POLICY_DOES_NOT_HAVE_ARCHIVE" xml:space="preserve">
<value>Unable to archive the selected snapshot(s).
The VM protection policy for this VM does not have automatic archiving configured. Do you want to edit the policy and configure it now?</value>
</data>
<data name="POLICY_DOES_NOT_HAVE_ARCHIVE_TITLE" xml:space="preserve">
<value>Archive Snapshot Now</value>
</data>
<data name="POLICY_NAME" xml:space="preserve">
<value>Policy Name</value>
</data>
@ -10005,9 +9904,6 @@ You must reconnect to {1} using an account with Pool Administrator permissions b
<data name="RBAC_WARNING_SR_WIZARD_CREATE" xml:space="preserve">
<value>A {0} user cannot create new SRs. Log in as a different user with sufficient privileges and try again.</value>
</data>
<data name="RBAC_WARNING_VMPP" xml:space="preserve">
<value>A {0} user cannot create VM protection policies. Log in as a different user with sufficient privileges and try again.</value>
</data>
<data name="RBAC_WARNING_VMSS" xml:space="preserve">
<value>A {0} user cannot create a snapshot schedule. Log in as a different user with sufficient privileges and try again.</value>
</data>
@ -10081,9 +9977,6 @@ To log out of this server and log in again using a different user account, enter
<data name="REMOVED_VMS_FROM_APPLIANCE" xml:space="preserve">
<value>Removed from vApp </value>
</data>
<data name="REMOVED_VMS_FROM_POLICY" xml:space="preserve">
<value>Removed from VM Protection Policy</value>
</data>
<data name="REMOVED_VMS_FROM_VMSS" xml:space="preserve">
<value>Removed from snapshot schedule</value>
</data>
@ -10153,18 +10046,12 @@ Click Server Status Report to open the Compile Server Status Report Wizard or cl
<data name="REMOVE_VMS_FROM_APPLIANCE" xml:space="preserve">
<value>Remove VMs from vApp '{0}'</value>
</data>
<data name="REMOVE_VMS_FROM_POLICY" xml:space="preserve">
<value>Remove VMs from VM Protection Policy '{1}'</value>
</data>
<data name="REMOVE_VMS_FROM_VMSS" xml:space="preserve">
<value>Remove VMs from snapshot schedule '{1}'</value>
</data>
<data name="REMOVE_VM_FROM_APPLIANCE" xml:space="preserve">
<value>Remove VM '{0}' from vApp '{1}'</value>
</data>
<data name="REMOVE_VM_FROM_POLICY" xml:space="preserve">
<value>Remove VM '{0}' from VM Protection Policy '{1}'</value>
</data>
<data name="REMOVE_VM_FROM_VMSS" xml:space="preserve">
<value>Remove VM '{0}' from snapshot schedule '{1}'</value>
</data>
@ -10183,9 +10070,6 @@ Click Server Status Report to open the Compile Server Status Report Wizard or cl
<data name="REMOVING_VMS_FROM_APPLIANCE" xml:space="preserve">
<value>Removing from vApp</value>
</data>
<data name="REMOVING_VMS_FROM_POLICY" xml:space="preserve">
<value>Removing from VM Protection Policy</value>
</data>
<data name="REMOVING_VMS_FROM_VMSS" xml:space="preserve">
<value>Removing from snapshot schedule</value>
</data>
@ -11322,12 +11206,6 @@ Refer to the "[XenServer product] Administrator's Guide" for instructions on how
<data name="THIS_VM_IS_NOT_IN_VMSS" xml:space="preserve">
<value>This VM is not currently part of a snapshot schedule</value>
</data>
<data name="THIS_VM_IS_NOT_PROTECTED" xml:space="preserve">
<value>This VM is not currently protected with a VM protection policy</value>
</data>
<data name="THIS_VM_IS_PROTECTED" xml:space="preserve">
<value>This VM is currently protected with VM protection policy '{0}'</value>
</data>
<data name="THIS_WEEK" xml:space="preserve">
<value>is this week</value>
</data>
@ -12089,14 +11967,6 @@ To learn more about the [XenServer] VM Scheduled Snapshots feature or to start a
<value>
To learn more about the vApps feature of [XenServer] or to start a [XenServer] trial, click the button below.</value>
</data>
<data name="UPSELL_BLURB_VM_PROTECTION" xml:space="preserve">
<value>Upgrade your [XenServer] license to enable VM Protection and Recovery. VM Protection and Recovery allows you to protect your critical VMs by scheduling automatic snapshots, and optionally, archiving those snapshots to a CIFS or NFS share.</value>
</data>
<data name="UPSELL_BLURB_VM_PROTECTION_MORE" xml:space="preserve">
<value>
To learn more about the [XenServer] VM Protection and Recovery feature or to start a [XenServer] trial, click the button below.</value>
</data>
<data name="UPSELL_BLURB_WLB" xml:space="preserve">
<value>Upgrade your [XenServer] license to enable Dynamic Workload Balancing. Dynamic Workload Balancing continually profiles your virtual machines and [XenServer] hosts performance and will intelligently rebalance and optimally place new workloads to ensure the best use of physical server resources in your resource pool.</value>
@ -12280,9 +12150,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VIEW_ORGANIZATION" xml:space="preserve">
<value>Organization Views</value>
</data>
<data name="VIEW_POLICIES" xml:space="preserve">
<value>View VM Protection Policies</value>
</data>
<data name="VIEW_TAG_MENU_OPTION" xml:space="preserve">
<value>View tag...</value>
</data>
@ -12364,42 +12231,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VM" xml:space="preserve">
<value>VM</value>
</data>
<data name="VMPP" xml:space="preserve">
<value>VM Protection Policy</value>
</data>
<data name="VMPP_DIALOG_TEXT" xml:space="preserve">
<value>Protect your critical VMs with a protection policy that takes regular scheduled snapshots and, optionally, archives the snapshots to a CIFS or NFS share.</value>
</data>
<data name="VMPP_DIALOG_TITLE" xml:space="preserve">
<value>VM Protection Policies</value>
</data>
<data name="VMPP_EMAIL_CHECKBOX_TEXT" xml:space="preserve">
<value>Send &amp;email notifications about VM protection job alerts</value>
</data>
<data name="VMPP_EMAIL_PAGE_TEXT" xml:space="preserve">
<value>XenServer can send you email notifications when alerts associated with VM protection jobs are raised, such as when a VM snapshot is created or archived, or when a snapshot or archive operation fails.</value>
</data>
<data name="VMPP_FINISH_PAGE_CHECKBOX_TEXT" xml:space="preserve">
<value>&amp;Run the new VM protection job when I click Finish</value>
</data>
<data name="VMPP_FINISH_PAGE_TEXT" xml:space="preserve">
<value>Review the new VM protection policy below and click Previous if you want to change any settings or Finish to create the new policy.</value>
</data>
<data name="VMPP_FINISH_TITLE" xml:space="preserve">
<value>Create the new policy</value>
</data>
<data name="VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_POOL" xml:space="preserve">
<value>VM protection policies defined in pool '{0}' ({1} out of {2} VMs currently protected):</value>
</data>
<data name="VMPP_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER" xml:space="preserve">
<value>VM protection policies defined in server '{0}' ({1} out of {2} VMs currently protected):</value>
</data>
<data name="VMPP_TYPE" xml:space="preserve">
<value>protection policy</value>
</data>
<data name="VMPP_WIZARD_TITLE" xml:space="preserve">
<value>New VM Protection Policy</value>
</data>
<data name="VMS" xml:space="preserve">
<value>VMs</value>
</data>
@ -12433,6 +12264,9 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VMSS_FINISH_TITLE" xml:space="preserve">
<value>Create the new schedule</value>
</data>
<data name="VMSS_HOST_NOT_LIVE" xml:space="preserve">
<value>Pool master unreachable</value>
</data>
<data name="VMSS_MAIN_MENU" xml:space="preserve">
<value>VM Snaps&amp;hot Schedules...</value>
</data>
@ -12454,6 +12288,9 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VMSS_SCHEDULED_SNAPSHOTS_DEFINED_FOR_SERVER" xml:space="preserve">
<value>Snapshot schedules defined in server '{0}' ({1} out of {2} VMs currently in schedule):</value>
</data>
<data name="VMSS_SUCCEEDED" xml:space="preserve">
<value>Succeeded</value>
</data>
<data name="VMSS_TYPE" xml:space="preserve">
<value>schedule</value>
</data>
@ -12622,21 +12459,6 @@ To learn more about the [XenServer] Dynamic Workload Balancing feature or to sta
<data name="VM_PAUSED" xml:space="preserve">
<value>This VM is paused.</value>
</data>
<data name="VM_PROTECTION_CONTEXT_MENU" xml:space="preserve">
<value>VM Pr&amp;otection Policies...</value>
</data>
<data name="VM_PROTECTION_MAIN_MENU" xml:space="preserve">
<value>VM &amp;Protection Policies...</value>
</data>
<data name="VM_PROTECTION_POLICY_FAILED" xml:space="preserve">
<value>{0} ({1} VMs failed)</value>
</data>
<data name="VM_PROTECTION_POLICY_HOST_NOT_LIVE" xml:space="preserve">
<value>Pool master unreachable</value>
</data>
<data name="VM_PROTECTION_POLICY_SUCCEEDED" xml:space="preserve">
<value>Succeeded</value>
</data>
<data name="VM_READ_CACHING_DISABLED" xml:space="preserve">
<value>This VM is not using read caching</value>
</data>

View File

@ -89,7 +89,6 @@ namespace XenAdmin.Network
private readonly ChangeableDictionary<XenRef<VM>, VM> _vm = new ChangeableDictionary<XenRef<VM>, VM>();
private readonly ChangeableDictionary<XenRef<VM_metrics>, VM_metrics> _vm_metrics = new ChangeableDictionary<XenRef<VM_metrics>, VM_metrics>();
private readonly ChangeableDictionary<XenRef<VM_guest_metrics>, VM_guest_metrics> _vm_guest_metrics = new ChangeableDictionary<XenRef<VM_guest_metrics>, VM_guest_metrics>();
private readonly ChangeableDictionary<XenRef<VMPP>, VMPP> _vmmp = new ChangeableDictionary<XenRef<VMPP>, VMPP>();
private readonly ChangeableDictionary<XenRef<VMSS>, VMSS> _vmss = new ChangeableDictionary<XenRef<VMSS>, VMSS>();
private readonly ChangeableDictionary<XenRef<VM_appliance>, VM_appliance> _vm_appliance = new ChangeableDictionary<XenRef<VM_appliance>, VM_appliance>();
private readonly ChangeableDictionary<XenRef<Crashdump>, Crashdump> _crashdump = new ChangeableDictionary<XenRef<Crashdump>, Crashdump>();
@ -116,11 +115,6 @@ namespace XenAdmin.Network
get { return contents(_bond); }
}
public VMPP[] VMPPs
{
get { return contents(_vmmp); }
}
public VMSS[] VMSSs
{
get { return contents(_vmss); }

View File

@ -78,7 +78,6 @@ namespace XenAdmin.Network
VGPU[] VGPUs { get; }
VGPU_type[] VGPU_types { get; }
VIF[] VIFs { get; }
VMPP[] VMPPs { get; }
VMSS[] VMSSs { get; }
VM_appliance[] VM_appliances { get; }
VM[] VMs { get; }

View File

@ -1615,11 +1615,6 @@ namespace XenAdmin.Core
if (sr != null)
return sr;
break;
case cls.VMPP:
VMPP vmpp = message.Connection.Cache.Find_By_Uuid<VMPP>(message.obj_uuid);
if (vmpp != null)
return vmpp;
break;
case cls.VMSS:
VMSS vmss = message.Connection.Cache.Find_By_Uuid<VMSS>(message.obj_uuid);
if (vmss != null)

View File

@ -296,16 +296,6 @@ namespace XenAPI
get { return BoolKeyPreferTrue(license_params, "restrict_pooling"); }
}
public static bool RestrictVMProtection(Host h)
{
return h._RestrictVMProtection;
}
private bool _RestrictVMProtection
{
get { return BoolKeyPreferTrue(license_params, "restrict_vmpr"); }
}
public static bool RestrictVMSnapshotSchedule(Host h)
{
return h._RestrictVMSnapshotSchedule;

View File

@ -1,86 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using XenAdmin;
using XenAdmin.Alerts;
using XenAdmin.Core;
using XenAdmin.Network;
using XenAdmin.Actions;
/* Interface that will be implemented by VMSS and VMPP XenObjects*/
namespace XenAPI
{
public enum policy_frequency
{
hourly, daily, weekly, unknown
}
public enum policy_backup_type
{
snapshot, checkpoint, snapshot_with_quiesce, unknown
}
public interface IVMPolicy
{
string Name { get; }
string name_description {get; }
string uuid { get; }
List<XenRef<VM>> VMs { get; }
IXenConnection Connection { get; }
bool is_enabled { get; }
bool is_running { get; }
bool is_archiving { get; }
string LastResult { get;}
DateTime GetNextRunTime();
DateTime GetNextArchiveRunTime();
Type _Type { get; }
List<PolicyAlert> PolicyAlerts { get; }
bool hasArchive { get; }
void set_vm_policy(Session session, string _vm, string _value);
void do_destroy(Session session, string _policy);
string run_now(Session session, string _policy);
string opaque_ref { get; }
void set_is_enabled(Session session, string _policy, bool _is_enabled);
PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow);
policy_frequency policy_frequency { get; set; }
Dictionary<string, string> policy_schedule { get; set; }
long policy_retention { get; set; }
string backup_schedule_min { get; }
string backup_schedule_hour { get; }
string backup_schedule_days { get; }
policy_backup_type policy_type { get; set; }
XenRef<Task> async_task_create(Session session);
void set_policy(Session session, string _vm, string _value);
}
}

View File

@ -1,512 +0,0 @@
/* Copyright (c) Citrix Systems, Inc.
* 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.Collections.Generic;
using XenAdmin;
using XenAdmin.Alerts;
using XenAdmin.Core;
using XenAdmin.Network;
using XenAdmin.Actions;
namespace XenAPI
{
public partial class VMPP : IVMPolicy
{
public DateTime GetNextRunTime()
{
var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref);
if (backup_frequency == vmpp_backup_frequency.hourly)
{
return GetHourlyDate(time, Convert.ToInt32(backup_schedule_min));
}
if (backup_frequency == vmpp_backup_frequency.daily)
{
var hour = Convert.ToInt32(backup_schedule_hour);
var min = Convert.ToInt32(backup_schedule_min);
return GetDailyDate(time, min, hour);
}
if (backup_frequency == vmpp_backup_frequency.weekly)
{
var hour = Convert.ToInt32(backup_schedule_hour);
var min = Convert.ToInt32(backup_schedule_min);
return GetWeeklyDate(time, hour, min, new List<DayOfWeek>(DaysOfWeekBackup));
}
return new DateTime();
}
public static DateTime GetDailyDate(DateTime time, int min, int hour)
{
var nextDateTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0);
if (time > nextDateTime)
nextDateTime = nextDateTime.AddDays(1);
return nextDateTime;
}
public static DateTime GetHourlyDate(DateTime time, int min)
{
var nextDateTime = new DateTime(time.Year, time.Month, time.Day, time.Hour, min, 0);
if (time > nextDateTime)
nextDateTime = nextDateTime.AddHours(1);
return nextDateTime;
}
public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List<DayOfWeek> listDaysOfWeek)
{
listDaysOfWeek.Sort();
int daysOfDifference;
DayOfWeek today = time.DayOfWeek;
int nextDay = listDaysOfWeek.FindIndex(x => x >= time.DayOfWeek);
// No scheduled days later in the week: take first day next week
if (nextDay < 0)
{
daysOfDifference = 7 - (today - listDaysOfWeek[0]);
}
else
{
daysOfDifference = listDaysOfWeek[nextDay] - today;
// Today is a scheduled day: but is the time already past?
if (daysOfDifference == 0)
{
var todaysScheduledTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0);
if (time > todaysScheduledTime)
{
// Yes, the time is already past. Find the next day in the schedule instead.
if (listDaysOfWeek.Count == nextDay + 1) // we're at the last scheduled day in the week: go to next week
daysOfDifference = 7 - (today - listDaysOfWeek[0]);
else
daysOfDifference = listDaysOfWeek[nextDay + 1] - today;
}
}
}
return (new DateTime(time.Year, time.Month, time.Day, hour, min, 0)).AddDays(daysOfDifference);
}
public IEnumerable<DayOfWeek> DaysOfWeekBackup
{
get
{
return GetDaysFromDictionary(backup_schedule);
}
}
private static IEnumerable<DayOfWeek> GetDaysFromDictionary(Dictionary<string, string> dictionary)
{
if (dictionary.ContainsKey("days"))
{
if (dictionary["days"].IndexOf("monday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Monday;
if (dictionary["days"].IndexOf("tuesday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Tuesday;
if (dictionary["days"].IndexOf("wednesday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Wednesday;
if (dictionary["days"].IndexOf("thursday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Thursday;
if (dictionary["days"].IndexOf("friday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Friday;
if (dictionary["days"].IndexOf("saturday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Saturday;
if (dictionary["days"].IndexOf("sunday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Sunday;
}
}
public IEnumerable<DayOfWeek> DaysOfWeekArchive
{
get
{
return GetDaysFromDictionary(archive_schedule);
}
}
public override string Name
{
get { return name_label; }
}
public override string Description
{
get { return name_description; }
}
public bool is_enabled
{
get { return this.is_policy_enabled; }
}
public bool is_running
{
get { return this.is_backup_running; }
}
public bool is_archiving
{
get { return this.is_archive_running; }
}
public Type _Type
{
get {return typeof(VMPP);}
}
public List<PolicyAlert> PolicyAlerts
{
get { return RecentAlerts;}
}
public bool hasArchive
{
get { return true; }
}
public void set_vm_policy(Session session, string _vm, string _value)
{
VM.set_protection_policy(session, _vm, _value);
}
public void do_destroy(Session session, string _policy)
{
VMPP.destroy(session, _policy);
}
public string run_now(Session session, string _policy)
{
return VMPP.protect_now(session, _policy);
}
public void set_is_enabled(Session session, string _policy, bool _is_enabled)
{
VMPP.set_is_policy_enabled(session, _policy, _is_enabled);
}
public PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow)
{
return new GetVMPPAlertsAction((VMPP)policy, hoursfromnow);
}
public policy_frequency policy_frequency
{
get
{
switch(backup_frequency)
{
case vmpp_backup_frequency.hourly:
return policy_frequency.hourly;
case vmpp_backup_frequency.daily:
return policy_frequency.daily;
case vmpp_backup_frequency.weekly:
return policy_frequency.weekly;
default:
return policy_frequency.unknown;
}
}
set
{
switch (value)
{
case policy_frequency.hourly:
backup_frequency = vmpp_backup_frequency.hourly;
break;
case policy_frequency.daily:
backup_frequency = vmpp_backup_frequency.daily;
break;
case policy_frequency.weekly:
backup_frequency = vmpp_backup_frequency.weekly;
break;
default:
backup_frequency = vmpp_backup_frequency.unknown;
break;
}
}
}
public Dictionary<string, string> policy_schedule
{
get { return backup_schedule; }
set { backup_schedule = value; }
}
public long policy_retention
{
get { return backup_retention_value; }
set { backup_retention_value = value; }
}
public policy_backup_type policy_type
{
get
{
switch(backup_type)
{
case vmpp_backup_type.checkpoint:
return policy_backup_type.checkpoint;
case vmpp_backup_type.snapshot:
return policy_backup_type.snapshot;
default:
return policy_backup_type.unknown;
}
}
set
{
switch (value)
{
case policy_backup_type.checkpoint:
backup_type = vmpp_backup_type.checkpoint;
break;
case policy_backup_type.snapshot:
backup_type = vmpp_backup_type.snapshot;
break;
default:
backup_type = vmpp_backup_type.unknown;
break;
}
}
}
public XenRef<Task> async_task_create(Session session)
{
return VMPP.async_create(session, (VMPP)this);
}
public void set_policy(Session session, string _vm, string _value)
{
VM.set_protection_policy(session, _vm, _value);
}
public string alarm_config_smtp_server
{
get
{
return TryGetKey(alarm_config, "smtp_server");
}
}
public string alarm_config_smtp_port
{
get
{
return TryGetKey(alarm_config, "smtp_port");
}
}
public static string TryGetKey(Dictionary<string, string> dict, string key)
{
string r;
if (dict.TryGetValue(key, out r))
{
return r;
}
return "";
}
public string alarm_config_email_address
{
get
{
return TryGetKey(alarm_config, "email_address");
}
}
public DateTime GetNextArchiveRunTime()
{
var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref);
if (archive_frequency == vmpp_archive_frequency.daily)
{
return GetDailyDate(time,
Convert.ToInt32(archive_schedule_min),
Convert.ToInt32(archive_schedule_hour));
}
if (archive_frequency == vmpp_archive_frequency.weekly)
{
var hour = Convert.ToInt32(archive_schedule_hour);
var min = Convert.ToInt32(archive_schedule_min);
return GetWeeklyDate(time, hour, min, new List<DayOfWeek>(DaysOfWeekArchive));
}
if (archive_frequency == vmpp_archive_frequency.always_after_backup)
return GetNextRunTime();
return DateTime.MinValue;
}
public string archive_target_config_location
{
get
{
return TryGetKey(archive_target_config, "location");
}
}
public string archive_target_config_username
{
get
{
return TryGetKey(archive_target_config, "username");
}
}
public string archive_target_config_password_uuid
{
get
{
return TryGetKey(archive_target_config, "password");
}
}
public string archive_target_config_password_value
{
get
{
string uuid = archive_target_config_password_uuid;
try
{
string opaqueref = Secret.get_by_uuid(Connection.Session, uuid);
return Secret.get_value(Connection.Session, opaqueref);
}
catch (Exception)
{
return "";
}
}
}
public string backup_schedule_min
{
get
{
return TryGetKey(backup_schedule, "min");
}
}
public string backup_schedule_hour
{
get
{
return TryGetKey(backup_schedule, "hour");
}
}
public string backup_schedule_days
{
get
{
return TryGetKey(backup_schedule, "days");
}
}
public string archive_schedule_min
{
get
{
return TryGetKey(archive_schedule, "min");
}
}
public string archive_schedule_hour
{
get
{
return TryGetKey(archive_schedule, "hour");
}
}
public string archive_schedule_days
{
get
{
return TryGetKey(archive_schedule, "days");
}
}
private List<PolicyAlert> _alerts = new List<PolicyAlert>();
public List<PolicyAlert> Alerts
{
get
{
foreach (var recent in RecentAlerts)
{
if (!_alerts.Contains(recent))
_alerts.Add(recent);
}
return _alerts;
}
set { _alerts = value; }
}
public List<PolicyAlert> RecentAlerts
{
get
{
List<PolicyAlert> result = new List<PolicyAlert>();
foreach (var body in recent_alerts)
{
result.Add(new PolicyAlert(Connection, body));
}
return result;
}
}
public string LastResult
{
get
{
if (_recent_alerts.Length > 0)
{
var listRecentAlerts = new List<PolicyAlert>(RecentAlerts);
listRecentAlerts.Sort((x, y) => y.Time.CompareTo(x.Time));
if (listRecentAlerts[0].Type == "info")
return Messages.VM_PROTECTION_POLICY_SUCCEEDED;
return Messages.FAILED;
}
return Messages.NOT_YET_RUN;
}
}
}
}

View File

@ -39,161 +39,18 @@ using XenAdmin.Actions;
namespace XenAPI
{
public partial class VMSS : IVMPolicy
public partial class VMSS
{
public bool is_enabled
{
get { return this.enabled; }
}
public bool is_running
{
get { return false; }
}
public bool is_archiving
{
get { return false; }
}
public DateTime GetNextArchiveRunTime()
{
/*Not supported*/
return new DateTime();
}
public Type _Type
{
get { return typeof(VMSS); }
}
public List<PolicyAlert> PolicyAlerts
{
get { return Alerts; }
}
public bool hasArchive
{
get { return false; }
}
public void set_vm_policy(Session session, string _vm, string _value)
{
VM.set_snapshot_schedule(session, _vm, _value);
}
public void do_destroy(Session session, string _policy)
{
VMSS.destroy(session, _policy);
}
public string run_now(Session session, string _policy)
{
return VMSS.snapshot_now(session, _policy);
}
public void set_is_enabled(Session session, string _policy, bool _is_enabled)
{
VMSS.set_enabled(session, _policy, _is_enabled);
}
public PureAsyncAction getAlertsAction(IVMPolicy policy, int hoursfromnow)
{
return new GetVMSSAlertsAction((VMSS)policy, hoursfromnow);
}
public policy_frequency policy_frequency
{
get
{
switch(frequency)
{
case vmss_frequency.hourly:
return policy_frequency.hourly;
case vmss_frequency.daily:
return policy_frequency.daily;
case vmss_frequency.weekly:
return policy_frequency.weekly;
default:
return policy_frequency.unknown;
}
}
set
{
switch (value)
{
case policy_frequency.hourly:
frequency = vmss_frequency.hourly;
break;
case policy_frequency.daily:
frequency = vmss_frequency.daily;
break;
case policy_frequency.weekly:
frequency = vmss_frequency.weekly;
break;
default:
frequency = vmss_frequency.unknown;
break;
}
}
}
public Dictionary<string, string> policy_schedule
{
get { return schedule; }
set { schedule = value; }
}
public long policy_retention
{
get { return retained_snapshots; }
set { retained_snapshots = value; }
}
public policy_backup_type policy_type
{
get
{
switch(type)
{
case vmss_type.checkpoint:
return policy_backup_type.checkpoint;
case vmss_type.snapshot:
return policy_backup_type.snapshot;
case vmss_type.snapshot_with_quiesce:
return policy_backup_type.snapshot_with_quiesce;
default:
return policy_backup_type.unknown;
}
}
set
{
switch (value)
{
case policy_backup_type.checkpoint:
type = vmss_type.checkpoint;
break;
case policy_backup_type.snapshot:
type = vmss_type.snapshot;
break;
case policy_backup_type.snapshot_with_quiesce:
type = vmss_type.snapshot_with_quiesce;
break;
default:
type = vmss_type.unknown;
break;
}
}
}
public XenRef<Task> async_task_create(Session session)
{
return VMSS.async_create(session, (VMSS)this);
}
public void set_policy(Session session, string _vm, string _value)
{
VM.set_snapshot_schedule(session, _vm, _value);
}
public DateTime GetNextRunTime()
{
var time = Host.get_server_localtime(Connection.Session, Helpers.GetMaster(Connection).opaque_ref);
@ -218,21 +75,57 @@ namespace XenAPI
}
return new DateTime();
}
private static DateTime GetDailyDate(DateTime time, int min, int hour)
{
return VMPP.GetDailyDate(time, min, hour);
}
private static DateTime GetHourlyDate(DateTime time, int min)
{
return VMPP.GetHourlyDate(time, min);
}
public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List<DayOfWeek> listDaysOfWeek)
{
return VMPP.GetWeeklyDate(time, hour, min, listDaysOfWeek);
}
public static DateTime GetDailyDate(DateTime time, int min, int hour)
{
var nextDateTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0);
if (time > nextDateTime)
nextDateTime = nextDateTime.AddDays(1);
return nextDateTime;
}
public static DateTime GetHourlyDate(DateTime time, int min)
{
var nextDateTime = new DateTime(time.Year, time.Month, time.Day, time.Hour, min, 0);
if (time > nextDateTime)
nextDateTime = nextDateTime.AddHours(1);
return nextDateTime;
}
public static DateTime GetWeeklyDate(DateTime time, int hour, int min, List<DayOfWeek> listDaysOfWeek)
{
listDaysOfWeek.Sort();
int daysOfDifference;
DayOfWeek today = time.DayOfWeek;
int nextDay = listDaysOfWeek.FindIndex(x => x >= time.DayOfWeek);
// No scheduled days later in the week: take first day next week
if (nextDay < 0)
{
daysOfDifference = 7 - (today - listDaysOfWeek[0]);
}
else
{
daysOfDifference = listDaysOfWeek[nextDay] - today;
// Today is a scheduled day: but is the time already past?
if (daysOfDifference == 0)
{
var todaysScheduledTime = new DateTime(time.Year, time.Month, time.Day, hour, min, 0);
if (time > todaysScheduledTime)
{
// Yes, the time is already past. Find the next day in the schedule instead.
if (listDaysOfWeek.Count == nextDay + 1) // we're at the last scheduled day in the week: go to next week
daysOfDifference = 7 - (today - listDaysOfWeek[0]);
else
daysOfDifference = listDaysOfWeek[nextDay + 1] - today;
}
}
}
return (new DateTime(time.Year, time.Month, time.Day, hour, min, 0)).AddDays(daysOfDifference);
}
public IEnumerable<DayOfWeek> DaysOfWeekBackup
@ -262,9 +155,18 @@ namespace XenAPI
if (dictionary["days"].IndexOf("sunday", StringComparison.InvariantCultureIgnoreCase) >= 0)
yield return DayOfWeek.Sunday;
}
}
public static string TryGetKey(Dictionary<string, string> dict, string key)
{
string r;
if (dict.TryGetValue(key, out r))
{
return r;
}
return "";
}
public override string Name
{
get { return name_label; }
@ -279,7 +181,7 @@ namespace XenAPI
{
get
{
return VMPP.TryGetKey(schedule, "min");
return TryGetKey(schedule, "min");
}
}
@ -288,7 +190,7 @@ namespace XenAPI
get
{
return VMPP.TryGetKey(schedule, "hour");
return TryGetKey(schedule, "hour");
}
}
@ -297,7 +199,7 @@ namespace XenAPI
get
{
return VMPP.TryGetKey(schedule, "days");
return TryGetKey(schedule, "days");
}
}
private List<PolicyAlert> _alerts = new List<PolicyAlert>();
@ -319,8 +221,8 @@ namespace XenAPI
{
var listRecentAlerts = new List<PolicyAlert>(_alerts);
listRecentAlerts.Sort((x, y) => y.Time.CompareTo(x.Time));
if (listRecentAlerts[0].Type == "info")
return Messages.VM_PROTECTION_POLICY_SUCCEEDED;
if (listRecentAlerts[0].Type == "info")
return Messages.VMSS_SUCCEEDED;
return Messages.FAILED;
}

View File

@ -282,14 +282,11 @@
<Compile Include="Actions\VIF\DeleteVIFAction.cs" />
<Compile Include="Actions\VIF\PlugVIFAction.cs" />
<Compile Include="Actions\VIF\UpdateVIFAction.cs" />
<Compile Include="Actions\VMPP\ArchiveNowAction.cs" />
<Compile Include="Actions\VMPP\AssignVMsToPolicyAction.cs" />
<Compile Include="Actions\VMPP\ChangePolicyEnabledAction.cs" />
<Compile Include="Actions\VMPP\CreateVMPP.cs" />
<Compile Include="Actions\VMPP\DestroyPolicyAction.cs" />
<Compile Include="Actions\VMPP\GetVMPPAlertsAction.cs" />
<Compile Include="Actions\VMPP\RunPolicyNowAction.cs" />
<Compile Include="Actions\VMPP\TestArchiveTargetAction.cs" />
<Compile Include="Actions\VMSS\AssignVMsToPolicyAction.cs" />
<Compile Include="Actions\VMSS\ChangePolicyEnabledAction.cs" />
<Compile Include="Actions\VMSS\CreateVMPolicy.cs" />
<Compile Include="Actions\VMSS\DestroyPolicyAction.cs" />
<Compile Include="Actions\VMSS\RunPolicyNowAction.cs" />
<Compile Include="Actions\VM\ChangeVCPUSettingsAction.cs" />
<Compile Include="Actions\VM\ChangeVMISOAction.cs" />
<Compile Include="Actions\VM\HAUnprotectVMAction.cs" />
@ -330,7 +327,6 @@
<Compile Include="WLB\WlbHostConfiguration.cs" />
<Compile Include="WLB\WlbServerState.cs" />
<Compile Include="XenAPI-Extensions\Blob.cs" />
<Compile Include="XenAPI-Extensions\IVMPolicy.cs" />
<Compile Include="XenAPI-Extensions\VMSS.cs" />
<Compile Include="XenAPI-Extensions\Pool_update.cs" />
<Compile Include="XenAPI-Extensions\PVS_cache_storage.cs" />
@ -447,7 +443,6 @@
<Compile Include="XenAPI-Extensions\VDI.cs" />
<Compile Include="XenAPI-Extensions\VIF.cs" />
<Compile Include="XenAPI-Extensions\VM.cs" />
<Compile Include="XenAPI-Extensions\VMPP.cs" />
<Compile Include="XenAPI-Extensions\VM_guest_metrics.cs" />
<Compile Include="XenAPI-Extensions\XenObject.cs" />
<Compile Include="XenAPI\after_apply_guidance.cs" />