Example #1
0
 private SourceGrid.Cells.RichTextBox CreateRichTextBox()
 {
     DevAge.Windows.Forms.RichText richText = new DevAge.Windows.Forms.RichText(
             "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0" +
             "Microsoft Sans Serif;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs17 Only a \\b " +
             "Test\\b0.\\par\r\n}\r\n");
     return new SourceGrid.Cells.RichTextBox(richText);
 }
Example #2
0
 /// <summary>
 /// Value constrcutor
 /// </summary>
 public RichTextBox(DevAge.Windows.Forms.RichText value)
     : base(value)
 {
     View = new Views.RichTextBox();
     Model.AddModel(new Models.RichTextBox());
     AddController(Controllers.RichTextBox.Default);
     Editor = new Editors.RichTextBox();
 }
Example #3
0
 private SourceGrid.Cells.RichTextBox CreateRichTextBox()
 {
     DevAge.Windows.Forms.RichText richText = new DevAge.Windows.Forms.RichText(
         "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0" +
         "Microsoft Sans Serif;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs17 Only a \\b " +
         "Test\\b0.\\par\r\n}\r\n");
     return(new SourceGrid.Cells.RichTextBox(richText));
 }
        /// <summary>
        /// Check if the selected value is valid based on the
        /// current validator and returns the value.
        /// </summary>
        /// <param name="convertedValue"></param>
        /// <returns></returns>
        public bool IsValidValue(out DevAge.Windows.Forms.RichText convertedValue)
        {
            if (Validator != null)
            {
                object convertedRichTextValue = null;
                bool   success = false;
                if (Validator.IsValidObject(new RichText(this.Rtf), out convertedRichTextValue))
                {
                    success = true;
                }

                convertedValue = convertedRichTextValue as DevAge.Windows.Forms.RichText;
                return(success);
            }
            else
            {
                convertedValue = new RichText(this.Rtf);
                return(true);
            }
        }
        /// <summary>
        /// Convert rtf to plain text
        /// </summary>
        /// <returns></returns>
        public static String RichTextToString(DevAge.Windows.Forms.RichText rtf)
        {
            String txt = String.Empty;

            RichTextBox richTextBox = new RichTextBox();

            try
            {
                richTextBox.Rtf = rtf.Rtf;
                txt             = richTextBox.Text;
            }
            catch (Exception)
            {
                // rtf is not convertable
                // return empty text string
            }
            richTextBox.Dispose();

            return(txt);
        }
Example #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="value"></param>
 public RichTextGDI(DevAge.Windows.Forms.RichText value)
     : base(value)
 {
 }
Example #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="value"></param>
 public RichText(DevAge.Windows.Forms.RichText value)
 {
     Value = value;
 }
 public static String RichTextToStringStripWhitespaces(DevAge.Windows.Forms.RichText rtf)
 {
     return(System.Text.RegularExpressions.Regex.Replace(RichTextToString(rtf), @"[\t\n\r\f\v]", string.Empty));
 }