Exemple #1
0
        /// <summary>
        /// Create native alarm
        /// </summary>
        public static void CreateAlarm()
        {
            // create a native alarm using AlarmModel.BindableAlarmRecord
            // After then, update Native alarm ID.
            BindableAlarmRecord.NativeAlarmID = AlarmNativeHandler.CreateAlarm(BindableAlarmRecord);

            AlarmRecord record = new AlarmRecord();

            record.DeepCopy(BindableAlarmRecord);
            ObservableAlarmList.Add(record);
            AlarmRecordDictionary.Add(record.GetUniqueIdentifier(), record);
            SaveDictionary();
        }
Exemple #2
0
        /// <summary>
        /// Create native alarm
        /// </summary>
        public static void CreateAlarmAndSave()
        {
            // create a native alarm using AlarmModel.BindableAlarmRecord
            // After then, update Native alarm ID.
            BindableAlarmRecord.NativeAlarmID = DependencyService.Get <IAlarm>().CreateAlarm(BindableAlarmRecord);
            DependencyService.Get <ILog>().Debug("====== AlarmModel.CreateAlarm >> BindableAlarmRecord.NativeAlarmID : " + BindableAlarmRecord.NativeAlarmID);
            // ObservableAlarmList is ItemsSource for AlarmList view. This is bindable so this model
            // should be changed to reflect record change (adding a new alarm)

            AlarmRecord record = new AlarmRecord();

            record.DeepCopy(BindableAlarmRecord);
            //AlarmModel.Compare(BindableAlarmRecord, record);

            ObservableAlarmList.Add(record);
            AlarmRecordDictionary.Add(record.GetUniqueIdentifier(), record);
            SaveDictionary();
        }