public InformationDetails Read(string ControlName)
        {
            InformationDetails infoDet = null;

            XmlDocument d = new XmlDocument();

            d.Load(_xmlInfoFile);

            string xpath = "/ControlInformations/control[@name=\"{0}\"]";

            xpath = string.Format(xpath, ControlName);

            XmlNode thisNode = d.SelectSingleNode(xpath);

            if (thisNode != null)
            {
                infoDet = new InformationDetails();

                XmlNode node;

                node = thisNode.SelectSingleNode("./title/text()");
                if (node != null)
                {
                    infoDet.Title = node.Value;
                }

                node = thisNode.SelectSingleNode("./short_description/text()");
                if (node != null)
                {
                    infoDet.ShortDescription = node.Value;
                }

                node = thisNode.SelectSingleNode("./infos/text()");
                if (node != null)
                {
                    infoDet.Information = node.Value;
                }
            }

            d = null;

            return(infoDet);
        }
        public InformationDetails Read(string ControlName)
        {
            InformationDetails infoDet = null;

            XmlDocument d = new XmlDocument();

            d.Load(_xmlInfoFile);

            string xpath = "/ControlInformations/control[@name=\"{0}\"]";
            xpath = string.Format(xpath, ControlName);

            XmlNode thisNode = d.SelectSingleNode(xpath);

            if (thisNode != null)
            {
                infoDet = new InformationDetails();

                XmlNode node;

                node = thisNode.SelectSingleNode("./title/text()");
                if (node != null)
                {
                    infoDet.Title = node.Value;
                }

                node = thisNode.SelectSingleNode("./short_description/text()");
                if (node != null)
                {
                    infoDet.ShortDescription = node.Value;
                }

                node = thisNode.SelectSingleNode("./infos/text()");
                if (node != null)
                {
                    infoDet.Information = node.Value; 
                }
            }

            d = null;

            return infoDet;
        }
Esempio n. 3
0
        private void c_MouseHover(object sender, EventArgs e)
        {
            Type         t      = sender.GetType();
            PropertyInfo piName = t.GetProperty("Name");

            if (piName != null)
            {
                string controlName = piName.GetValue(sender, null).ToString();

                XMLInformationReader xmlinforeader = new XMLInformationReader(_xmlInfoFile);
                InformationDetails   infoDet       = xmlinforeader.Read(controlName);

                if (infoDet != null)
                {
                    lblTitle.Text            = infoDet.Title;
                    lblShortDescription.Text = infoDet.ShortDescription;
                    lblInfo.Text             = infoDet.Information;

                    ShowWindow();
                }
            }
        }