navigationpath.cs

来自「YetAnotherForum.Net+ScrewTurnWiki中文完美汉化增」· CS 代码 · 共 70 行

CS
70
字号

using System;
using System.Collections.Generic;

namespace ScrewTurn.Wiki.PluginFramework {

	/// <summary>
	/// Represents a Navigation Path.
	/// </summary>
	[Serializable]
	public class NavigationPath {

		private string name;
		private List<string> pages;
		private IPagesStorageProvider provider;

		/// <summary>
		/// Initializes a new instance of the <b>NavigationPath</b> class.
		/// </summary>
		/// <param name="name">The Name of the Navigation Path.</param>
		/// <param name="provider">The Provider</param>
		public NavigationPath(string name, IPagesStorageProvider provider) {
			this.name = name;
			this.provider = provider;
			pages = new List<string>();
		}

		/// <summary>
		/// Gets or sets the Name.
		/// </summary>
		public string Name {
			get { return name; }
			set { name = value; }
		}

		/// <summary>
		/// Gets the Pages of the Path.
		/// </summary>
		public List<string> Pages {
			get { return pages; }
		}

		/// <summary>
		/// Gets the Provider.
		/// </summary>
		public IPagesStorageProvider Provider {
			get { return provider; }
		}

	}

	/// <summary>
	/// Compares two NavigationPaths objects.
	/// </summary>
	public class NavigationPathComparer : IComparer<NavigationPath> {

		/// <summary>
		/// Compares two Navigation Paths's Names.
		/// </summary>
		/// <param name="x">The first object.</param>
		/// <param name="y">The second object.</param>
		/// <returns>The result of the comparison (1, 0 or -1).</returns>
		public int Compare(NavigationPath x, NavigationPath y) {
			return x.Name.ToLower().CompareTo(y.Name.ToLower());
		}

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?