これが私が考えていることです...
public class MyClass
{
public const string MyConstant = "MyConstantValue";
private static MyClass DefaultInstance;
static MyClass()
{
DefaultInstance = new MyClass();
}
}
...
NotificationService.RegisterForNotification(MyClass.MyConstant, Callback);
これは機能しますか、それとも次のようなものを使用する必要がありますかstatic readonly
財産静的コンストラクターをトリガーするフィールド?