📄 snippet.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
namespace ScrewTurn.Wiki.PluginFramework {
/// <summary>
/// Contains a Snippet.
/// </summary>
[Serializable]
public class Snippet {
private string name, content;
private IPagesStorageProvider provider;
/// <summary>
/// Initializes a new instance of the <b>Snippet</b> class.
/// </summary>
/// <param name="name">The Name of the Snippet.</param>
/// <param name="content">The Content of the Snippet.</param>
/// <param name="provider">The Provider of the Snippet.</param>
public Snippet(string name, string content, IPagesStorageProvider provider) {
this.name = name;
this.content = content;
this.provider = provider;
}
/// <summary>
/// Gets the Name of the Snippet.
/// </summary>
public string Name {
get { return name; }
}
/// <summary>
/// Gets or sets the Content of the Snippet.
/// </summary>
public string Content {
get { return content; }
}
/// <summary>
/// Gets the Provider of the Snippet.
/// </summary>
public IPagesStorageProvider Provider {
get { return provider; }
}
}
/// <summary>
/// Compares two Snippet objects.
/// </summary>
public class SnippetNameComparer : IComparer<Snippet> {
/// <summary>
/// Compares two Snippets' Names.
/// </summary>
/// <param name="x">The first Snippet.</param>
/// <param name="y">The second Snippet.</param>
/// <returns>The result of the comparison (1, 0 or -1).</returns>
public int Compare(Snippet x, Snippet y) {
return x.Name.ToLower().CompareTo(y.Name.ToLower());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -