public IContentEditor CreateEditorFromHtmlDocument(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags) { return new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, null, null); }
public DelayedInsert(string content, HtmlInsertOptions options) { Content = content; Options = options; }
public void InsertHtml(string html, HtmlInsertOptions options) { contentEditor.InsertHtml(html, (HtmlInsertionOptions)options | HtmlInsertionOptions.ExternalContent); }
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); }
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); }
public IContentEditor CreateEditorFromHtmlDocument(IContentEditorSite contentEditorSite, IInternetSecurityManager internetSecurityManager, IHTMLDocument2 htmlDocument, HtmlInsertOptions options, int dlControlFlags) { return(new ContentEditorProxy(this, contentEditorSite, internetSecurityManager, htmlDocument, options, dlControlFlags, null, null)); }
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); }
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)); }