Пример #1
0
        private static void BuildRootDocument(FrmBuildHtmlDocument.ProcessInfo ProcessInfoHandler)
        {
            if (ProcessInfoHandler != null)
            {
                ProcessInfoHandler("RememberIt.html");
            }

            string root_path = Globals.GetCardsPath();

            string[] group_paths = Globals.GetPathOfEachGroup();
            if (group_paths == null)
            {
                return;
            }

            byte[] file_bytes     = RememberItTemplate;
            string card_group_doc = ASCIIEncoding.ASCII.GetString(file_bytes);

            card_group_doc = card_group_doc.Replace("$groups", Globals.GetButtonsForGroups());

            file_bytes = ASCIIEncoding.ASCII.GetBytes(card_group_doc);

            if (file_bytes.Length <= 3)
            {
                return;
            }
            file_bytes[0] = 0xEF;
            file_bytes[1] = 0xBB;
            file_bytes[2] = 0xBF;
            string html_file_name = root_path + "/RememberIt.html";

            File.WriteAllBytes(html_file_name, file_bytes);

            Process.Start(html_file_name);
        }