//private void hourList_PropertyChanged(Object sender, PropertyChangedEventArgs e)
        //{
        //    //System.Windows.MessageBox.Show("\n Name = " + e.PropertyName); //sender.GetType().GetProperties()[0].GetValue()

        //}

        #endregion

        public SignalViewModel(Model model, String rowNumber, Boolean alarmFlag = false)
        {
            this.model       = model;
            this.rowNumber   = rowNumber;
            this.ActiveAlarm = alarmFlag;
            modelRecord      = model.GetSingleRecord(rowNumber);
            mainText         = modelRecord.Content;
            String[] data = modelRecord.RecordDate.Split(new char[] { ' ' });
            dateText = data[0];
            switch (modelRecord.RecordType)
            {
            case RecordType.project:
                recordTypeText = "Проект:";
                break;

            case RecordType.job:
                recordTypeText = "Работа:";
                break;

            case RecordType.act:
                recordTypeText = "Дело:";
                break;

            default:
                Debug.Assert(false, "NoteViewModel.InitWindow(). Ошибка типа записи.");
                break;
            }
            signalString = modelRecord.AlarmTime;
            alarmRepit   = modelRecord.AlarmRepit;
            SetTime();
        }
Exemple #2
0
        //Изменяет значение сигнала записи
        public void SetSignal(String rowNumber, String dateTime, AlarmRepit alarmRepit)
        {
            Int32[] number   = GetNumbers(rowNumber);
            Int32   rowIndex = IndexOfNumber(number[0], number[1], number[2]);

            modelRecords[rowIndex].AlarmTime  = dateTime;
            modelRecords[rowIndex].AlarmRepit = alarmRepit;
        }