-
-
Save kou-yeung/a8b45b7225d3a5307c1439429b534b99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static string path = @"[PATH]\Sample.xml"; | |
static void Main(string[] args) | |
{ | |
// typeof(Table)の XmlSerializer を生成する。 | |
// 第2引数に GetOverrides() を渡すの注目してください。 | |
var serializer = new XmlSerializer(typeof(Table), GetOverrides()); | |
// ファイルを開いてデシリアライズする。(ここは通常通りです) | |
using (var stream = new FileStream(path, FileMode.Open)) | |
{ | |
var table = serializer.Deserialize(stream) as Table; | |
// ... デシリアライズ結果を使用する | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment