基本的に次のように、カスタムフォーマッタを指定しています。
public class NotationNumericFormatter : IFormatProvider, ICustomFormatter
{
public object GetFormat(Type formatType_)
{
return (formatType_ == typeof(ICustomFormatter) ? this : null;
}
public string Format(string format_, object arg_, IFormatProvider formatProvider_)
{
if (!Equals(formatProvider_) || arg_ == null) // <-- I put a breakpoint here...
{
return;
}
// then a bunch of stuff happens here.
}
}
現時点で私を困惑させているのは、次のコードです。
// _myFormatter is a NotationNumericFormatter which gets instanced
// in the ctor of the class in question.
var result = string.Format(_myFormatter, (parameter_ ?? "").ToString(), value_);
私のフォーマッタのFormat()
メソッドの最初の行にヒットすることは決してありません。ここで何が欠けていますか?string.Format
私が見逃している微妙な点はありますか?