public bool ModifyItem(GroupItem item, int samplingInterval, float deadband, bool active)
{
// check if the item can be added to the group.
if (m_samplingInterval != samplingInterval || m_deadband != deadband)
{
// check if the item needs to be removed from the group.
if (m_items.Count > 1)
{
item.Deleted = true;
return false;
}
// update active state.
item.ActiveChanged = active != item.Active;
item.Active = active;
// update the group parameters.
m_samplingInterval = samplingInterval;
m_deadband = deadband;
m_updateRequired = true;
return true;
}
// undelete the item.
item.Deleted = false;
// update active state.
item.ActiveChanged = active != item.Active;
item.Active = active;
// nothing to do - the group matches the item.
return true;
}