BacklinkMenuItem [] GetBacklinkMenuItems() { List <BacklinkMenuItem> items = new List <BacklinkMenuItem> (); string search_title = Note.Title; string encoded_title = XmlEncoder.Encode(search_title.ToLower()); // Go through each note looking for // notes that link to this one. foreach (Note note in Note.Manager.Notes) { if (note != Note && // don't match ourself CheckNoteHasMatch(note, encoded_title)) { BacklinkMenuItem item = new BacklinkMenuItem(note, search_title); items.Add(item); } } items.Sort(); return(items.ToArray()); }
// IComparable interface public int CompareTo(object obj) { BacklinkMenuItem other_item = obj as BacklinkMenuItem; return(note.Title.CompareTo(other_item.Note.Title)); }
BacklinkMenuItem [] GetBacklinkMenuItems () { List<BacklinkMenuItem> items = new List<BacklinkMenuItem> (); string search_title = Note.Title; string encoded_title = XmlEncoder.Encode (search_title.ToLower ()); // Go through each note looking for // notes that link to this one. foreach (Note note in Note.Manager.Notes) { if (note != Note // don't match ourself && CheckNoteHasMatch (note, encoded_title)) { BacklinkMenuItem item = new BacklinkMenuItem (note, search_title); items.Add (item); } } items.Sort (); return items.ToArray (); }