Chciałbym prosić o analizę poniższego bardzo krótkiego kodu:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
bool x = true;
IConvertible p = (IConvertible)x;
IFormatProvider ifp = null;
Int32 b = p.ToInt32(ifp);
Console.WriteLine(b); Console.ReadKey();
}
}
}
Program konwertuje wartość typu bool do struktury Int32.
Chciałbym dowiedzieć się dlaczego metody ToXXX interfejsu IConvertible przyjmują za parametr inny interfejs IFormatProvider.
Jakie w ogóle jest znaczenie interfejsu IFormatProvider. Próbowałem z szukajką google ale nic z tego mi nie wyszło. Proszę skromnie o wyjaśnienie.