Exemplo n.º 1
0
        /// <summary>
        /// Loads the data from an XML file.
        /// </summary>
        public void LoadData()
        {
            var c = Mentalis.Config;

            if (c == null)
            {
                return;
            }

            foreach (MentalisSection.UsersElementCollection.UserElement user in c.Users)
            {
                UserList.AddUserWithCryptedPassword(user.Name, user.Hash);
            }

            foreach (MentalisSection.ListenersElementCollection.ListenerElement listener in c.Listeners)
            {
                var  klass = Type.GetType(listener.Type);
                Guid id;
                if (!Guid.TryParse(listener.Id, out id))
                {
                    continue;
                }
                if (klass != null)
                {
                    Parent.AddListener(id, klass, Tools.ParseStringToParams(listener.Params));
                }
            }
        }