private bool HasMAPChanged(MonitoringObject mapObject) { if (mapObject == null) { return(true); } if (mapObject.IsInstanceOf(poolClass)) { if (rbAgent.Checked) // current MAP type is POOL, but AGENT is selected { return(true); } if (cbResourcePools.SelectedItem == null) { return(false); } if (((MonitoringObject)cbResourcePools.SelectedItem).Id == mapObject.Id) { return(false); } else { return(true); } } if (mapObject.IsInstanceOf(healthServiceClass)) { if (rbPool.Checked) // current MAP type is AGENT, but POOL is selected { return(true); } if (lbAgentList.SelectedItem == null) { return(false); } if (((MonitoringObject)lbAgentList.SelectedItem).Id == mapObject.Id) { return(false); } else { return(true); } } return(false); }
public TestObjectAdapter(MonitoringObject rootEntity, Dictionary <string, Image> mainteanceModeImages, Dictionary <HealthState, Image> healthStateImages, Dictionary <HealthState, string> healthStrings) { if (rootEntity == null) { throw new ArgumentNullException(nameof(rootEntity)); } if (!rootEntity.IsInstanceOf(rootEntity.ManagementGroup.EntityTypes.GetClass(IDs.TestBaseClassId))) { throw new InvalidCastException($"Monitoring object passed in the {nameof(rootEntity)} parameter must be of a child class type of 'Maximus.Connectivity.Monitoring.Test'."); } entity = rootEntity; mmImages = mainteanceModeImages; hsImages = healthStateImages; hsStrings = healthStrings; }