Example #1
0
        public MainViewModel(Repository repository, IParser parser, KeywordExtractor keywordExtractor, State state)
        {
            _repository       = repository;
            _parser           = parser;
            _keywordExtractor = keywordExtractor;
            _state            = state;

            SaveCommand        = new RelayCommand(_ => Save());
            SyncCommand        = new RelayCommand(_ => Sync());
            NextDayCommand     = new RelayCommand(_ => NextDay());
            PreviousDayCommand = new RelayCommand(_ => PreviousDay());
            InsertCommand      = new RelayCommand(_ => Insert());

            _timer = new Timer(1000)
            {
                Enabled = false
            };
            _timer.Elapsed += Timer_Elapsed;

            _text = _repository.Load();
            _todo = _repository.LoadToDo();

            Find                        = new Find(state);
            FindNext                    = new FindNext(state);
            FindPrevious                = new FindPrevious(state);
            Goto                        = new Goto(state);
            ShowContextMenu             = new ShowContextMenu(state);
            FormatSelectionBase64Decode = new FormatSelectionBase64Decode(state);
            FormatSelectionBase64Encode = new FormatSelectionBase64Encode(state);
            FormatSelectionDecodeUrl    = new FormatSelectionDecodeUrl(state);
            FormatSelectionEncodeUrl    = new FormatSelectionEncodeUrl(state);
            FormatSelectionToLower      = new FormatSelectionToLower(state);
            FormatSelectionToUpper      = new FormatSelectionToUpper(state);
            SpellCheck                  = new SpellCheck(state);

            EnsureDateLine();
        }
Example #2
0
        private void uiFindPreviousButton_Click(object sender, EventArgs e)
        {
            string search = uiFindTextTextBox.Text;

            FindPrevious?.Invoke(this, new TextEventArgs(search));
        }