예제 #1
0
        public void GetNotesRepository()
        {
            var notes = _chorusSystem.GetNotesRepository(_someDataFilePath, _progress);

            //We can add
            var annotation = new Annotation("question", "blah://blah", _someDataFilePath);

            notes.AddAnnotation(annotation);

            //We can remove
            notes.Remove(annotation);

            //We can retrieve
            notes.GetAllAnnotations();
            notes.GetByCurrentStatus("closed");
            notes.GetMatchesByPrimaryRefKey("1abc3");
            notes.GetMatches(note => note.Messages.Count() > 0);

            //for large repositories, you can also create indexes and add them
            //to the repository, to speed things up.
            var index = new IndexByDate();

            notes.AddObserver(index, _progress);
            var todaysNotes = index.GetByDate(DateTime.Now);

            //Note, index is just one kind of observer, you can add others too.
        }
예제 #2
0
        public void GetNotesRepository()
        {
            var notes = _chorusSystem.GetNotesRepository(_someDataFilePath, _progress);

            //We can add
            var annotation = new Annotation("question", "blah://blah", _someDataFilePath);
            notes.AddAnnotation(annotation);

            //We can remove
            notes.Remove(annotation);

            //We can retrieve
            notes.GetAllAnnotations();
            notes.GetByCurrentStatus("closed");
            notes.GetMatchesByPrimaryRefKey("1abc3");
            notes.GetMatches(note => note.Messages.Count() > 0);

            //for large repositories, you can also create indexes and add them
            //to the repository, to speed things up.
            var index = new IndexByDate();
            notes.AddObserver(index, _progress);
            var todaysNotes = index.GetByDate(DateTime.Now);

            //Note, index is just one kind of observer, you can add others too.
        }