PlusleSeedCalculator.Library.ResultDatum クラス
これはプラスルツールのプラグイン作者向けに書かれた記事です。
プラグインの使い方を知りたい方は[id:plusletool:20100918:howtouse]を参照。
プラグインの作り方を知りたい方は[id:plusletool:20100918:PluginManual]も参照。
出力結果を表すクラスです。
1つの ResultDatum インスタンスにつき、1つの小データを表します。
html出力の場合、各 ResultDatum インスタンスはspan要素で出力されます。
【定義】
public sealed class ResultDatum
ResultDatum コンストラクタ
ResultDatum クラスの新しいインスタンスを初期化します。
このコンストラクタで作られたインスタンスは、結果出力時、引数 text の文字列を表示します。
【定義】
public ResultDatum( string text )
【パラメータ】
- text
- 結果出力時に表示される文字列。
【使用例】
string text = "この文字列が表示されます。"; ResultDatum rd = new ResultDatum(text);
- 出力結果(html出力時)
<span>この文字列が表示されます。</span>
ResultDatum コンストラクタ
ResultDatum クラスの新しいインスタンスを初期化します。
このコンストラクタで作られたインスタンスは、結果出力時、引数 text の文字列を表示します。
html出力の場合、引数 classes の文字列コレクションがspan要素のクラス名になります。
【定義】
public ResultDatum( string text, IEnumerable<string> classes )
【パラメータ】
- text
- 結果出力時に表示される文字列。
- classes
- span要素のクラス名(クラス属性の属性値)。
※このパラメータは、html出力時のみ使用されます。
【使用例】
string text = "この文字列が表示されます。"; IEnumerable<string> classes = new string[] { "xxx", "yyy", "zzz" }; ResultDatum rd = new ResultDatum(text,classes);
- 出力結果(html出力時)
<span class='xxx yyy zzz'>この文字列が表示されます。</span>
ResultDatum コンストラクタ
ResultDatum クラスの新しいインスタンスを初期化します。
このコンストラクタで作られたインスタンスは、結果出力時、引数 text の文字列を表示します。
html出力の場合、引数 classes の文字列コレクションがspan要素のクラス名になり、引数 attributes の文字列コレクションがspan要素の属性になります。
【定義】
public ResultDatum( string text, IEnumerable<string> classes, IEnumerable<string> attributes )
【パラメータ】
- text
- 結果出力時に表示される文字列。
- classes
- span要素のクラス名(クラス属性の属性値)。
※このパラメータは、html出力時のみ使用されます。 - attributes
- span要素のクラス属性以外の属性(属性値と属性名の組)。
※このパラメータは、html出力時のみ使用されます。
【使用例】
string text = "この文字列が表示されます。"; IEnumerable<string> classes = new string[] { "xxx", "yyy", "zzz" }; IEnumerable<string> attributes = new string[] { "style='color:red'" }; ResultDatum rd = new ResultDatum(text,classes,attributes);
- 出力結果(html出力時)
<span class='xxx yyy zzz' style='color:red'>この文字列が表示されます。</span>