コード例 #1
0
        //----< function to popup new window and display full file text>----------------

        public void showFile(string fileName, CsMessage msg)
        {
            // reads file into string and display it in new popup window
            MainWindow win          = (MainWindow)Window.GetWindow(this);
            string     path         = win.saveFilesPath + "\\" + fileName;
            string     fileContents = File.ReadAllText(path);
            Paragraph  paragraph    = new Paragraph();

            paragraph.Inlines.Add(new Run(fileContents));
            CodePopUpWindow popUp = new CodePopUpWindow();

            popUp.codeView.Blocks.Clear();
            popUp.codeLabel.Text = fileName;
            popUp.codeView.Blocks.Add(paragraph);
            string auth, stat, date, cat, dep, ver;

            msg.attributes.TryGetValue("author", out auth);
            msg.attributes.TryGetValue("status", out stat);
            msg.attributes.TryGetValue("datetime", out date);
            msg.attributes.TryGetValue("categories", out cat);
            msg.attributes.TryGetValue("dependencies", out dep);
            msg.attributes.TryGetValue("version", out ver);
            popUp.dauth.Text = auth;
            popUp.dstat.Text = stat;
            popUp.ddate.Text = date;
            popUp.dcat.Text  = cat;
            popUp.ddep.Text  = dep;
            popUp.dver.Text  = ver;
            popUp.Show();
        }
コード例 #2
0
        //----< show file text >----------------
        private void showFile(string fileName, string fileContents)
        {
            Paragraph paragraph = new Paragraph();

            paragraph.Inlines.Add(new Run(fileContents));
            CodePopUpWindow popUp = new CodePopUpWindow();

            popUp.Show();
            popUp.codeView.Blocks.Clear();
            popUp.codeView.Blocks.Add(paragraph);
        }