Пример #1
0
        /// <summary>
        /// Returns the string representation of the timer.
        /// </summary>
        public override string ToString()
        {
            string s;

            s = WakeHour.ToString() + ":" + WakeMinute.ToString() + ":" + WakeSecond.ToString();
            return(s);
        }
Пример #2
0
        /// <summary>
        /// Returns the XML representation of the timer.
        /// </summary>
        /// <param name="doc">The XML document used to create the XmlNode.</param>
        public bool SerializeXml(XmlNode n, XmlDocument doc)
        {
            XmlNode h = doc.CreateElement("WakeHour");
            XmlNode m = doc.CreateElement("WakeMinute");
            XmlNode s = doc.CreateElement("WakeSecond");
            XmlNode e = doc.CreateElement("WakeEnabled");

            h.InnerText = WakeHour.ToString();
            m.InnerText = WakeMinute.ToString();
            s.InnerText = WakeSecond.ToString();
            e.InnerText = IsEnabled ? "1" : "0";

            n.AppendChild(h);
            n.AppendChild(m);
            n.AppendChild(s);
            n.AppendChild(e);

            return(true);
        }