小编CDT*_*TWF的帖子

使用XmlSerializer反序列化XML时,保留仅空白元素内容

我有一个类InputConfig,其中包含List<IncludeExcludeRule>:

public class InputConfig
{
    // The rest of the class omitted 
    private List<IncludeExcludeRule> includeExcludeRules;
    public List<IncludeExcludeRule> IncludeExcludeRules
    {
        get { return includeExcludeRules; }
        set { includeExcludeRules = value; }
    }
}

public class IncludeExcludeRule
{
    // Other members omitted
    private int idx;
    private string function;

    public int Idx
    {
        get { return idx; }
        set { idx = value; }
    }

    public string Function
    {
        get { return function; }
        set { function = value; …
Run Code Online (Sandbox Code Playgroud)

.net c# xml whitespace xmlserializer

7
推荐指数
2
解决办法
3876
查看次数

标签 统计

.net ×1

c# ×1

whitespace ×1

xml ×1

xmlserializer ×1