当前位置: 首页>>代码示例>>C#>>正文


C# Note.RemoveTag方法代码示例

本文整理汇总了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;
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:43,代码来源:NotebookManager.cs


注:本文中的Tomboy.Note.RemoveTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。