private void initSingleListItemFromComponent(string[] components, IListNote note) { string content = components[0]; bool highlighted = bool.Parse(components[1]); ItemsModifier modifier = new ItemsModifier(); modifier.TryAddToList(note, new ListItem(highlighted, content)); }
public void DisplayFullList(IListNote note) { displayFullInfoHeader(note); displayFullInfoContent(note); displayAdditionalInfoContent(note); Console.ForegroundColor = DEFAULT_COLOR; }
private void displayAdditionalInfoContent(IListNote note) { List <string> noteAdditionlContent = note.GetAdditionalContent(); for (int i = 0; i < noteAdditionlContent.Count; i++) { Console.WriteLine(noteAdditionlContent[i]); } }
private void handleAddingItem(IListNote note) { Console.WriteLine("Type item content"); string content = Console.ReadLine(); Console.WriteLine("Is checked? (Y/n)"); bool isChecked = Console.ReadLine() == "n" ? false : true; ItemsModifier modifier = new ItemsModifier(); modifier.TryAddToList(note, new ListItem(isChecked, content)); }
public void BuildListItems(IListNote note) { Console.WriteLine("Type count of items in list:"); int count; int.TryParse(Console.ReadLine(), out count); for (int i = 0; i < count; i++) { handleAddingItem(note); } }
public bool TryAddToList(IListNote note, ListItem item) { if (note.Items.Contains(item)) { Logger.PrintError($"Item: {item} (Content = {item.Content}, Highlighted = {item.Checked}) already exists"); return(false); } note.Items.Add(item); return(true); }
public bool TryRemoveFromList(IListNote note, ListItem item) { if (!note.Items.Contains(item)) { Logger.PrintError($"Item: {item} (Content = {item.Content}, Highlighted = {item.Checked}) does not exist"); return(false); } note.Items.Remove(item); return(true); }
public void InitListItemsFromComponents(string[] components, int lastStandardIndex, IListNote source) { for (int i = lastStandardIndex + 1; i < components.Length; i += ListItem.SAVE_COMPONENTS_COUNT) { try { initSingleListItemFromComponent(components, source); } catch (Exception e) { Console.WriteLine(e.Message); } } }