CP-36392: Rename key constants in WlbReportSubscription.cs to avoid field clash

Names are amibguous
Also made the fields `const`

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-10-05 11:56:15 +01:00
parent 3a69fa0f8c
commit 69722d93bd
No known key found for this signature in database
GPG Key ID: 0C48542619080FD4
2 changed files with 112 additions and 112 deletions

View File

@ -378,8 +378,8 @@ namespace XenAdmin.Dialogs.Wlb
Dictionary<string, string> rps = new Dictionary<string, string>(); Dictionary<string, string> rps = new Dictionary<string, string>();
foreach(string key in this._rpParams.Keys) foreach(string key in this._rpParams.Keys)
{ {
if (String.Compare(key, WlbReportSubscription.REPORT_NAME, true) == 0) if (String.Compare(key, WlbReportSubscription.REPORT_NAME_KEY, true) == 0)
_subscription.ReportName = this._rpParams[WlbReportSubscription.REPORT_NAME]; _subscription.ReportName = this._rpParams[WlbReportSubscription.REPORT_NAME_KEY];
else else
{ {
//Get start date range //Get start date range

View File

@ -38,32 +38,32 @@ namespace XenAdmin.Wlb
{ {
#region Variables #region Variables
private static string SUB_ID = "id"; private const string SUB_ID_KEY = "id";
private static string CREATED = "created"; private const string CREATED_KEY = "created";
private static string SUB_NAME = "name"; private const string SUB_NAME_KEY = "name";
private static string SUB_DESCRIPTION = "description"; private const string SUB_DESCRIPTION_KEY = "description";
private static string SUBSCRIBER_ID = "subscriberId"; private const string SUBSCRIBER_ID_KEY = "subscriberId";
private static string SUBSCRIBER_NAME = "subscriberName"; private const string SUBSCRIBER_NAME_KEY = "subscriberName";
private static string SCHEDULE_ID = "scheduleId"; private const string SCHEDULE_ID_KEY = "scheduleId";
private static string DAYOFWEEK = "daysOfWeek"; private const string DAYOFWEEK_KEY = "daysOfWeek";
private static string EXECUTE_TIMEOFDAY = "executeTimeOfDay"; private const string EXECUTE_TIMEOFDAY_KEY = "executeTimeOfDay";
private static string TRIGGER_TYPE = "triggerType"; private const string TRIGGER_TYPE_KEY = "triggerType";
private static string ENABLED = "enabled"; private const string ENABLED_KEY = "enabled";
private static string ENABLE_DATE = "enableDate"; private const string ENABLE_DATE_KEY = "enableDate";
private static string DISABLE_DATE = "disableDate"; private const string DISABLE_DATE_KEY = "disableDate";
private static string LAST_TOUCHED = "lastTouched"; private const string LAST_TOUCHED_KEY = "lastTouched";
private static string LAST_TOUCHEDBY = "lastTouchedBy"; private const string LAST_TOUCHEDBY_KEY = "lastTouchedBy";
private static string LAST_RUN = "lastRun"; private const string LAST_RUN_KEY = "lastRun";
private static string LAST_RUNRESULT = "lastRunResult"; private const string LAST_RUNRESULT_KEY = "lastRunResult";
private static string EMAIL_TO = "emailTo"; private const string EMAIL_TO_KEY = "emailTo";
private static string EMAIL_REPLYTO = "emailReplyTo"; private const string EMAIL_REPLYTO_KEY = "emailReplyTo";
private static string REPORT_RENDERFORMAT = "rpRenderFormat"; private const string REPORT_RENDERFORMAT_KEY = "rpRenderFormat";
private static string EMAIL_SUBJECT = "emailSubject"; private const string EMAIL_SUBJECT_KEY = "emailSubject";
private static string EMAIL_COMMENT = "emailComment"; private const string EMAIL_COMMENT_KEY = "emailComment";
private static string EMAIL_CC = "emailCc"; private const string EMAIL_CC_KEY = "emailCc";
private static string EMAIL_BCC = "emailBcc"; private const string EMAIL_BCC_KEY = "emailBcc";
private static string REPORT_ID = "reportId"; private const string REPORT_ID_KEY = "reportId";
public static string REPORT_NAME = "reportName"; public const string REPORT_NAME_KEY = "reportName";
private string _reportDisplayName; private string _reportDisplayName;
@ -101,41 +101,41 @@ namespace XenAdmin.Wlb
/// <param name="id">Subscription id</param> /// <param name="id">Subscription id</param>
public WlbReportSubscription(string id) public WlbReportSubscription(string id)
{ {
base.Configuration = new Dictionary<string, string>(); Configuration = new Dictionary<string, string>();
base.KeyBase = WlbConfigurationKeyBase.rpSub; KeyBase = WlbConfigurationKeyBase.rpSub;
base.ItemId = (String.IsNullOrEmpty(id) ? "0" : id); ItemId = string.IsNullOrEmpty(id) ? "0" : id;
this._reportDisplayName = String.Empty; _reportDisplayName = string.Empty;
//Define the known keys //Define the known keys
base.WlbConfigurationKeys = WlbConfigurationKeys =
new List<string>(new string[] new List<string>(new[]
{ {
SUB_ID, SUB_ID_KEY,
CREATED, CREATED_KEY,
SUB_NAME, SUB_NAME_KEY,
SUB_DESCRIPTION, SUB_DESCRIPTION_KEY,
SUBSCRIBER_ID, SUBSCRIBER_ID_KEY,
SUBSCRIBER_NAME, SUBSCRIBER_NAME_KEY,
SCHEDULE_ID, SCHEDULE_ID_KEY,
DAYOFWEEK, DAYOFWEEK_KEY,
EXECUTE_TIMEOFDAY, EXECUTE_TIMEOFDAY_KEY,
TRIGGER_TYPE, TRIGGER_TYPE_KEY,
ENABLED, ENABLED_KEY,
ENABLE_DATE, ENABLE_DATE_KEY,
DISABLE_DATE, DISABLE_DATE_KEY,
LAST_TOUCHED, LAST_TOUCHED_KEY,
LAST_TOUCHEDBY, LAST_TOUCHEDBY_KEY,
LAST_RUN, LAST_RUN_KEY,
LAST_RUNRESULT, LAST_RUNRESULT_KEY,
EMAIL_TO, EMAIL_TO_KEY,
EMAIL_REPLYTO, EMAIL_REPLYTO_KEY,
REPORT_RENDERFORMAT, REPORT_RENDERFORMAT_KEY,
EMAIL_SUBJECT, EMAIL_SUBJECT_KEY,
EMAIL_COMMENT, EMAIL_COMMENT_KEY,
EMAIL_CC, EMAIL_CC_KEY,
EMAIL_BCC, EMAIL_BCC_KEY,
REPORT_ID, REPORT_ID_KEY,
REPORT_NAME REPORT_NAME_KEY
}); });
} }
@ -148,8 +148,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string Id public string Id
{ {
get { return GetConfigValueString(base.BuildComplexKey(SUB_ID)); } get { return GetConfigValueString(base.BuildComplexKey(SUB_ID_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SUB_ID), value, true); } set { SetConfigValueString(base.BuildComplexKey(SUB_ID_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -157,8 +157,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime Created public DateTime Created
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(CREATED)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(CREATED_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(CREATED), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(CREATED_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -166,8 +166,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string Name public string Name
{ {
get { return GetConfigValueString(base.BuildComplexKey(SUB_NAME)); } get { return GetConfigValueString(base.BuildComplexKey(SUB_NAME_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SUB_NAME), value, true); } set { SetConfigValueString(base.BuildComplexKey(SUB_NAME_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -175,8 +175,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string Description public string Description
{ {
get { return GetConfigValueString(base.BuildComplexKey(SUB_DESCRIPTION)); } get { return GetConfigValueString(base.BuildComplexKey(SUB_DESCRIPTION_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SUB_DESCRIPTION), value, true); } set { SetConfigValueString(base.BuildComplexKey(SUB_DESCRIPTION_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -184,8 +184,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string SubscriberId public string SubscriberId
{ {
get { return GetConfigValueString(base.BuildComplexKey(SUBSCRIBER_ID)); } get { return GetConfigValueString(base.BuildComplexKey(SUBSCRIBER_ID_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SUBSCRIBER_ID), value, true); } set { SetConfigValueString(base.BuildComplexKey(SUBSCRIBER_ID_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -193,8 +193,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string SubscriberName public string SubscriberName
{ {
get { return GetConfigValueString(base.BuildComplexKey(SUBSCRIBER_NAME)); } get { return GetConfigValueString(base.BuildComplexKey(SUBSCRIBER_NAME_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SUBSCRIBER_NAME), value, true); } set { SetConfigValueString(base.BuildComplexKey(SUBSCRIBER_NAME_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -202,8 +202,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string ScheduleId public string ScheduleId
{ {
get { return GetConfigValueString(base.BuildComplexKey(SCHEDULE_ID)); } get { return GetConfigValueString(base.BuildComplexKey(SCHEDULE_ID_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(SCHEDULE_ID), value, true); } set { SetConfigValueString(base.BuildComplexKey(SCHEDULE_ID_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -211,8 +211,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public WlbScheduledTask.WlbTaskDaysOfWeek DaysOfWeek public WlbScheduledTask.WlbTaskDaysOfWeek DaysOfWeek
{ {
get { return (WlbScheduledTask.WlbTaskDaysOfWeek)GetConfigValueInt(base.BuildComplexKey(DAYOFWEEK)); } get { return (WlbScheduledTask.WlbTaskDaysOfWeek)GetConfigValueInt(base.BuildComplexKey(DAYOFWEEK_KEY)); }
set { SetConfigValueInt(base.BuildComplexKey(DAYOFWEEK), (int)value, true); } set { SetConfigValueInt(base.BuildComplexKey(DAYOFWEEK_KEY), (int)value, true); }
} }
/// <summary> /// <summary>
@ -220,8 +220,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime RunTimeOfDay public DateTime RunTimeOfDay
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(EXECUTE_TIMEOFDAY)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(EXECUTE_TIMEOFDAY_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(EXECUTE_TIMEOFDAY), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(EXECUTE_TIMEOFDAY_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -229,8 +229,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public int TriggerType public int TriggerType
{ {
get { return GetConfigValueInt(base.BuildComplexKey(TRIGGER_TYPE)); } get { return GetConfigValueInt(base.BuildComplexKey(TRIGGER_TYPE_KEY)); }
set { SetConfigValueInt(base.BuildComplexKey(TRIGGER_TYPE), value, true); } set { SetConfigValueInt(base.BuildComplexKey(TRIGGER_TYPE_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -238,8 +238,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public bool Enabled public bool Enabled
{ {
get { return GetConfigValueBool(base.BuildComplexKey(ENABLED)); } get { return GetConfigValueBool(base.BuildComplexKey(ENABLED_KEY)); }
set { SetConfigValueBool(base.BuildComplexKey(ENABLED), value, true); } set { SetConfigValueBool(base.BuildComplexKey(ENABLED_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -247,8 +247,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime EnableDate public DateTime EnableDate
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(ENABLE_DATE)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(ENABLE_DATE_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(ENABLE_DATE), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(ENABLE_DATE_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -256,8 +256,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime DisableDate public DateTime DisableDate
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(DISABLE_DATE)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(DISABLE_DATE_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(DISABLE_DATE), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(DISABLE_DATE_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -265,8 +265,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime LastTouched public DateTime LastTouched
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(LAST_TOUCHED)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(LAST_TOUCHED_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(LAST_TOUCHED), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(LAST_TOUCHED_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -274,8 +274,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string LastTouchedBy public string LastTouchedBy
{ {
get { return GetConfigValueString(base.BuildComplexKey(LAST_TOUCHEDBY)); } get { return GetConfigValueString(base.BuildComplexKey(LAST_TOUCHEDBY_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(LAST_TOUCHEDBY), value, true); } set { SetConfigValueString(base.BuildComplexKey(LAST_TOUCHEDBY_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -283,8 +283,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public DateTime LastRun public DateTime LastRun
{ {
get { return GetConfigValueUTCDateTime(base.BuildComplexKey(LAST_RUN)); } get { return GetConfigValueUTCDateTime(base.BuildComplexKey(LAST_RUN_KEY)); }
set { SetConfigValueUTCDateTime(base.BuildComplexKey(LAST_RUN), value, true); } set { SetConfigValueUTCDateTime(base.BuildComplexKey(LAST_RUN_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -292,8 +292,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string LastRunResult public string LastRunResult
{ {
get { return GetConfigValueString(base.BuildComplexKey(LAST_RUNRESULT)); } get { return GetConfigValueString(base.BuildComplexKey(LAST_RUNRESULT_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(LAST_RUNRESULT), value, true); } set { SetConfigValueString(base.BuildComplexKey(LAST_RUNRESULT_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -301,8 +301,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailTo public string EmailTo
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_TO)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_TO_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_TO), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_TO_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -310,8 +310,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailReplyTo public string EmailReplyTo
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_REPLYTO)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_REPLYTO_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_REPLYTO), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_REPLYTO_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -319,8 +319,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public int ReportRenderFormat public int ReportRenderFormat
{ {
get { return GetConfigValueInt(base.BuildComplexKey(REPORT_RENDERFORMAT)); } get { return GetConfigValueInt(base.BuildComplexKey(REPORT_RENDERFORMAT_KEY)); }
set { SetConfigValueInt(base.BuildComplexKey(REPORT_RENDERFORMAT), (int)value, true); } set { SetConfigValueInt(base.BuildComplexKey(REPORT_RENDERFORMAT_KEY), (int)value, true); }
} }
/// <summary> /// <summary>
@ -328,8 +328,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailSubject public string EmailSubject
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_SUBJECT)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_SUBJECT_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_SUBJECT), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_SUBJECT_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -337,8 +337,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailComment public string EmailComment
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_COMMENT)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_COMMENT_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_COMMENT), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_COMMENT_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -346,8 +346,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailCc public string EmailCc
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_CC)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_CC_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_CC), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_CC_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -355,8 +355,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string EmailBcc public string EmailBcc
{ {
get { return GetConfigValueString(base.BuildComplexKey(EMAIL_BCC)); } get { return GetConfigValueString(base.BuildComplexKey(EMAIL_BCC_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(EMAIL_BCC), value, true); } set { SetConfigValueString(base.BuildComplexKey(EMAIL_BCC_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -364,8 +364,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public int ReportId public int ReportId
{ {
get { return GetConfigValueInt(base.BuildComplexKey(REPORT_ID)); } get { return GetConfigValueInt(base.BuildComplexKey(REPORT_ID_KEY)); }
set { SetConfigValueInt(base.BuildComplexKey(REPORT_ID), value, true); } set { SetConfigValueInt(base.BuildComplexKey(REPORT_ID_KEY), value, true); }
} }
/// <summary> /// <summary>
@ -373,8 +373,8 @@ namespace XenAdmin.Wlb
/// </summary> /// </summary>
public string ReportName public string ReportName
{ {
get { return GetConfigValueString(base.BuildComplexKey(REPORT_NAME)); } get { return GetConfigValueString(base.BuildComplexKey(REPORT_NAME_KEY)); }
set { SetConfigValueString(base.BuildComplexKey(REPORT_NAME), value, true); } set { SetConfigValueString(base.BuildComplexKey(REPORT_NAME_KEY), value, true); }
} }
/// <summary> /// <summary>