且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检测protobuf网可以递归:序列孩子和家长

更新时间:2023-02-17 13:03:18

I found a solution: I don't serialize the parents, and I use this function after deserialization in the "Controle" class:

    [ProtoAfterDeserialization]
    protected void OnDeserialized()
    {
        if (ControlesInternes.Count > 0)
        {
            foreach (var ctl in ControlesInternes)
            {
                ctl.Parent = this;
            }
        }
    }

相关阅读

技术问答最新文章