Incorporating review comments.

Signed-off-by: Sharath Babu <Sharath.Babu@citrix.com>
This commit is contained in:
Sharath Babu 2016-04-07 03:20:14 +00:00
parent 18289192b7
commit 07128eb9b4

View File

@ -72,6 +72,31 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
}
private IVMPolicy _policy;
public void StartRefreshTab()
{
/* hoursFromNow has 3 possible values:
1) 0 -> top 10 messages (default)
2) 24 -> messages from past 24 Hrs
3) 7 * 24 -> messages from lst 7 days */
var hoursFromNow = 0;
switch (comboBox1.SelectedIndex)
{
case 0: /* default value*/
break;
case 1:
hoursFromNow = 24;
break;
case 2:
hoursFromNow = 7 * 24;
break;
}
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
action.Completed += action_Completed;
action.RunAsync();
}
public void RefreshTab(IVMPolicy policy)
{
_policy = policy;
@ -83,23 +108,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
else
{
comboBox1.Enabled = true;
int hoursFromNow = 0;
switch (comboBox1.SelectedIndex)
{
case 0: /* default value*/
break;
case 1:
hoursFromNow = 24;
break;
case 2:
hoursFromNow = 7 * 24;
break;
}
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
action.Completed += action_Completed;
action.RunAsync();
RefreshGrid(_policy.PolicyAlerts);
StartRefreshTab();
}
}
@ -184,30 +193,7 @@ namespace XenAdmin.Dialogs.VMProtectionRecovery
{
if (_policy != null)
{
/* hoursFromNow has 3 possible values:
1) 0 -> top 10 messages (default)
2) 24 -> messages from past 24 Hrs
3) 7 * 24 -> messages from lst 7 days */
int hoursFromNow = 0 ;
switch (comboBox1.SelectedIndex)
{
case 0: /* default value*/
break;
case 1:
hoursFromNow = 24;
break;
case 2:
hoursFromNow = 7 * 24;
break;
}
dataGridView1.Rows.Clear();
panelLoading.Visible = true;
PureAsyncAction action = _policy.getAlertsAction(_policy, hoursFromNow);
action.Completed += action_Completed;
action.RunAsync();
StartRefreshTab();
}
}