I have the below code. We had an argument regarding which approach is better for memory performance. Will it make any difference at all if we don't use a separate variable and use it? It it will affect then is this the possible solution ?
/// <summary>
/// Treatment Point Types
/// </summary>
public string DWTreatment
{
get
{
StringBuilder sbStatus = new StringBuilder();
.........
}
set
{
chkTreatSR.Checked = value.Split(',').Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.SR).ToString());
chkTreatIT.Checked = value.Split(',').Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.IT).ToString());
chkTreatEP.Checked = value.Split(',').Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.EP).ToString());
chkTreatWW.Checked = value.Split(',').Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.WW).ToString());
chkTreatQC.Checked = value.Split(',').Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.QC).ToString());
isSelectionSetByPage = true;
}
}
OR
/// <summary>
/// Treatment Point Types
/// </summary>
public string DWTreatment
{
get
{
StringBuilder sbStatus = new StringBuilder();
.........
}
set
{
var values = value.Split(',');
chkTreatSR.Checked = values.Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.SR).ToString());
chkTreatIT.Checked = values.Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.IT).ToString());
chkTreatEP.Checked = values.Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.EP).ToString());
chkTreatWW.Checked = values.Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.WW).ToString());
chkTreatQC.Checked = values.Contains(((int)AgencyListReportTemplate.SamplingPointTypesEnum.QC).ToString());
isSelectionSetByPage = true;
}
}
Thanks.