本文整理匯總了C#中Tomboy.Note.RemoveTag方法的典型用法代碼示例。如果您正苦於以下問題:C# Note.RemoveTag方法的具體用法?C# Note.RemoveTag怎麽用?C# Note.RemoveTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tomboy.Note
的用法示例。
在下文中一共展示了Note.RemoveTag方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MoveNoteToNotebook
/// <summary>
/// Place the specified note into the specified notebook. If the
/// note already belongs to a notebook, it will be removed from that
/// notebook first.
/// </summary>
/// <param name="note">
/// A <see cref="Note"/>
/// </param>
/// <param name="notebook">
/// A <see cref="Notebook"/>. If Notebook is null, the note will
/// be removed from its current notebook.
/// </param>
/// <returns>True if the note was successfully moved.</returns>
public static bool MoveNoteToNotebook (Note note, Notebook notebook)
{
if (note == null)
return false;
// NOTE: In the future we may want to allow notes
// to exist in multiple notebooks. For now, to
// alleviate the confusion, only allow a note to
// exist in one notebook at a time.
Notebook currentNotebook = GetNotebookFromNote (note);
if (currentNotebook == notebook)
return true; // It's already there.
if (currentNotebook != null) {
note.RemoveTag (currentNotebook.Tag);
if (NoteRemovedFromNotebook != null)
NoteRemovedFromNotebook (note, currentNotebook);
}
// Only attempt to add the notebook tag when this
// menu item is not the "No notebook" menu item.
if (notebook != null && (notebook is SpecialNotebook) == false) {
note.AddTag (notebook.Tag);
if (NoteAddedToNotebook != null)
NoteAddedToNotebook (note, notebook);
}
return true;
}