Пример #1
0
 private void UpdateHTMLBriefing(string html)
 {
     BriefingWebBrowser.Navigate("about:blank"); // The WebBrowser control must navigate to a new page or it won't update its content
     if (BriefingWebBrowser.Document != null)
     {
         BriefingWebBrowser.Document.Write(string.Empty);
     }
     BriefingWebBrowser.DocumentText = html;
 }
Пример #2
0
        /// <summary>
        /// Generates a new mission from the mission template.
        /// </summary>
        private void GenerateMission()
        {
            SetExportMenuButtonsEnabledState(false);

            DestroyMission();
            Mission = HQ.Generator.Generate(Template, out string errorMessage);

            BriefingWebBrowser.Navigate("about:blank");
            BriefingWebBrowser.Document.OpenNew(false);
            if (Mission == null)
            {
                BriefingWebBrowser.Document.Write($"<html><head></head><body><h2>Failed to generate mission</h2><p><strong>ERROR: </strong>{errorMessage}</p></body>");
            }
            else
            {
                BriefingWebBrowser.Document.Write(Mission.BriefingHTML);
            }
            BriefingWebBrowser.Refresh();

            SetExportMenuButtonsEnabledState(Mission != null);
        }