可能性の重複:
What's the difference between using the Serializable attribute & implementing ISerializable?ISerializableでは[Serializable]属性は何をしますか?
タグ付けにSerializable
とclassは何をしますか?例えば:それはISerializable
を実装class異なる方法
[Serializable]
public Hashtable
{
}
?例えば:
public Hashtable : ISerializable
{
}
そして、どのようにSerializableとしてclassをタグ付けしてISerializable
を実装するからその違うのですか? ISerializable
とは対照的に、例えば:
[Serializable]
public Hashtable : ISerializable
{
}
[Serializable]
の目的は何ですか?
tl; dr:[Serializable]
とは何ですか?
独自のリンクから:「クラスでシリアル化プロセスを制御する必要がある場合、ISerializableインターフェイスを実装できます」 –
http://stackoverflow.com/questions/2365152/whats-the-difference-between-using-the -serializable-attribute-implemented-is – BFree
@BFree * "上記のことは、シリアライズ機能がクラス 'MyFoo'全体をシリアライズする必要があることを示しています。 –