KeePass.Util.XmlSerialization.XmlSerializerEx.ReadAcePasswordGenerator C# (CSharp) Method

ReadAcePasswordGenerator() private static method

private static ReadAcePasswordGenerator ( XmlReader xr ) : KeePass.App.Configuration.AcePasswordGenerator
xr System.Xml.XmlReader
return KeePass.App.Configuration.AcePasswordGenerator
        private static KeePass.App.Configuration.AcePasswordGenerator ReadAcePasswordGenerator(XmlReader xr)
        {
            KeePass.App.Configuration.AcePasswordGenerator o = new KeePass.App.Configuration.AcePasswordGenerator();

            if(SkipEmptyElement(xr)) return o;

            Debug.Assert(xr.NodeType == XmlNodeType.Element);
            xr.ReadStartElement();
            xr.MoveToContent();

            while(true)
            {
                XmlNodeType nt = xr.NodeType;
                if((nt == XmlNodeType.EndElement) || (nt == XmlNodeType.None)) break;
                if(nt != XmlNodeType.Element) { Debug.Assert(false); continue; }

                switch(xr.LocalName)
                {
                    case "AutoGeneratedPasswordsProfile":
                        o.AutoGeneratedPasswordsProfile = ReadPwProfile(xr);
                        break;
                    case "LastUsedProfile":
                        o.LastUsedProfile = ReadPwProfile(xr);
                        break;
                    case "UserProfiles":
                        o.UserProfiles = ReadListOfPwProfile(xr);
                        break;
                    default:
                        Debug.Assert(false);
                        xr.Skip();
                        break;
                }

                xr.MoveToContent();
            }

            Debug.Assert(xr.NodeType == XmlNodeType.EndElement);
            xr.ReadEndElement();
            return o;
        }