예제 #1
0
            public void ReadFromSerializer(SerializerBase Stream)
            {
                string NodeGroup;
                int    StartNodeLevel = 0, CurrNodeLevel = 0;

                do
                {
                    NodeGroup     = Stream.GetNodeName();
                    CurrNodeLevel = Stream.GetNodeLevel();
                    if (CurrNodeLevel < StartNodeLevel)
                    {
                        break;
                    }
                    if (Stream.GetNodeType() != SerializerBase.NodeType.NodeEnd)
                    {
                        if (NodeGroup == s_UserFile)
                        {
                            m_LastTypeName = Stream.ReadAsString("LastType");
                        }
                        else if (NodeGroup == SerializerXML.FieldName.SerializerDocName.ToString())
                        {
                            if (NodeGroup != "UserDat")
                            {
                                throw new Exception(SerializerXML.FieldName.SerializerDocName.ToString() + " unknown");
                            }
                        }
                    }
                } while (Stream.ReadNext());
            }
예제 #2
0
        public void ReadFromSerializer(SerializerBase Stream)
        {
            User oldUser = m_User;

            m_Users = null;
            m_Users = new UserCollection();
            LoginUser("", ""); //un-log to default user
            string NodeGroup;
            int    StartNodeLevel = 0, CurrNodeLevel = 0;

            do
            {
                NodeGroup     = Stream.GetNodeName();
                CurrNodeLevel = Stream.GetNodeLevel();
                if (CurrNodeLevel < StartNodeLevel)
                {
                    break;
                }
                if (Stream.GetNodeType() != Core.SerializerBase.NodeType.NodeEnd)
                {
                    if (NodeGroup == "User")
                    {
                        string s = Stream.ReadAsString("Name");
                        int    r = Stream.ReadAsInt("Role");
                        string x = Stream.ReadAsString("Pass");
                        m_Users.Add(s, User.CreateUserEncrypPass(s, x, (User.EnuUserRole)r));
                    }
                    else if (NodeGroup == SerializerXML.FieldName.SerializerDocName.ToString())
                    {
                        if (NodeGroup != "UserDat")
                        {
                            throw new Exception(SerializerXML.FieldName.SerializerDocName.ToString() + " unknown");
                        }
                    }
                }
            } while (Stream.ReadNext());
        }