示例#1
0
文件: MainForm.cs 项目: mbsky/bugx
 /// <summary>
 /// Loads the bug.
 /// </summary>
 /// <param name="fileName">Name of the file.</param>
 void LoadBug(string fileName)
 {
     BugFile.Text = fileName;
     BugDocument xml = new BugDocument();
     xml.Load(fileName);
     CurrentContext = ReBugContext.Create(xml);
     ContextExplorer.SelectedObject = new PropertyGridInspector(CurrentContext);
     ReBug.Enabled = true;
 }
示例#2
0
文件: Generator.cs 项目: mbsky/bugx
        /// <summary>
        /// Builds the report.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="context">The context.</param>
        static void BuildReport(string fileName, HttpContext context)
        {
            context.Response.ContentType = "text/html";
            XslCompiledTransform xsl     = new XslCompiledTransform();

            using (Stream     xslFile = XslFile)
            using (XmlWriter  writer  = new XmlTextWriter(context.Response.Output))
            {
                BugDocument bug = new BugDocument();
                bug.Load(fileName);
                xsl.Load(new XmlTextReader(xslFile));
                xsl.Transform(bug, XsltExtension.RegisterExtension(), writer);
            }
        }