Beispiel #1
0
        public static void log_no_CR(ref RichTextBoxLinks rtxLog, string sText)
        {
            RichTextBox x = (RichTextBox)rtxLog;

            RTF.TextParser(ref x, sText);
            return;
        }
Beispiel #2
0
        public static void log(ref RichTextBoxLinks rtxLog, string sText)
        {
            RichTextBox x = (RichTextBox)rtxLog;

            RTF.log(ref x, sText, false);
            return;
        }
Beispiel #3
0
        public static void log_with_links(ref RichTextBoxLinks w, string s)
        {
            s = s.Replace("{{{", "<");
            s = s.Replace("}}}", ">");

            while (s.Contains("<link>") && s.Contains("</link>"))
            {
                string sAllTextUpToLink = Utils.Chopper(s, string.Empty, "<link>");

                string sRawLinkInfo = Utils.Chopper(s, "<link>", "</link>");

                string sLinkText = Utils.Chopper(sRawLinkInfo, "<text>", "</text>");
                string sLinkURL  = Utils.Chopper(sRawLinkInfo, "<url>", "</url>");

                // this replaces all instances of the link -- we don't want that
                //s = s.Replace(sAllTextUpToLink + "<link>" + sRawLinkInfo + "</link>", string.Empty);

                // this is a single replacement
                s = Utils.StringReplace(s, sAllTextUpToLink + "<link>" + sRawLinkInfo + "</link>", string.Empty, true, Utils.StringReplacePosition.Anywhere);

                if (sLinkText.Trim().Length == 0)
                {
                    sLinkText = sLinkURL;
                }
                if (sLinkText.Trim().Length != 0)
                {
                    RTF.log_no_CR(ref w, sAllTextUpToLink);

                    Color cBackup = w.SelectionColor;

                    w.InsertLink(sLinkText, sLinkURL);

                    w.SelectionColor = cBackup;
                }
            }

            RTF.log(ref w, s);
        }
Beispiel #4
0
        public static void log_with_links(ref RichTextBoxLinks w, string s)
        {
            s = s.Replace("{{{", "<");
            s = s.Replace("}}}", ">");

            while (s.Contains("<link>") && s.Contains("</link>"))
            {
                string sAllTextUpToLink = Utils.Chopper(s, string.Empty, "<link>");

                string sRawLinkInfo = Utils.Chopper(s, "<link>", "</link>");

                string sLinkText = Utils.Chopper(sRawLinkInfo, "<text>", "</text>");
                string sLinkURL = Utils.Chopper(sRawLinkInfo, "<url>", "</url>");

                // this replaces all instances of the link -- we don't want that
                //s = s.Replace(sAllTextUpToLink + "<link>" + sRawLinkInfo + "</link>", string.Empty);

                // this is a single replacement
                s = Utils.StringReplace(s, sAllTextUpToLink + "<link>" + sRawLinkInfo + "</link>", string.Empty, true, Utils.StringReplacePosition.Anywhere);

                if (sLinkText.Trim().Length == 0)
                    sLinkText = sLinkURL;
                if (sLinkText.Trim().Length != 0)
                {
                    RTF.log_no_CR(ref w, sAllTextUpToLink);

                    Color cBackup = w.SelectionColor;

                    w.InsertLink(sLinkText, sLinkURL);

                    w.SelectionColor = cBackup;
                }
            }

            RTF.log(ref w, s);
        }
Beispiel #5
0
 public static void log_no_CR(ref RichTextBoxLinks rtxLog, string sText)
 {
     RichTextBox x = (RichTextBox)rtxLog;
     RTF.TextParser(ref x, sText);
     return;
 }
Beispiel #6
0
 public static void log(ref RichTextBoxLinks rtxLog, string sText)
 {
     RichTextBox x = (RichTextBox)rtxLog;
     RTF.log(ref x, sText, false);
     return;
 }