Beispiel #1
0
        public GestioneTestoHTML(CondominioDTO condominioDTO, string testo, MergeFieldType tipo, bool showTable, bool isUpdateAllow, bool showIllustrationsBar = false, string tipoTesto = "HTML")
        {
            int? idCondominio = null;
            if (condominioDTO != null)
                idCondominio = condominioDTO.ID;

            InitializeComponent();
            _isUpdateAllow = isUpdateAllow;

            _richControlEditorUC1 = new RichControlEditorUC(tipo)
            {
                Dock = DockStyle.Fill,
                Location = new System.Drawing.Point(3, 3),
                Name = "richControlEditorUC1",
                Size = new System.Drawing.Size(655, 470),
                TabIndex = 1
            };

            _richControlEditorUC1.SetCssInline();
            _richControlEditorUC1.LoadDocumento(idCondominio, Gipasoft.Library.Conversione.ToStream(testo), tipoTesto);
            _richControlEditorUC1.ReadOnly = !_isUpdateAllow;
            _richControlEditorUC1.HideAllegati();
            _richControlEditorUC1.ShowHideTableBars(showTable);
            _richControlEditorUC1.ShowHideIllustrationsBar(showIllustrationsBar);

            tableLayoutPanel1.Controls.Add(_richControlEditorUC1, 0, 0);

            if (!_isUpdateAllow)
                btnConferma.Enabled = false;
        }
Beispiel #2
0
 private DocumentRange pDocumentReplace(RichControlEditorUC editor, string text)
 {
     editor.Document.Replace(editor.Document.Selection, "");
     text = text.Trim();
     if (!text.StartsWith("{\\rtf"))
     {
         text = "{\\rtf " + text + "}";
     }
     return editor.Document.InsertRtfText(editor.Document.CaretPosition, text);
 }