Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="User"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="saveUsers">The save users.</param>
 public User( string name, UserCollection.SaveUsersDelegate saveUsers )
 {
     this.name = name;
     nickName = name;
     password = name;
     this.saveUsers = saveUsers;
     hostmasks = new	HostmaskCollection();
     customSettings = new CustomSettingCollection( saveUsers );
 }
Example #2
0
 internal User(XmlNode node, UserCollection.SaveUsersDelegate saveUsers )
 {
     this.saveUsers = saveUsers;
     isCitizen = true; // a registered user, loaded from the userfile
     name = node.SelectSingleNode("name/text()").Value;
     password = node.SelectSingleNode("password/text()").Value;
     hostmasks = HostmaskCollection.UnpackHostmasks( node.SelectNodes("hostmasks/hostmask") );
     customSettings = CustomSettingCollection.UnpackSettings( node.SelectNodes("custom/*"), saveUsers );
     //			this.mdl = mdl;
 }
Example #3
0
        internal static CustomSettingCollection UnpackSettings( XmlNodeList settings, UserCollection.SaveUsersDelegate saveUsers)
        {
            CustomSettingCollection cstmcol = new CustomSettingCollection( saveUsers );
            for (int i=0; i<settings.Count; i++)
            {
                Console.WriteLine("Unpacking a setting");

                cstmcol.Add( settings[i] );
            }
            return cstmcol;
        }
Example #4
0
 /// <summary>
 /// Unpacks the users.
 /// </summary>
 /// <param name="usrs">The usrs.</param>
 /// <param name="saveUsers">The save users.</param>
 /// <returns></returns>
 internal static UserCollection UnpackUsers( XmlNodeList usrs, SaveUsersDelegate saveUsers )
 {
     UserCollection usrcol = new UserCollection(saveUsers);
     for (int i=0; i<usrs.Count; i++)
     {
         Console.WriteLine("Unpacking a user");
         usrcol.Add( usrs[i], saveUsers );
     }
     return usrcol;
 }
Example #5
0
 internal CustomSettingCollection( UserCollection.SaveUsersDelegate saveUsers )
 {
     this.saveUsers = saveUsers;
 }