Beispiel #1
0
        override public void Add(myMessage message)
        {
            txtFile myTXT = new txtFile();

            message.Time = DateTime.Now.ToString();
            myTXT.output(message);
        }
Beispiel #2
0
        override public void Add(myMessage message)
        {
            xmlFile myXML = new xmlFile();

            message.Time = DateTime.Now.ToString();
            myXML.output(message);
        }
Beispiel #3
0
        public override void output(myMessage message)
        {
            checkOver(message.To);
            XmlDocument xDoc = new XmlDocument();

            xDoc.Load(message.To);
            //Create root of our XMLdocument
            XmlElement xRoot = xDoc.DocumentElement;
            //Create new child node of our root!
            XmlElement First_element = xDoc.CreateElement("message");
            //Create inner elements
            XmlElement _level = xDoc.CreateElement("level");
            XmlElement _from  = xDoc.CreateElement("from");
            XmlElement _time  = xDoc.CreateElement("time");
            XmlElement _text  = xDoc.CreateElement("text");
            //Create text with is included in elements
            XmlText levelText = xDoc.CreateTextNode(message.Level.ToString());
            XmlText fromText  = xDoc.CreateTextNode(message.From);
            XmlText timeText  = xDoc.CreateTextNode(message.Time);
            XmlText Text      = xDoc.CreateTextNode(message.Text);

            //Add text in the elements
            _level.AppendChild(levelText);
            _from.AppendChild(fromText);
            _time.AppendChild(timeText);
            _text.AppendChild(Text);

            //Add insiding elements in outsiding
            First_element.AppendChild(_level);
            First_element.AppendChild(_from);
            First_element.AppendChild(_time);
            First_element.AppendChild(_text);

            //Add new message in our root
            xRoot.AppendChild(First_element);
            //Save document
            xDoc.Save(message.To);
        }
Beispiel #4
0
 public virtual void Add(myMessage message)
 {
 }
Beispiel #5
0
        public override void output(myMessage message)
        {
            string newText = checkOver(message.To) + message.Level.ToString() + " / " + message.From + " / " + message.Time + " / " + message.Text;

            File.WriteAllText(message.To, newText);
        }
Beispiel #6
0
 public virtual void output(myMessage message)
 {
 }