override public void Add(myMessage message) { txtFile myTXT = new txtFile(); message.Time = DateTime.Now.ToString(); myTXT.output(message); }
override public void Add(myMessage message) { xmlFile myXML = new xmlFile(); message.Time = DateTime.Now.ToString(); myXML.output(message); }
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); }
public virtual void Add(myMessage message) { }
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); }
public virtual void output(myMessage message) { }