コード例 #1
0
ファイル: BacklinksNoteAddin.cs プロジェクト: grepory/tomboy
        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());
        }
コード例 #2
0
ファイル: BacklinkMenuItem.cs プロジェクト: shubhtr/tomboy-1
        // IComparable interface
        public int CompareTo(object obj)
        {
            BacklinkMenuItem other_item = obj as BacklinkMenuItem;

            return(note.Title.CompareTo(other_item.Note.Title));
        }
コード例 #3
0
		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 ();
		}