Ejemplo n.º 1
0
		public void Sort(AlarmType? sortingAlarmType)
		{
			SortingAlarmType = sortingAlarmType;

            Alarm oldAlarm = null;
            if (SelectedAlarm != null)
            {
                oldAlarm = SelectedAlarm.Alarm.Clone();
            }

			Alarms.Clear();
			foreach (var alarm in allAlarms)
			{
				if ((sortingAlarmType == null) || (alarm.AlarmType == sortingAlarmType))
				{
					var alarmViewModel = new AlarmViewModel(alarm);
					Alarms.Add(alarmViewModel);
				}
			}

            if (oldAlarm != null)
            {
                SelectedAlarm = Alarms.FirstOrDefault(x => x.Alarm.IsEqualTo(oldAlarm));
            }
		}
Ejemplo n.º 2
0
        public void Sort(AlarmType? alarmType)
        {
            _alarmType = alarmType;

            Alarms.Clear();

            foreach (var alarm in allAlarms)
            {
                if ((alarmType == null) || (alarm.AlarmType == alarmType))
                {
                    var alarmViewModel = new AlarmViewModel(alarm);
                    Alarms.Add(alarmViewModel);
                }
            }
        }