Esempio n. 1
0
        private void PrintAllNotesNames(NoteNodeResource noteNodeResource)
        {
            IEnumerable <string> notesToPrint = noteNodeResource.Children.Keys
                                                .Where(noteName => Path.GetExtension(noteName).Equals(TaskerConsts.NoteExtension))
                                                .Select(noteName => Path.GetFileNameWithoutExtension(noteName));

            mConsolePrinter.Print(notesToPrint, header: "NOTES");
        }
Esempio n. 2
0
        private async Task <int> GetNoteContent(string notePath, bool shouldPrintAll)
        {
            if (shouldPrintAll)
            {
                NoteNodeResource noteNodeResource = await GetAllNotesNames().ConfigureAwait(false);

                PrintAllNotesNames(noteNodeResource);
                return(0);
            }

            if (string.IsNullOrWhiteSpace(notePath))
            {
                mLogger.LogError($"{nameof(notePath)} is null or empty");
                return(1);
            }

            await PrintNoteText(notePath, isPrivateNote : true).ConfigureAwait(false);

            return(0);
        }