Пример #1
0
        static List<EventInfo> getEventInfo(string parentEvent, GeneratedCode.EventTypeInfo eventType)
        {
            List<EventInfo> events = new List<EventInfo>();
            string name = eventType.Name;
            EventInfo e = new EventInfo(name);
            e.parentName = parentEvent;
            e.shouldLog = eventType.Log;
            e.shouldReplay = eventType.Replay;
            e.shouldForkReplay = eventType.ForkReplay;
            e.simCoreSubscribe = eventType.SimCoreSubscribe;
            e.description = eventType.Description;

            if (eventType.Parameter != null)
            {
                for (int i = 0; i < eventType.Parameter.Length; i++)
                {
                    string pName = eventType.Parameter[i].Name;
                    string pType = eventType.Parameter[i].DataType.ToString();
                    string pDescript = eventType.Parameter[i].Value;
                    e.parameters[pName] = new ParameterInfo(pName, pType);
                    e.parameters[pName].description = pDescript;
                }
            }
            events.Add(e);
            if (eventType.EventType != null)
            {
                for (int i = 0; i < eventType.EventType.Length; i++)
                {
                    events.AddRange(getEventInfo(name, eventType.EventType[i]));
                }
            }
            return events;
        }
Пример #2
0
        void WriteEventHTML(ref StreamWriter outFile, EventInfo eventInfo)
        {
            //outFile.WriteLine(String.Format("<a name=\"{0}\"><h4>{0}</h4></a>", eventInfo.name));
            //outFile.WriteLine(String.Format("<p><h4>{0}</h4></p>",eventInfo.name));
            outFile.WriteLine(String.Format("<table border=\"1\">"));

            outFile.WriteLine("<tr>");
            outFile.WriteLine(String.Format("<td><b>Event Name</b></td>"));
            outFile.WriteLine(String.Format("<td><a name=\"{0}\"><b>{0}</b></a></td>", eventInfo.name));
            outFile.WriteLine("</tr>");

            outFile.WriteLine("<tr>");
            outFile.WriteLine(String.Format("<td>Description</td>"));
            outFile.WriteLine(String.Format("<td>{0}</td>", eventInfo.description));
            outFile.WriteLine("</tr>");

            outFile.WriteLine("<tr>");
            outFile.WriteLine(String.Format("<td>Written to DDD Log File</td>"));
            outFile.WriteLine(String.Format("<td>{0}</td>", eventInfo.shouldLog));
            outFile.WriteLine("</tr>");

            outFile.WriteLine("<tr>");
            outFile.WriteLine(String.Format("<td>Read for Replay</td>"));
            outFile.WriteLine(String.Format("<td>{0}</td>", eventInfo.shouldReplay));
            outFile.WriteLine("</tr>");

            outFile.WriteLine("<tr>");
            outFile.WriteLine(String.Format("<td>Parameters</td>"));
            outFile.WriteLine(String.Format("<td>"));
            outFile.WriteLine(String.Format("<table border=\"1\">"));
            outFile.WriteLine("<tr><th>Name</th><th>Data Type</th><th>Description</th></tr>");

            foreach (ParameterInfo pi in eventInfo.parameters.Values)
            {
                WriteParameterHTML(ref outFile, pi);
            }

            outFile.WriteLine(String.Format("</table>"));
            outFile.WriteLine(String.Format("</td>"));
            outFile.WriteLine("</tr>");

            outFile.WriteLine(String.Format("</table>"));
            outFile.WriteLine("<a href=\"#TOC\">Back to Table of Contents</a>");
            outFile.WriteLine(String.Format("<p></p>"));
        }