public override void EditLabels() { if (!CanEditLabels) { return; } foreach (var vm in bookmarksVM.AllItems) { vm.ClearEditingValueProperties(); } if (SelectedItems.Count == 1) { SelectedItems[0].LabelsEditableValue.IsEditingValue = true; } else { var newLabels = messageBoxService.Ask <string>(dnSpy_Resources.EditLabelsMsgBoxLabel, SelectedItems[0].GetLabelsString(), dnSpy_Resources.EditLabelsTitle); if (!(newLabels is null)) { var labelsColl = BookmarkVM.CreateLabelsCollection(newLabels); bookmarksService.Value.Modify(SelectedItems.Select(a => { var bm = a.Bookmark; var settings = bm.Settings; settings.Labels = labelsColl; return(new BookmarkAndSettings(bm, settings)); }).ToArray()); } } }
internal void WriteLabels(ITextColorWriter output, BookmarkVM vm) { bool needSep = false; foreach (var label in vm.Bookmark.Labels ?? emptyLabels) { if (needSep) { output.Write(BoxedTextColor.Text, LabelsSeparatorString); output.WriteSpace(); } needSep = true; output.Write(BoxedTextColor.Text, label); } }
internal void WriteModule(ITextColorWriter output, BookmarkVM vm) => vm.BookmarkLocationFormatter.WriteModule(output);
internal void WriteLocation(ITextColorWriter output, BookmarkVM vm) => vm.BookmarkLocationFormatter.WriteLocation(output, vm.Context.FormatterOptions);
internal void WriteName(ITextColorWriter output, BookmarkVM vm) { var color = vm.IsActive ? BoxedTextColor.ActiveBookmarkName : BoxedTextColor.BookmarkName; output.Write(color, vm.Bookmark.Name ?? string.Empty); }