private void btnEdit_Click(object sender, EventArgs e)
        {
            using (var frm = new frmEdit())
            {
                frm.Editor.ContentText = this.Editor.ContentText;
                frm.Editor.CssClass = this.Editor.CssClass;

                DialogResult res = frm.ShowDialog();
                if (res == DialogResult.OK)
                {
                    SelectedContent.Properties.SetString("code", frm.Editor.ContentText);
                    SelectedContent.Properties.SetString("class", frm.Editor.CssClass);
                    base.OnContentEdited();
                    OnSelectedContentChanged();
                }
            }
        }
Esempio n. 2
0
        public override System.Windows.Forms.DialogResult CreateContent(System.Windows.Forms.IWin32Window dialogOwner, ISmartContent newContent)
        {
            using (var form = new frmEdit())
            {
                if (Clipboard.ContainsText())
                {
                    form.Editor.ContentText = Clipboard.GetText();
                }
                DialogResult res = form.ShowDialog();
                if (res == DialogResult.OK)
                {
                    newContent.Properties.SetString("code", form.Editor.ContentText);
                    newContent.Properties.SetString("class", form.Editor.CssClass);
                }

                return res;
            }
        }