예제 #1
0
        public TinyMce CreateInstance()
        {
            if (tinyMce == null)
            {
                // If we are coming from TextFavoritePanel
                if (ParentForm == null)
                {
                    tinyMce = new TinyMce();
                }
                // If we are in this class
                else
                {
                    InvokeIfNecessary(() => tinyMce = new TinyMce());
                }

                // Set the text automatically in our public "Text" property when it has been changed.
                tinyMce.TextChanged += (sender, args) => this.Text = tinyMce.Text;
            }

            // Assume by default that tiny mce is now shown -> only the resulting html
            tinyMce.IsTextEditable = false;

            // If we are coming from TextFavoritePanel
            if (Favorite != null)
            {
                tinyMce.IsTextEditable = Favorite.ShowTinyMceInConnectionMode();
            }

            tinyMce.Text = this.Text;

            return(tinyMce);
        }