Пример #1
0
 public IContentEditor CreateEditorFromHtmlDocument(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags)
 {
     return new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, null, null);
 }
Пример #2
0
 public DelayedInsert(string content, HtmlInsertOptions options)
 {
     Content = content;
     Options = options;
 }
Пример #3
0
 public void InsertHtml(string html, HtmlInsertOptions options)
 {
     contentEditor.InsertHtml(html, (HtmlInsertionOptions)options | HtmlInsertionOptions.ExternalContent);
 }
Пример #4
0
        public IContentEditor CreateEditorFromMoniker(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IMoniker moniker, uint codepage, HtmlInsertOptions options, string color, int dlControlFlags, string wpost)
        {
            codepage = EmailShim.GetCodepage(codepage);
            string name;
            string html = HTMLDocumentHelper.MonikerToString(moniker, codepage, out name);

            if (CultureHelper.IsRtlCodepage(codepage))
            {
                EmailContentTarget target =
                    GlobalEditorOptions.ContentTarget as EmailContentTarget;
                if (target != null)
                {
                    target.EnableRtlMode();
                }
            }

            if (string.IsNullOrEmpty(html))
                html = "<html><body></body></html>";

            html = EmailShim.GetContentHtml(name, html);

            // Create a IHtmlDocument2 from the html which will then be loaded into the editor
            IHTMLDocument2 htmlDocument;
            htmlDocument = HTMLDocumentHelper.StringToHTMLDoc(html, name);

            return new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, color, wpost);
        }
Пример #5
0
        public ContentEditorProxy(ContentEditorFactory factory, IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags, string color, string wpost)
        {
            string content = htmlDocument.body.innerHTML;
            htmlDocument.body.innerHTML = "{post-body}";
            string wysiwygHTML = HTMLDocumentHelper.HTMLDocToString(htmlDocument);
            BlogPost documentToBeLoaded = null;
            IBlogPostEditingContext editingContext = null;

            if (string.IsNullOrEmpty(wpost) || !File.Exists(wpost))
            {
                documentToBeLoaded = new BlogPost();
                editingContext = new BlogPostEditingContext(ContentEditorAccountAdapter.AccountId,
                                                                               documentToBeLoaded);
            }
            else
            {
                PostEditorFile wpostxFile = PostEditorFile.GetExisting(new FileInfo(wpost));
                editingContext = wpostxFile.Load(false);
                editingContext.BlogPost.Contents = "";
            }

            if (!string.IsNullOrEmpty(content))
                delayedInsertOperations.Enqueue(new DelayedInsert(content, options));

            ContentEditorProxyCore(factory, contentEditorSite, internetSecurityManager, wysiwygHTML, null, editingContext, new ContentEditorTemplateStrategy(), dlControlFlags, color);

        }
Пример #6
0
 public IContentEditor CreateEditorFromHtmlDocument(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags)
 {
     return(new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, null, null));
 }
Пример #7
0
 public void InsertHtml(string html, HtmlInsertOptions options)
 {
     contentEditor.InsertHtml(html, (HtmlInsertionOptions)options | HtmlInsertionOptions.ExternalContent);
 }
Пример #8
0
 public DelayedInsert(string content, HtmlInsertOptions options)
 {
     Content = content;
     Options = options;
 }
Пример #9
0
        public ContentEditorProxy(ContentEditorFactory factory, IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags, string color, string wpost)
        {
            string content = htmlDocument.body.innerHTML;

            htmlDocument.body.innerHTML = "{post-body}";
            string   wysiwygHTML                   = HTMLDocumentHelper.HTMLDocToString(htmlDocument);
            BlogPost documentToBeLoaded            = null;
            IBlogPostEditingContext editingContext = null;

            if (string.IsNullOrEmpty(wpost) || !File.Exists(wpost))
            {
                documentToBeLoaded = new BlogPost();
                editingContext     = new BlogPostEditingContext(ContentEditorAccountAdapter.AccountId,
                                                                documentToBeLoaded);
            }
            else
            {
                PostEditorFile wpostxFile = PostEditorFile.GetExisting(new FileInfo(wpost));
                editingContext = wpostxFile.Load(false);
                editingContext.BlogPost.Contents = "";
            }

            if (!string.IsNullOrEmpty(content))
            {
                delayedInsertOperations.Enqueue(new DelayedInsert(content, options));
            }

            ContentEditorProxyCore(factory, contentEditorSite, internetSecurityManager, wysiwygHTML, null, editingContext, new ContentEditorTemplateStrategy(), dlControlFlags, color);
        }
Пример #10
0
        public IContentEditor CreateEditorFromMoniker(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IMoniker moniker, uint codepage, HtmlInsertOptions options, string color, int dlControlFlags, string wpost)
        {
            codepage = EmailShim.GetCodepage(codepage);
            string name;
            string html = HTMLDocumentHelper.MonikerToString(moniker, codepage, out name);

            if (CultureHelper.IsRtlCodepage(codepage))
            {
                EmailContentTarget target =
                    GlobalEditorOptions.ContentTarget as EmailContentTarget;
                if (target != null)
                {
                    target.EnableRtlMode();
                }
            }

            if (string.IsNullOrEmpty(html))
            {
                html = "<html><body></body></html>";
            }

            html = EmailShim.GetContentHtml(name, html);

            // Create a IHtmlDocument2 from the html which will then be loaded into the editor
            IHTMLDocument2 htmlDocument;

            htmlDocument = HTMLDocumentHelper.StringToHTMLDoc(html, name);

            return(new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, color, wpost));
        }