Example #1
0
        private void DoTest(string MarkdownFileName, string XamlFileName)
        {
            string Markdown     = File.ReadAllText("Markdown/Syntax/" + MarkdownFileName);
            string ExpectedText = File.ReadAllText("XAML/" + XamlFileName);

            ExpectedText = ExpectedText.Replace("
\r", "
");
            Emoji1LocalFiles Emoji1LocalFiles = new Emoji1LocalFiles(Emoji1SourceFileType.Svg, 24, 24, "/emoji1/%FILENAME%", Path.Combine("Graphics", "Emoji1.zip"), "Graphics");

            MarkdownSettings Settings = new MarkdownSettings(Emoji1LocalFiles, true, new Variables())
            {
                HttpxProxy = "/HttpxProxy/%URL%"
            };

            Assert.IsTrue(Emoji1LocalFiles.WaitUntilInitialized(60000));

            MarkdownDocument Doc           = new MarkdownDocument(Markdown, Settings);
            string           GeneratedXaml = Doc.GenerateXAML(XML.WriterSettings(true, true));

            Console.Out.WriteLine(GeneratedXaml);
            Console.Out.WriteLine();
            Console.Out.WriteLine();
            Console.Out.WriteLine();

            MarkdownHtmlTests.AssertEqual(ExpectedText, GeneratedXaml, "Generated XAML does not match expected XAML.");
        }
Example #2
0
        internal static void InitEmojis()
        {
            if (emoji1_24x24 is null)
            {
                string Folder = Assembly.GetExecutingAssembly().Location;
                if (string.IsNullOrEmpty(Folder))
                {
                    Folder = AppDomain.CurrentDomain.BaseDirectory;
                }

                emoji1_24x24 = new Emoji1LocalFiles(Emoji1SourceFileType.Png64, 24, 24,
                                                    System.IO.Path.Combine(MainWindow.AppDataFolder, "Graphics", "Emoji1", "png", "64x64", "%FILENAME%"),
                                                    System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Folder), "Graphics", "Emoji1.zip"),
                                                    System.IO.Path.Combine(MainWindow.AppDataFolder, "Graphics"));
            }
        }
Example #3
0
        public ChatView(TreeNode Node)
        {
            string Folder = Assembly.GetExecutingAssembly().Location;

            if (string.IsNullOrEmpty(Folder))
            {
                Folder = AppDomain.CurrentDomain.BaseDirectory;
            }

            this.node = Node;

            if (emoji1_24x24 == null)
            {
                emoji1_24x24 = new Emoji1LocalFiles(Emoji1SourceFileType.Png64, 24, 24,
                                                    System.IO.Path.Combine(MainWindow.AppDataFolder, "Graphics", "Emoji1", "png", "64x64", "%FILENAME%"),
                                                    System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Folder), "Graphics", "Emoji1.zip"),
                                                    System.IO.Path.Combine(MainWindow.AppDataFolder, "Graphics"));
            }

            InitializeComponent();
        }
Example #4
0
        private void DoTest(string MarkdownFileName, string PlainTextFileName)
        {
            string           Markdown         = File.ReadAllText("Markdown/" + MarkdownFileName);
            string           ExpectedText     = File.ReadAllText("PlainText/" + PlainTextFileName);
            Emoji1LocalFiles Emoji1LocalFiles = new Emoji1LocalFiles(Emoji1SourceFileType.Svg, 24, 24, "/emoji1/%FILENAME%", Path.Combine("Graphics", "Emoji1.zip"), "Graphics");

            MarkdownSettings Settings = new MarkdownSettings(Emoji1LocalFiles, true, new Variables())
            {
                HttpxProxy = "/HttpxProxy/%URL%"
            };

            Assert.IsTrue(Emoji1LocalFiles.WaitUntilInitialized(60000));

            MarkdownDocument Doc           = new MarkdownDocument(Markdown, Settings);
            string           GeneratedText = Doc.GeneratePlainText();

            Console.Out.WriteLine(GeneratedText);
            Console.Out.WriteLine();
            Console.Out.WriteLine();
            Console.Out.WriteLine();

            MarkdownHtmlTests.AssertEqual(ExpectedText, GeneratedText, "Generated Plain Text does not match expected Plain Text.");
        }