/// <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 ); }
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; }
internal static HostmaskCollection UnpackHostmasks( XmlNodeList masks ) { HostmaskCollection mskcol = new HostmaskCollection(); for (int i=0; i<masks.Count; i++) { Console.WriteLine("Unpacking a hostmask"); mskcol.Add( masks[i] ); } return mskcol; }