Пример #1
0
        public HomeScreen()
        {
            InitializeComponent();

            XmlDocument xdoc = new XmlDocument();

            xdoc.Load("users.xml");

            ProfileSelector ps;

            XmlElement root = xdoc.DocumentElement;
            XmlNodeList userNodes = root.SelectNodes("/users/user");

            for (int i = 0; (i < userNodes.Count); i++)
            {
                ps =  new ProfileSelector(userNodes.Item(i)["name"].InnerText, userNodes.Item(i)["pic"].InnerText, this);
                ProfilePanel.Controls.Add(ps);
            }

            //need to check if anyone can create a new user
            var doc = System.Xml.Linq.XDocument.Load("settings.xml");

            if(doc.Element("allowCreate").Value.Equals("false"))
            {
                button2.Visible = false;
            }
        }
Пример #2
0
 // Method to add ProfileBox to FlowLayoutPanel
 public void addProfileBox(string name, string imagePath)
 {
     ProfileSelector ps = new ProfileSelector(name, imagePath, this);
     ProfilePanel.Controls.Add(ps);
 }