예제 #1
0
        public PluginListForm(daedalusPluginBase.PluginBaseClass[] plugins, daedalusPluginBase.PluginBaseFormClass[] pluginGuis)
        {
            InitializeComponent();

            foreach (daedalusPluginBase.PluginBaseClass plugin in plugins)
            {
                Assembly a = Assembly.GetAssembly(plugin.GetType());
                this.listView1.Items.Add(new ListViewItem(new string[] { a.FullName, a.Location }));
            }

            foreach (daedalusPluginBase.PluginBaseFormClass plugin in pluginGuis)
            {
                Assembly a = Assembly.GetAssembly(plugin.GetType());
                this.listView1.Items.Add(new ListViewItem(new string[] { a.FullName, a.Location }));
            }
        }
        void LogClass_evt_newLogMessage(daedalusPluginBase.LogEntry le)
        {
            if (this.SrvRunning)
            {
                this.canSave = false;
                /*
                le.Level;
                le.Message;
                le.Timestamp;
                le.Title;
                */
                XmlNode newNode = xmldoc.CreateElement("entry");

                XmlNode node_timestamp = xmldoc.CreateElement("timestamp");
                XmlNode node_level = xmldoc.CreateElement("level");
                XmlNode node_title = xmldoc.CreateElement("title");
                XmlNode node_message = xmldoc.CreateElement("message");
                node_timestamp.InnerText = le.Timestamp.ToString();
                node_level.InnerText = le.Level.ToString();
                node_title.InnerText = le.Title;
                node_message.InnerText = le.Message;

                newNode.AppendChild(node_timestamp);
                newNode.AppendChild(node_level);
                newNode.AppendChild(node_timestamp);
                newNode.AppendChild(node_title);
                newNode.AppendChild(node_message);

                xmlroot.AppendChild(newNode);

                // Sicherstellen das die Log nicht zu vol wird. Daher auf maximal 100 Einträge begrenzen.
                while (xmlroot.ChildNodes.Count > 100)
                {
                    xmlroot.RemoveChild(xmlroot.FirstChild);
                }

                this.newDataToSave = true;
                this.canSave = true;
            }
        }
예제 #3
0
 static void LogClass_evt_newLogMessage(daedalusPluginBase.LogEntry le)
 {
     Console.WriteLine(le.Title + "\n" + le.Message + "\n");
 }