void AppendColorFormattedMessage(DevExpress.Xpf.RichEdit.RichEditControl richEditControl, string formattedMessage, Color color)
        {
            try
            {
                //doc.BeginUpdate();

                //// This updates the entire document, sigh
                //doc.DefaultCharacterProperties.ForeColor = Color.Red;

                //doc.AppendText(formattedMessage);

                //doc.EndUpdate();

                Document doc = richEditControl.Document;

                DocumentRange       newRange = doc.AppendText(formattedMessage);
                CharacterProperties charProp = doc.BeginUpdateCharacters(newRange);
                charProp.ForeColor = color;
                doc.EndUpdateCharacters(charProp);
            }
            catch (Exception ex)
            {
                string exception      = ex.ToString();
                string innerException = ex.InnerException.ToString();
            }
        }
Ejemplo n.º 2
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Marketing.UI.Controls;component/PostViewControl.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.BodyText = ((System.Windows.Controls.TextBox)(this.FindName("BodyText")));
     this.richEditControl = ((DevExpress.Xpf.RichEdit.RichEditControl)(this.FindName("richEditControl")));
 }
        //AppendFormattedText(recLogStream, Color color)
        #region Connection Events

        void AppendFormattedMessage(DevExpress.Xpf.RichEdit.RichEditControl richEditControl, string formattedMessage)
        {
            try
            {
                Document doc = richEditControl.Document;

                doc.BeginUpdate();

                doc.AppendText(formattedMessage);

                doc.EndUpdate();
            }
            catch (Exception ex)
            {
                string exception      = ex.ToString();
                string innerException = ex.InnerException.ToString();
                int    x = 3;
            }
        }
        //AppendFormattedText(recLogStream, Color color)
        #region Connection Events

        void AppendFormattedMessage(DevExpress.Xpf.RichEdit.RichEditControl richEditControl, string formattedMessage)
        {
            // This works
            //richEditControl.Text += formattedMessage;
            // This throws not Rtf format exception
            //richEditControl.RtfText += formattedMessage;

            try
            {
                Document doc = richEditControl.Document;

                doc.BeginUpdate();

                doc.AppendText(formattedMessage);
                //doc.AppendRtfText(formattedMessage);

                doc.EndUpdate();
            }
            catch (Exception ex)
            {
                string exception      = ex.ToString();
                string innerException = ex.InnerException.ToString();
                int    x = 3;
            }

            //doc.BeginUpdate();

            //recLogStream.Document.AppendRtfText(formattedMessage);

            //doc.EndUpdate();

            //DocumentPosition docPosition = doc.CaretPosition;

            //recLogStream.Document.InsertRtfText(docPosition, formattedMessage);

            //recLogStream.RtfText += formattedMessage;

            //Range range = new Range();

            //CharacterProperties cp = doc.BeginUpdateCharacters(docPosition.);

            //recLogStream.RtfText += range.ToString();
        }
Ejemplo n.º 5
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Marketing.UI.Controls;component/PostDetailsControl.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ResponseEdit = ((System.Windows.Controls.TextBox)(this.FindName("ResponseEdit")));
     this.ResponseHtmlEdit = ((System.Windows.Controls.TextBox)(this.FindName("ResponseHtmlEdit")));
     this.barManager1 = ((DevExpress.Xpf.Bars.BarManager)(this.FindName("barManager1")));
     this.biPageLayoutMargins = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biPageLayoutMargins")));
     this.biPageLayoutNormalMargins = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutNormalMargins")));
     this.biPageLayoutNarrowMargins = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutNarrowMargins")));
     this.biPageLayoutModerateMargins = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutModerateMargins")));
     this.biPageLayoutWideMargins = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutWideMargins")));
     this.biPageLayoutOrientation = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biPageLayoutOrientation")));
     this.biPageLayoutPortraitOrientation = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutPortraitOrientation")));
     this.biPageLayoutLandscapeOrientation = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutLandscapeOrientation")));
     this.biPageLayoutSize = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biPageLayoutSize")));
     this.biPageLayoutSizeList = ((DevExpress.Xpf.RichEdit.UI.PaperKindBarListItem)(this.FindName("biPageLayoutSizeList")));
     this.biPageLayoutColumns = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biPageLayoutColumns")));
     this.biPageLayoutOneColumn = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutOneColumn")));
     this.biPageLayoutTwoColumns = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutTwoColumns")));
     this.biPageLayoutThreeColumns = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutThreeColumns")));
     this.biPageLayoutColumnsOptions = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biPageLayoutColumnsOptions")));
     this.biInsertBreak = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biInsertBreak")));
     this.biInsertPageBreak = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertPageBreak")));
     this.biInsertColumnBreak = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertColumnBreak")));
     this.biInsertSectionBreakNextPage = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertSectionBreakNextPage")));
     this.biInsertSectionBreakContinuous = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertSectionBreakContinuous")));
     this.biInsertSectionBreakEvenPage = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertSectionBreakEvenPage")));
     this.biInsertSectionBreakOddPage = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biInsertSectionBreakOddPage")));
     this.biPageLayoutLineNumbering = ((DevExpress.Xpf.Bars.BarSubItem)(this.FindName("biPageLayoutLineNumbering")));
     this.biPageLayoutLineNumberingNone = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutLineNumberingNone")));
     this.biPageLayoutLineNumberingContinuous = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutLineNumberingContinuous")));
     this.biPageLayoutLineNumberingRestartNewPage = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutLineNumberingRestartNewPage")));
     this.biPageLayoutLineNumberingRestartNewSection = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biPageLayoutLineNumberingRestartNewSection")));
     this.biFormatParagraphSuppressLineNumbers = ((DevExpress.Xpf.Bars.BarCheckItem)(this.FindName("biFormatParagraphSuppressLineNumbers")));
     this.biPageLayoutLineNumberingOptions = ((DevExpress.Xpf.Bars.BarButtonItem)(this.FindName("biPageLayoutLineNumberingOptions")));
     this.ribbonControl1 = ((DevExpress.Xpf.Ribbon.RibbonControl)(this.FindName("ribbonControl1")));
     this.pagePageLayout = ((DevExpress.Xpf.Ribbon.RibbonPage)(this.FindName("pagePageLayout")));
     this.grpPageSetup = ((DevExpress.Xpf.Ribbon.RibbonPageGroup)(this.FindName("grpPageSetup")));
     this.richEditControl = ((DevExpress.Xpf.RichEdit.RichEditControl)(this.FindName("richEditControl")));
 }